- Feb 05, 2012
-
-
Duncan Sands authored
compiling sqlite3, by only doing dom queries after the cheap check rather than interleaved with it. llvm-svn: 149836
-
- Feb 01, 2012
-
-
Stepan Dyatkovskiy authored
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. llvm-svn: 149481
-
- Jan 31, 2012
-
-
Bill Wendling authored
vector. This potentially saves a resizing. llvm-svn: 149369
-
Bill Wendling authored
llvm-svn: 149368
-
- Jan 30, 2012
-
-
Chad Rosier authored
llvm-svn: 149289
-
Chad Rosier authored
llvm-svn: 149275
-
- Dec 01, 2011
-
-
Chad Rosier authored
InstructionSimplify.cpp. Other fixups as needed. Part of rdar://10500969 llvm-svn: 145559
-
- Oct 15, 2011
-
-
Duncan Sands authored
use can't be dominated, saving one domtree lookup. llvm-svn: 142066
-
- Oct 14, 2011
-
-
Eli Friedman authored
Enhance the memdep interface so that users can tell the difference between a dependency which cannot be calculated and a path reaching the entry point of the function. This patch introduces isNonFuncLocal, which replaces isUnknown in some cases. Patch by Xiaoyi Guo. llvm-svn: 141896
-
- Oct 07, 2011
-
-
Duncan Sands authored
switch (n) { case 27: do_something(x); ... } the call do_something(x) will be replaced with do_something(27). In gcc-as-one-big-file this results in the removal of about 500 lines of bitcode (about 0.02%), so has about 1/10 of the effect of propagating branch conditions. llvm-svn: 141360
-
- Oct 05, 2011
-
-
Duncan Sands authored
branch "br i1 %x, label %if_true, label %if_false" then it replaces "%x" with "true" in places only reachable via the %if_true arm, and with "false" in places only reachable via the %if_false arm. Except that actually it doesn't: if value numbering shows that %y is equal to %x then, yes, %y will be turned into true/false in this way, but any occurrences of %x itself are not transformed. Fix this. What's more, it's often the case that %x is an equality comparison such as "%x = icmp eq %A, 0", in which case every occurrence of %A that is only reachable via the %if_true arm can be replaced with 0. Implement this and a few other variations on this theme. This reduces the number of lines of LLVM IR in "GCC as one big file" by 0.2%. It has a bigger impact on Ada code, typically reducing the number of lines of bitcode by around 0.4% by removing repeated compiler generated checks. Passes the LLVM nightly testsuite and the Ada ACATS testsuite. llvm-svn: 141177
-
Duncan Sands authored
it's OK for the false/true destination to have multiple predecessors as long as the extra ones are dominated by the branch destination. llvm-svn: 141176
-
- Sep 27, 2011
-
-
Benjamin Kramer authored
Stop emitting instructions with the name "tmp" they eat up memory and have to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. llvm-svn: 140634
-
- Sep 02, 2011
-
-
Jakub Staszak authored
will be valid. This fixes PR10820. llvm-svn: 139005
-
- Aug 18, 2011
-
-
Eli Friedman authored
llvm-svn: 137888
-
- Aug 17, 2011
-
-
Bill Wendling authored
PRE needs the landing pads to have their critical edges split. Doing this for a landing pad is non-trivial. Abandon the attempt to perform PRE when we come across a landing pad. (Reviewed by Owen!) llvm-svn: 137876
-
- Jul 21, 2011
-
-
Jay Foad authored
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
-
- Jul 18, 2011
-
-
Chris Lattner authored
llvm-svn: 135375
-
- Jul 09, 2011
-
-
Lang Hames authored
Added recognition for signed add/sub/mul with overflow intrinsics to GVN as per Chris and Frits suggestion. llvm-svn: 134777
-
- Jul 08, 2011
-
-
Lang Hames authored
Make GVN look through extractvalues for recognised intrinsics. GVN can then CSE ops that match values produced by the intrinsics. llvm-svn: 134677
-
- Jun 20, 2011
-
-
Jay Foad authored
Change various bits of code to make better use of the existing PHINode API, to insulate them from forthcoming changes in how PHINodes store their operands. llvm-svn: 133434
-
- Jun 15, 2011
-
-
Eli Friedman authored
Add "unknown" results for memdep, which mean "I don't know whether a dependence for the given instruction exists in the given block". This cleans up all the existing hacks in memdep which represent this concept by returning clobber with various unrelated instructions. llvm-svn: 133031
-
- May 22, 2011
-
-
Chris Lattner authored
causing it to get into infinite loops when it would widen a load (which can necessarily leave around dead loads). llvm-svn: 131847
-
- May 17, 2011
-
-
Devang Patel authored
llvm-svn: 131482
-
Devang Patel authored
llvm-svn: 131481
-
- May 05, 2011
-
-
Devang Patel authored
llvm-svn: 130895
-
- Apr 28, 2011
-
-
Chris Lattner authored
llvm-svn: 130426
-
Chris Lattner authored
a nice and tidy: %x1 = load i32* %0, align 4 %1 = icmp eq i32 %x1, 1179403647 br i1 %1, label %if.then, label %if.end instead of doing lots of loads and branches. May the FreeBSD bootloader long fit in its allocated space. llvm-svn: 130416
-
Chris Lattner authored
llvm-svn: 130414
-
Chris Lattner authored
static functions instead of passing around tons of random ivars. llvm-svn: 130403
-
Chris Lattner authored
llvm-svn: 130401
-
Chris Lattner authored
wider load would allow elimination of subsequent loads, and when the wider load is still a native integer type. This eliminates a ton of loads on various benchmarks involving struct fields, though it is somewhat hobbled by clang not being very aggressive about field alignment. This is yet another step along the way towards resolving PR6627. llvm-svn: 130390
-
- Apr 26, 2011
-
-
Chris Lattner authored
translation fails. We were bailing out in some cases that would cause us to miss GVN'ing some non-local cases away. llvm-svn: 130206
-
Chris Lattner authored
return it as a clobber. This allows GVN to do smart things. Enhance GVN to be smart about the case when a small load is clobbered by a larger overlapping load. In this case, forward the value. This allows us to compile stuff like this: int test(void *P) { int tmp = *(unsigned int*)P; return tmp+*((unsigned char*)P+1); } into: _test: ## @test movl (%rdi), %ecx movzbl %ch, %eax addl %ecx, %eax ret which has one load. We already handled the case where the smaller load was from a must-aliased base pointer. llvm-svn: 130180
-
- Mar 30, 2011
- Jan 24, 2011
-
-
Dan Gohman authored
with BasicAA's DecomposeGEPExpression, which recently began using a TargetData. This fixes PR8968, though the testcase is awkward to reduce. Also, update several off GetUnderlyingObject's users which happen to have a TargetData handy to pass it in. llvm-svn: 124134
-
- Jan 11, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 123288
-
Cameron Zwarich authored
once at the beginning of GVN instead of once per iteration. llvm-svn: 123278
-
Cameron Zwarich authored
llvm-svn: 123270
-