- Nov 01, 2012
-
-
Chandler Carruth authored
r165941: Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis. Despite this commit log, this change primarily changed stuff outside of VMCore, and those changes do not carry any tests for correctness (or even plausibility), and we have consistently found questionable or flat out incorrect cases in these changes. Most of them are probably correct, but we need to devise a system that makes it more clear when we have handled the address space concerns correctly, and ideally each pass that gets updated would receive an accompanying test case that exercises that pass specificaly w.r.t. alternate address spaces. However, from this commit, I have retained the new C API entry points. Those were an orthogonal change that probably should have been split apart, but they seem entirely good. In several places the changes were very obvious cleanups with no actual multiple address space code added; these I have not reverted when I spotted them. In a few other places there were merge conflicts due to a cleaner solution being implemented later, often not using address spaces at all. In those cases, I've preserved the new code which isn't address space dependent. This is part of my ongoing effort to clean out the partial address space code which carries high risk and low test coverage, and not likely to be finished before the 3.2 release looms closer. Duncan and I would both like to see the above issues addressed before we return to these changes. llvm-svn: 167222
-
Chandler Carruth authored
getIntPtrType support for multiple address spaces via a pointer type, and also introduced a crasher bug in the constant folder reported in PR14233. These commits also contained several problems that should really be addressed before they are re-committed. I have avoided reverting various cleanups to the DataLayout APIs that are reasonable to have moving forward in order to reduce the amount of churn, and minimize the number of commits that were reverted. I've also manually updated merge conflicts and manually arranged for the getIntPtrType function to stay in DataLayout and to be defined in a plausible way after this revert. Thanks to Duncan for working through this exact strategy with me, and Nick Lewycky for tracking down the really annoying crasher this triggered. (Test case to follow in its own commit.) After discussing with Duncan extensively, and based on a note from Micah, I'm going to continue to back out some more of the more problematic patches in this series in order to ensure we go into the LLVM 3.2 branch with a reasonable story here. I'll send a note to llvmdev explaining what's going on and why. Summary of reverted revisions: r166634: Fix a compiler warning with an unused variable. r166607: Add some cleanup to the DataLayout changes requested by Chandler. r166596: Revert "Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this! r166591: Delete a directory that wasn't supposed to be checked in yet. r166578: Add in support for getIntPtrType to get the pointer type based on the address space. llvm-svn: 167221
-
Hal Finkel authored
When target costs are available, use them to account for the costs of shuffles on internal edges of the DAG of candidate pairs. Because the shuffle costs here are currently for only the internal edges, the current target cost model is trivial, and the chain depth requirement is still in place, I don't yet have an easy test case. Nevertheless, by looking at the debug output, it does seem to do the right think to the effective "size" of each DAG of candidate pairs. llvm-svn: 167217
-
Jakub Staszak authored
llvm-svn: 167196
-
- Oct 31, 2012
-
-
Nadav Rotem authored
llvm-svn: 167174
-
Benjamin Kramer authored
- Use value handle tricks to communicate use replacements instead of forgetLoop, this is a lot faster. - Move the "big hammer" out of the main loop so it's not called for every instruction. This should recover most (if not all) compile time regressions introduced by this code. llvm-svn: 167136
-
Nadav Rotem authored
llvm-svn: 167134
-
Hans Wennborg authored
SimplifyCFG will have removed those cases for us. llvm-svn: 167132
-
Nadav Rotem authored
llvm-svn: 167131
-
Hans Wennborg authored
llvm-svn: 167130
-
Hal Finkel authored
BBVectorize would, except for loads and stores, always fuse instructions so that the first instruction (in the current source order) would always represent the low part of the input vectors and the second instruction would always represent the high part. This lead to too many shuffles being produced because sometimes the opposite order produces fewer of them. With this change, BBVectorize tracks the kind of pair connections that form the DAG of candidate pairs, and uses that information to reorder the pairs to avoid excess shuffles. Using this information, a future commit will be able to add VTTI-based shuffle costs to the pair selection procedure. Importantly, the number of remaining shuffles can now be estimated during pair selection. There are some trivial instruction reorderings in the test cases, and one simple additional test where we certainly want to do a reordering to avoid an unnecessary shuffle. llvm-svn: 167122
-
Hans Wennborg authored
- Use 0 instead of NULL - Helper function for "dyn_cast, else lookup in the constant pool". llvm-svn: 167121
-
Meador Inge authored
This patch migrates the strto* optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167119
-
Hans Wennborg authored
llvm-svn: 167117
-
Benjamin Kramer authored
No functionality change. llvm-svn: 167116
-
Hans Wennborg authored
By propagating the value for the switch condition, LLVM can now build lookup tables for code such as: switch (x) { case 1: return 5; case 2: return 42; case 3: case 4: case 5: return x - 123; default: return 123; } Given that x is known for each case, "x - 123" becomes a constant for cases 3, 4, and 5. llvm-svn: 167115
-
Benjamin Kramer authored
I'm not entirely happy with this solution, but I don't see a smarter way currently. Fixes PR14214. llvm-svn: 167112
-
Meador Inge authored
This patch migrates the strpbrk optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167105
-
Meador Inge authored
This patch migrates the strlen optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167103
-
Meador Inge authored
This patch migrates the strncpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167102
-
Nadav Rotem authored
llvm-svn: 167101
-
Nadav Rotem authored
This is important for loops in the LAPACK test-suite. These loops start at 1 because they are auto-converted from fortran. llvm-svn: 167084
-
Meador Inge authored
This patch migrates the stpcpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. Note that the __stpcpy_chk simplifications were migrated in a previous commit. llvm-svn: 167083
-
Meador Inge authored
r166198 migrated the strcpy optimization to instcombine. The strcpy simplifier that was migrated from Transforms/Scalar/SimplifyLibCalls.cpp was also doing some __strcpy_chk simplifications. Those fortified simplifications were migrated as well, but introduced a bug in the __stpcpy_chk simplifier in the process. This happened because the __strcpy_chk and __stpcpy_chk simplifiers were both mapped to StrCpyChkOpt which was updated with simplifications that worked for __strcpy_chk, but not __stpcpy_chk. This patch fixes the problem by adding proper test coverage and creating a new simplifier for __stpcpy_chk (instead of sharing one with __strcpy_chk). llvm-svn: 167082
-
- Oct 30, 2012
-
-
Nadav Rotem authored
llvm-svn: 167055
-
Chandler Carruth authored
integers in that the code to handle split alloca-wide integer loads or stores doesn't come first. It should, for the same reasons as with integers, and the PR attests to that. Also had to fix a busted assert in that this test case also covers. llvm-svn: 167051
-
Hal Finkel authored
Instead of recomputing relative pointer information just prior to fusing, cache this information (which also needs to be computed during the candidate-pair selection process). This cuts down on the total number of SE queries made, and also is a necessary intermediate step on the road toward including shuffle costs in the pair selection procedure. No functionality change is intended. llvm-svn: 167049
-
Benjamin Kramer authored
Thanks to Preston Briggs for catching this! llvm-svn: 167045
-
Hal Finkel authored
We need to make sure that we take the correct load/store alignment when the inputs are flipped. llvm-svn: 167044
-
Hal Finkel authored
Stop propagating the FlipMemInputs variable into the routines that create the replacement instructions. Instead, just flip the arguments of those routines. This allows for some associated cleanup (not all of which is done here). No functionality change is intended. llvm-svn: 167042
-
Hal Finkel authored
SE was being called during the instruction-fusion process (when the result is unreliable, and thus ignored). No functionality change is intended. llvm-svn: 167037
-
Nadav Rotem authored
llvm-svn: 167036
-
Nadav Rotem authored
Speedup SciMark by 1% llvm-svn: 167035
-
Nadav Rotem authored
LoopVectorize: Fix a bug in the initialization of reduction variables. AND needs to start at all-one while XOR, and OR need to start at zero. llvm-svn: 167032
-
Duncan Sands authored
with different sizes. llvm-svn: 167018
-
Ulrich Weigand authored
This fixes Clang :: CodeGen/complex-builtints.c on PowerPC. llvm-svn: 167013
-
Hans Wennborg authored
When the switch-to-lookup tables transform landed in SimplifyCFG, it was pointed out that this could be inappropriate for some targets. Since there was no way at the time for the pass to know anything about the target, an awkward reverse-transform was added in CodeGenPrepare that turned lookup tables back into switches for some targets. This patch uses the new TargetTransformInfo to determine if a switch should be transformed, and removes CodeGenPrepare::ConvertLoadToSwitch. llvm-svn: 167011
-
Nadav Rotem authored
LoopVectorizer: change debug prints: Print the module identifier when deciding to vectorize. When deciding not to vectorize do not print the called function name because it can be null. llvm-svn: 166989
-
- Oct 29, 2012
-
-
Nadav Rotem authored
llvm-svn: 166970
-
Ulrich Weigand authored
checks to avoid performing compile-time arithmetic on PPCDoubleDouble. Now that APFloat supports arithmetic on PPCDoubleDouble, those checks are no longer needed, and we can treat the type like any other. llvm-svn: 166958
-