- Feb 09, 2010
-
-
Eric Christopher authored
enable constant 0 offset lowering. llvm-svn: 95691
-
Eric Christopher authored
consuming for a simple optimization. llvm-svn: 95671
-
Chris Lattner authored
llvm-svn: 95643
-
Chris Lattner authored
xform. llvm-svn: 95642
-
Eric Christopher authored
llvm-svn: 95641
-
Eric Christopher authored
Initial skeleton and SCEVUnknown lowering implemented, the rest should come relatively quickly. Move testcase to new directory. Move pass to right before SimplifyLibCalls - which is moved down a bit so we can take advantage of a few opts. llvm-svn: 95628
-
Chris Lattner authored
llvm-svn: 95616
-
- Feb 06, 2010
-
-
Jakob Stoklund Olesen authored
This time it's for real! I am going to hook this up in the frontends as well. The inliner has some experimental heuristics for dealing with the inline hint. When given a -respect-inlinehint option, functions marked with the inline keyword are given a threshold just above the default for -O3. We need some experiments to determine if that is the right thing to do. llvm-svn: 95466
-
Jakob Stoklund Olesen authored
llvm-svn: 95454
-
- Feb 05, 2010
-
-
Jakob Stoklund Olesen authored
Weird code sometimes uses pointer constants other than null. This patch teaches SimplifyCFG to build switch instructions in those cases. Code like this: void f(const char *x) { if (!x) puts("null"); else if ((uintptr_t)x == 1) puts("one"); else if (x == (char*)2 || x == (char*)3) puts("two"); else if ((intptr_t)x == 4) puts("four"); else puts(x); } Now becomes a switch: define void @f(i8* %x) nounwind ssp { entry: %magicptr23 = ptrtoint i8* %x to i64 ; <i64> [#uses=1] switch i64 %magicptr23, label %if.else16 [ i64 0, label %if.then i64 1, label %if.then2 i64 2, label %if.then9 i64 3, label %if.then9 i64 4, label %if.then14 ] Note that LLVM's own DenseMap uses magic pointers. llvm-svn: 95439
-
Chris Lattner authored
xform it is checking to actually pass. There is no need to match m_SelectCst<0, -1> since instcombine canonicalizes that into not(sext). Add matches for sext(not(x)) in addition to not(sext(x)). llvm-svn: 95420
-
Dan Gohman authored
container data. This prevents it from holding onto dangling pointers and potentially behaving unpredictably. llvm-svn: 95409
-
Dan Gohman authored
malloc caller in a profile. llvm-svn: 95407
-
Eric Christopher authored
that in mind. llvm-svn: 95402
-
Bob Wilson authored
short-circuited conditions to AND/OR expressions, and those expressions are often converted back to a short-circuited form in code gen. The original source order may have been optimized to take advantage of the expected values, and if we reassociate them, we change the order and subvert that optimization. Radar 7497329. llvm-svn: 95333
-
- Feb 04, 2010
-
-
Jakob Stoklund Olesen authored
This makes the inliner about as agressive as it was before my changes to the inliner cost calculations. These levels give the same performance and slightly smaller code than before. llvm-svn: 95320
-
Eric Christopher authored
failure. llvm-svn: 95294
-
Eric Christopher authored
Fix bugs where we would compute out of bounds as in bounds, and where we couldn't know that the linker could override the size of an array. Add a few new testcases, change existing testcase to use a private global array instead of extern. llvm-svn: 95283
-
Eric Christopher authored
particular size, we just don't know what the length is yet. llvm-svn: 95266
-
- Feb 03, 2010
-
-
Bob Wilson authored
The SRThreshold value makes perfect sense for checking if an entire aggregate should be promoted to a scalar integer, but it is not so good for splitting an aggregate into its separate elements. A struct may contain a large embedded array along with some scalar fields that would benefit from being split apart by SROA. Even if the total aggregate size is large, it may still be good to perform SROA. Thus, the most important piece of this patch is simply moving the aggregate size comparison vs. SRThreshold so that it guards only the aggregate promotion. We have also been checking the number of elements to decide if an aggregate should be split up. The limit of "SRThreshold/4" seemed rather arbitrary, and I don't think it's very useful to derive this limit from SRThreshold anyway. I've collected some data showing that the current default limit of 32 (since SRThreshold defaults to 128) is a reasonable cutoff for struct types. One thing suggested by the data is that distinguishing between structs and arrays might be useful. There are (obviously) a lot more large arrays than large structs (as measured by the number of elements and not the total size -- a large array inside a struct still counts as a single element given the way we do SROA right now). Out of 8377 arrays where we successfully performed SROA while compiling a large set of benchmarks, only 16 of them had more than 8 elements. And, for those 16 arrays, it's not at all clear that SROA was actually beneficial. So, to offset the compile time cost of investigating more large structs for SROA, the patch lowers the limit on array elements to 8. This fixes Apple Radar 7563690. llvm-svn: 95224
-
Evan Cheng authored
llvm-svn: 95198
-
Bob Wilson authored
llvm-svn: 95170
-
Eric Christopher authored
llvm-svn: 95165
-
Eric Christopher authored
llvm-svn: 95154
-
- Feb 02, 2010
-
-
Eric Christopher authored
llvm-svn: 95147
-
Eric Christopher authored
Passed bootstrap and nightly test run here. llvm-svn: 95145
-
Chris Lattner authored
for vectors. Codegen is generating awful code or segfaulting in various cases (e.g. PR6204). llvm-svn: 95058
-
Chris Lattner authored
llvm-svn: 95055
-
Dan Gohman authored
when the cast is extending. llvm-svn: 95046
-
Eric Christopher authored
don't use TargetData here. llvm-svn: 95040
-
Eric Christopher authored
llvm-svn: 95036
-
Eric Christopher authored
llvm-svn: 95035
-
Eric Christopher authored
llvm-svn: 95027
-
- Feb 01, 2010
-
-
Bob Wilson authored
disabled by default. This divides the existing load PRE code into 2 phases: first it checks that it is safe to move the load to each of the predecessors where it is unavailable, and then if it is safe, the code is changed to move the load. Radar 7571861. llvm-svn: 95007
-
Chris Lattner authored
llvm-svn: 94995
-
rdar://7590304Chris Lattner authored
of objc message send was getting marked arm_apcscc, but the prototype isn't. This is fine at runtime because objcmsgsend is implemented in assembly. Only turn a mismatched caller and callee into 'unreachable' if the callee is a definition. llvm-svn: 94986
-
rdar://7590304Chris Lattner authored
case, instcombine can't zap the invoke for fear of changing the CFG. However, we have to do something to prevent the next iteration of instcombine from inserting another store -> undef before the invoke thereby getting into infinite iteration between dead store elim and store insertion. Just zap the callee to null, which will prevent the next iteration from doing anything. llvm-svn: 94985
-
Bob Wilson authored
The testcase from pr6198 does not crash for me -- I don't know what's up with that -- so I'm not adding it to the tests. llvm-svn: 94984
-
- Jan 31, 2010
-
-
Eli Friedman authored
llvm-svn: 94943
-
Eli Friedman authored
use and X is free to negate. llvm-svn: 94941
-