<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm/lib/Transforms/InstCombine, branch release_28</title>
<subtitle>http://llvm.org</subtitle>
<id>https://git.amat.us/llvm/atom/lib/Transforms/InstCombine?h=release_28</id>
<link rel='self' href='https://git.amat.us/llvm/atom/lib/Transforms/InstCombine?h=release_28'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/'/>
<updated>2010-09-07T20:14:32Z</updated>
<entry>
<title>Approved by Chris:</title>
<updated>2010-09-07T20:14:32Z</updated>
<author>
<name>Bill Wendling</name>
<email>isanbard@gmail.com</email>
</author>
<published>2010-09-07T20:14:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=4c0eaab1b52b79e2c5fcc4084638063f8f321db2'/>
<id>urn:sha1:4c0eaab1b52b79e2c5fcc4084638063f8f321db2</id>
<content type='text'>
$ svn merge -c 113257 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r113257 into '.':
A    test/Transforms/InstCombine/sqrt.ll
D    test/Transforms/InstCombine/2010-07-19-sqrt.ll

Renaming test.

$ svn merge -c 113260 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r113260 into '.':
U    test/Transforms/InstCombine/sqrt.ll
U    lib/Transforms/InstCombine/InstCombineCasts.cpp

Log:
Fix a serious performance regression introduced by r108687 on linux:
turning (fptrunc (sqrt (fpext x))) -&gt; (sqrtf x)  is great, but we have
to delete the original sqrt as well.  Not doing so causes us to do 
two sqrt's when building with -fmath-errno (the default on linux).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_28@113265 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>Remove r111665, which implemented store-narrowing in InstCombine.  Chris discovered a miscompilation in it, and it's not easily</title>
<updated>2010-08-31T04:41:06Z</updated>
<author>
<name>Owen Anderson</name>
<email>resistor@mac.com</email>
</author>
<published>2010-08-31T04:41:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=c97fb52799eea845569425c0430b2b944cad7093'/>
<id>urn:sha1:c97fb52799eea845569425c0430b2b944cad7093</id>
<content type='text'>
fixable at the optimizer level. I'll investigate reimplementing it in DAGCombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112575 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>for completeness, allow undef also.</title>
<updated>2010-08-28T03:36:51Z</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2010-08-28T03:36:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=157d4ead36ace978a01d80a29aa1b53c832ebafb'/>
<id>urn:sha1:157d4ead36ace978a01d80a29aa1b53c832ebafb</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112351 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>handle the constant case of vector insertion.  For something</title>
<updated>2010-08-28T01:50:57Z</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2010-08-28T01:50:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=790077954384a4546fa68247744104936fd9b6cf'/>
<id>urn:sha1:790077954384a4546fa68247744104936fd9b6cf</id>
<content type='text'>
like this:

struct S { float A, B, C, D; };

struct S g;
struct S bar() { 
  struct S A = g;
  ++A.B;
  A.A = 42;
  return A;
}

we now generate:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	12(%rax), %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	unpcklps	%xmm0, %xmm1
	addss	LCPI1_0(%rip), %xmm2
	pshufd	$16, %xmm2, %xmm2
	movss	LCPI1_1(%rip), %xmm0
	pshufd	$16, %xmm0, %xmm0
	unpcklps	%xmm2, %xmm0
	ret

instead of:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	12(%rax), %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	unpcklps	%xmm0, %xmm1
	addss	LCPI1_0(%rip), %xmm2
	movd	%xmm2, %eax
	shlq	$32, %rax
	addq	$1109917696, %rax       ## imm = 0x42280000
	movd	%rax, %xmm0
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112345 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>optimize bitcasts from large integers to vector into vector</title>
<updated>2010-08-28T01:20:38Z</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2010-08-28T01:20:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=3dd08734c1812e47ae5f6aceba15f28865f75943'/>
<id>urn:sha1:3dd08734c1812e47ae5f6aceba15f28865f75943</id>
<content type='text'>
element insertion from the pieces that feed into the vector.
This handles a pattern that occurs frequently due to code
generated for the x86-64 abi.  We now compile something like
this:

struct S { float A, B, C, D; };
struct S g;
struct S bar() { 
  struct S A = g;
  ++A.A;
  ++A.C;
  return A;
}

into all nice vector operations:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	LCPI1_0(%rip), %xmm1
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	12(%rax), %xmm3
	pshufd	$16, %xmm2, %xmm2
	unpcklps	%xmm2, %xmm0
	addss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	pshufd	$16, %xmm3, %xmm2
	unpcklps	%xmm2, %xmm1
	ret

instead of icky integer operations:

