- Aug 28, 2010
-
-
Benjamin Kramer authored
llvm-svn: 112332
-
Owen Anderson authored
Add a prototype of a new peephole optimizing pass that uses LazyValue info to simplify PHIs and select's. This pass addresses the missed optimizations from PR2581 and PR4420. llvm-svn: 112325
-
Chris Lattner authored
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. llvm-svn: 112314
-
Chris Lattner authored
framework, which is good at ripping through bitfield operations. This generalize a bunch of the existing xforms that instcombine does, such as (x << c) >> c -> and to handle intermediate logical nodes. This is useful for ripping up the "promote to large integer" code produced by SRoA. llvm-svn: 112304
-
- Aug 27, 2010
-
-
Chris Lattner authored
more general simplify demanded bits logic. llvm-svn: 112291
-
Owen Anderson authored
llvm-svn: 112286
-
Chris Lattner authored
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. llvm-svn: 112285
-
Chris Lattner authored
by the SRoA "promote to large integer" code, eliminating some type conversions like this: %94 = zext i16 %93 to i32 ; <i32> [#uses=2] %96 = lshr i32 %94, 8 ; <i32> [#uses=1] %101 = trunc i32 %96 to i8 ; <i8> [#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. llvm-svn: 112278
-
Owen Anderson authored
Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change. This fixes PR5652. llvm-svn: 112270
-
Chris Lattner authored
by SRoA. This is part of rdar://7892780, but needs another xform to expose this. llvm-svn: 112232
-
- Aug 26, 2010
-
-
Chris Lattner authored
is a vector to be a vector element extraction. This allows clang 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 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 instead of: _foo: ## @foo ## BB#0: ## %entry movd %xmm0, %rax movd %eax, %xmm0 shrq $32, %rax movd %eax, %xmm2 addss %xmm0, %xmm2 movd %xmm1, %rax movd %eax, %xmm1 addss %xmm2, %xmm1 shrq $32, %rax movd %eax, %xmm0 addss %xmm1, %xmm0 ret ... eliminating half of the horribleness. llvm-svn: 112227
-
Owen Anderson authored
llvm-svn: 112198
-
Dan Gohman authored
fix: add a flag to MapValue and friends which indicates whether any module-level mappings are being made. In the common case of inlining, no module-level mappings are needed, so MapValue doesn't need to examine non-function-local metadata, which can be very expensive in the case of a large module with really deep metadata (e.g. a large C++ program compiled with -g). This flag is a little awkward; perhaps eventually it can be moved into the ClonedCodeInfo class. llvm-svn: 112190
-
Daniel Dunbar authored
except ...", it is causing *massive* performance regressions when building Clang with itself (-O3 -g). llvm-svn: 112158
-
Daniel Dunbar authored
individual ...", which depends on r111922, which I am reverting. llvm-svn: 112157
-
Chris Lattner authored
llvm-svn: 112130
-
Dan Gohman authored
and was over-complicated, and replacing it with a simple implementation. llvm-svn: 112120
-
Chris Lattner authored
llvm-svn: 112104
-
- Aug 25, 2010
-
-
Dan Gohman authored
instructions, not when remapping modules. llvm-svn: 112091
-
Devang Patel authored
DIGlobalVariable can be used to encode debug info for globals that are directly folded into a constant by FE. llvm-svn: 112072
-
- Aug 24, 2010
-
-
Dan Gohman authored
which does the same thing. This eliminates redundant code and handles MDNodes better. MDNode linking still doesn't fully work yet though. llvm-svn: 111941
-
Owen Anderson authored
llvm-svn: 111923
-
Dan Gohman authored
that it avoids a lot of unnecessary cloning by avoiding remapping MDNode cycles when none of the nodes in the cycle actually need to be remapped. Also it uses the new temporary MDNode mechanism. llvm-svn: 111922
-
- Aug 23, 2010
-
-
Owen Anderson authored
llvm-svn: 111834
-
Owen Anderson authored
llvm-svn: 111816
-
Owen Anderson authored
Now that PassInfo and Pass::ID have been separated, move the rest of the passes over to the new registration API. llvm-svn: 111815
-
- Aug 20, 2010
-
-
Owen Anderson authored
llvm-svn: 111665
-
Owen Anderson authored
llvm-svn: 111571
-
Owen Anderson authored
When a set of bitmask operations, typically from a bitfield initialization, only modifies the low bytes of a value, we can narrow the store to only over-write the affected bytes. llvm-svn: 111568
-
- Aug 19, 2010
-
-
Owen Anderson authored
llvm-svn: 111551
-
Owen Anderson authored
llvm-svn: 111543
-
Dan Gohman authored
of the two. llvm-svn: 111495
-
- Aug 18, 2010
-
-
Owen Anderson authored
llvm-svn: 111382
-
Chris Lattner authored
from the LHS should disable reconsidering that pred on the RHS. However, knowing something about the pred on the RHS shouldn't disable subsequent additions on the RHS from happening. llvm-svn: 111349
-
Chris Lattner authored
llvm-svn: 111348
-
Chris Lattner authored
llvm-svn: 111344
-
Chris Lattner authored
llvm-svn: 111342
-
Eric Christopher authored
vector heavy code. I'll re-enable when we've tracked down the problem. llvm-svn: 111318
-
- Aug 17, 2010
-
-
Dan Gohman authored
loop, making the resulting loop significantly less ugly. Also, zap its trivial PHI nodes, since it's easy. llvm-svn: 111255
-
Dan Gohman authored
what it does manually. llvm-svn: 111248
-