_bar:                                   ## @bar
	movq	_g@GOTPCREL(%rip), %rax
	movss	LCPI1_0(%rip), %xmm1
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	movd	%xmm0, %ecx
	movl	4(%rax), %edx
	movl	12(%rax), %esi
	shlq	$32, %rdx
	addq	%rcx, %rdx
	movd	%rdx, %xmm0
	addss	8(%rax), %xmm1
	movd	%xmm1, %eax
	shlq	$32, %rsi
	addq	%rax, %rsi
	movd	%rsi, %xmm1
	ret

This resolves rdar://8360454



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112343 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>Enhance the shift propagator to handle the case when you have:</title>
<updated>2010-08-27T22:53:44Z</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2010-08-27T22:53:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=4ece577019705e0a4d7f80f8e8fc1f3cfde276ee'/>
<id>urn:sha1:4ece577019705e0a4d7f80f8e8fc1f3cfde276ee</id>
<content type='text'>
A = shl x, 42
...
B = lshr ..., 38

which can be transformed into:
A = shl x, 4
...

iff we can prove that the would-be-shifted-in bits
are already zero.  This eliminates two shifts in the testcase
and allows eliminate of the whole i128 chain in the real example.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112314 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>Implement a pretty general logical shift propagation</title>
<updated>2010-08-27T22:24:38Z</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2010-08-27T22:24:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=29cc0b3660dc75df06679c4c49cf91ffe24615ff'/>
<id>urn:sha1:29cc0b3660dc75df06679c4c49cf91ffe24615ff</id>
<content type='text'>
framework, which is good at ripping through bitfield
operations.  This generalize a bunch of the existing
xforms that instcombine does, such as 
  (x &lt;&lt; c) &gt;&gt; c -&gt; and
to handle intermediate logical nodes.  This is useful for
ripping up the "promote to large integer" code produced by
SRoA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112304 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>remove some special shift cases that have been subsumed into the</title>
<updated>2010-08-27T21:04:34Z</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2010-08-27T21:04:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=2d0822a937a3b4d1c5096471a2af02ead2090b6e'/>
<id>urn:sha1:2d0822a937a3b4d1c5096471a2af02ead2090b6e</id>
<content type='text'>
more general simplify demanded bits logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112291 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>teach the truncation optimization that an entire chain of</title>
<updated>2010-08-27T20:32:06Z</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2010-08-27T20:32:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=f9d05ab007d4764a78e820aecfcf8de179d178a7'/>
<id>urn:sha1:f9d05ab007d4764a78e820aecfcf8de179d178a7</id>
<content type='text'>
computation can be truncated if it is fed by a sext/zext that doesn't
have to be exactly equal to the truncation result type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112285 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>Add an instcombine to clean up a common pattern produced</title>
<updated>2010-08-27T18:31:05Z</updated>
<author>
<name>Chris Lattner</name>
<email>sabre@nondot.org</email>
</author>
<published>2010-08-27T18:31:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=784f333aef929fbc5867ce17a165837401378c17'/>
<id>urn:sha1:784f333aef929fbc5867ce17a165837401378c17</id>
<content type='text'>
by the SRoA "promote to large integer" code, eliminating
some type conversions like this:

   %94 = zext i16 %93 to i32                       ; &lt;i32&gt; [#uses=2]
   %96 = lshr i32 %94, 8                           ; &lt;i32&gt; [#uses=1]
   %101 = trunc i32 %96 to i8                      ; &lt;i8&gt; [#uses=1]

This also unblocks other xforms from happening, now clang is able to compile:

struct S { float A, B, C, D; };
float foo(struct S A) { return A.A + A.B+A.C+A.D; }

into:

_foo:                                   ## @foo
## BB#0:                                ## %entry
	pshufd	$1, %xmm0, %xmm2
	addss	%xmm0, %xmm2
	movdqa	%xmm1, %xmm3
	addss	%xmm2, %xmm3
	pshufd	$1, %xmm1, %xmm0
	addss	%xmm3, %xmm0
	ret

on x86-64, instead of:

_foo:                                   ## @foo
## BB#0:                                ## %entry
	movd	%xmm0, %rax
	shrq	$32, %rax
	movd	%eax, %xmm2
	addss	%xmm0, %xmm2
	movapd	%xmm1, %xmm3
	addss	%xmm2, %xmm3
	movd	%xmm1, %rax
	shrq	$32, %rax
	movd	%eax, %xmm0
	addss	%xmm3, %xmm0
	ret

This seems pretty close to optimal to me, at least without
using horizontal adds.  This also triggers in lots of other
code, including SPEC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112278 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
</feed>
