summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
| * Merging r168361, r168346 and r168227 into 3.2 branch releasePawel Wodnicki2012-11-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merging r168361: Fix PR14132 and handle OOB loads speculated throuh PHI nodes. The issue is that we may end up with newly OOB loads when speculating a load into the predecessors of a PHI node, and this confuses the new integer splitting logic in some cases, triggering an assertion failure. In fact, the branch in question must be dead code as it loads from a too-narrow alloca. Add code to handle this gracefully and leave the requisite FIXMEs for both optimizing more aggressively and doing more to aid sanitizing invalid code which triggers these patterns. Merging r168346: ------------------------------------------------------------------------ Rework the rewriting of loads and stores for vector and integer allocas to properly handle the combinations of these with split integer loads and stores. This essentially replaces Evan's r168227 by refactoring the code in a different way, and trynig to mirror that refactoring in both the load and store sides of the rewriting. Generally speaking there was some really problematic duplicated code here that led to poorly founded assumptions and then subtle bugs. Now much of the code actually flows through and follows a more consistent style and logical path. There is still a tiny bit of duplication on the store side of things, but it is much less bad. This also changes the logic to never re-use a load or store instruction as that was simply too error prone in practice. I've added a few tests (one a reduction of the one in Evan's original patch, which happened to be the same as the report in PR14349). I'm going to look at adding a few more tests for things I found and fixed in passing (such as the volatile tests in the vectorizable predicate). This patch has survived bootstrap, and modulo one bugfix survived Duncan's test suite, but let me know if anything else explodes. Merging r168227: Teach SROA rewriteVectorizedStoreInst to handle cases when the loaded value is narrower than the stored value. rdar://12713675 git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168443 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merging r168197: into 3.2 release branchPawel Wodnicki2012-11-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Preserve address space of forward-referenced global variables in the LL parser Before, the parser would assert on the following code: @a2 = global i8 addrspace(1)* @a @a = addrspace(1) global i8 0 because the type of @a was "i8*" instead of "i8 addrspace(1)*" when parsing the initializer for @a2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168435 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merging r168319 into 3.2 release branchPawel Wodnicki2012-11-21
| | | | | | | | | | | | Fix a pasto. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168432 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merge in r168364 to disable MCJIT execution engine tests on ppc32 (which ↵Andrew Kaylor2012-11-20
| | | | | | | | | | | | doesn't currently support MCJIT). git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168392 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge branch 'release-3.2' into embtk-support-release-3.2Abdoulaye Walsimou Gaye2012-11-20
|\|
| * Merging r168001 into 3.2 release branchPawel Wodnicki2012-11-20
| | | | | | | | | | | | | | NVPTXISelLowering.cpp: Fix warnings. [-Wunused-variable] git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168378 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merge in PPC release notes: r168189 and r168352.Hal Finkel2012-11-20
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168353 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merge in PPC internal-as fixes: r167861, r167862, r167863, r167875, r167860, ↵Hal Finkel2012-11-20
| | | | | | | | | | | | r167864 git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168351 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merge in r167737: Make PPC TOC contents deterministic.Hal Finkel2012-11-20
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168350 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merge in r168316 so that the proper JIT tests are run on PPC.Hal Finkel2012-11-20
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168349 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merging r167718 into 3.2 release branchPawel Wodnicki2012-11-19
| | | | | | | | | | | | | | | | | | | | | | Fix PR14314 - Fix operand order for atomic sub, where the minuend is the value loaded from memory and the subtrahend is the parameter specified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168336 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merging r167948, r168198: into the 3.2 release branchPawel Wodnicki2012-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r168198 [NVPTX] Order global variables in def-use order before emiting them in the final assembly r167948 [NVPTX] Implement custom lowering of loads/stores for i1 Loads from i1 become loads from i8 followed by trunc Stores to i1 become zext to i8 followed by store to i8 git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168335 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merging r167855 into 3.2 relase branchPawel Wodnicki2012-11-19
| | | | | | | | | | | | | | | | | | | | | | | | Do not consider a machine instruction that uses and defines the same physical register as candidate for common subexpression elimination in MachineCSE. This fixes a bug on PowerPC in MultiSource/Applications/oggenc/oggenc caused by MachineCSE invalidly merging two separate DYNALLOC insns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168334 91177308-0d34-0410-b5e6-96231b3b80d8
| * Merging r167719 into the 3.2 relase branchPawel Wodnicki2012-11-19
| | | | | | | | | | | | Remove unused field. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168333 91177308-0d34-0410-b5e6-96231b3b80d8
* | ARM: support more possible GNU triplesAbdoulaye Walsimou Gaye2012-11-17
|/ | | | Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
* Merge r168176 from trunk:Hans Wennborg2012-11-16
| | | | | | | | | SimplifyCFG: Don't assume non-null ScalarTargetTransformInfo. Patch by Pekka Jääskeläinen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168194 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r168147 from trunk:Hans Wennborg2012-11-16
| | | | | | | | | | | | | | Constant::IsThreadDependent(): Use dyn_cast<Constant> instead of cast It turns out that the operands of a Constant are not always themselves Constant. For example, one of the operands of BlockAddress is BasicBlock, which is not a Constant. This should fix the dragonegg-x86_64-linux-gcc-4.6-test build which broke in r168037. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168193 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r168037 from trunk:Hans Wennborg2012-11-16
| | | | | | | | | | | | | | | | | Make GlobalOpt be conservative with TLS variables (PR14309) For global variables that get the same value stored into them everywhere, GlobalOpt will replace them with a constant. The problem is that a thread-local GlobalVariable looks like one value (the address of the TLS var), but is different between threads. This patch introduces Constant::isThreadDependent() which returns true for thread-local variables and constants which depend on them (e.g. a GEP into a thread-local array), and teaches GlobalOpt not to track such values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168192 91177308-0d34-0410-b5e6-96231b3b80d8
* Bugzilla bug 14357Guy Benyei2012-11-15
| | | | | | | | Merge SPIR64 target from trunk - the 64bit counterpart of SPIR. The new OpenCL SPIR extension spec will define separate SPIR for 32 and 64 bit architectures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168092 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r167942, r167966 to fix non-deterministic behavior in BBVectorizeHal Finkel2012-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168012 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge BBVectorizer changes r167731, r167743, r167750, r167784, r167811, r167817.Hal Finkel2012-11-14
| | | | | | | | | These changes fix a serious interaction problem with the cost model on x86 that could cause the vectorizer to enter an infinite loop (and sometimes crash in other ways). git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@167993 91177308-0d34-0410-b5e6-96231b3b80d8
* 3.2 release branch r167702Pawel Wodnicki2012-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@167702 91177308-0d34-0410-b5e6-96231b3b80d8
* [NVPTX] Add more precise PTX/SM target attributesJustin Holewinski2012-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each SM and PTX version is modeled as a subtarget feature/CPU. Additionally, PTX 3.1 is added as the default PTX version to be out-of-the-box compatible with CUDA 5.0. Available CPUs for this target: sm_10 - Select the sm_10 processor. sm_11 - Select the sm_11 processor. sm_12 - Select the sm_12 processor. sm_13 - Select the sm_13 processor. sm_20 - Select the sm_20 processor. sm_21 - Select the sm_21 processor. sm_30 - Select the sm_30 processor. sm_35 - Select the sm_35 processor. Available features for this target: ptx30 - Use PTX version 3.0. ptx31 - Use PTX version 3.1. sm_10 - Target SM 1.0. sm_11 - Target SM 1.1. sm_12 - Target SM 1.2. sm_13 - Target SM 1.3. sm_20 - Target SM 2.0. sm_21 - Target SM 2.1. sm_30 - Target SM 3.0. sm_35 - Target SM 3.5. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167699 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete a stale comment. No functional change.Meador Inge2012-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167698 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some helper methods to being static functions in the implementation file.Craig Topper2012-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167696 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove hard-coded constant in Transforms/InstCombine/memcmp-1.llMeador Inge2012-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | Transforms/InstCombine/memcmp-1.ll has a test case that looks like: @foo = constant [4 x i8] c"foo\00" @hel = constant [4 x i8] c"hel\00" ... %mem1 = getelementptr [4 x i8]* @hel, i32 0, i32 0 %mem2 = getelementptr [4 x i8]* @foo, i32 0, i32 0 %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3) ret i32 %ret ; CHECK: ret i32 2 The folded return value (2 above) is computed using the system memcmp that the compiler is linked with. This can return different values on different systems. The test was originally written on an OS X 10.7.5 x86-64 box and passed. However, it failed on one of the x86-64 FreeBSD buildbots because the system memcpy on that machine returned a different value (1 instead of 2). I fixed the test by checking the folding constants with regexes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167691 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine: Migrate memset optimizationsMeador Inge2012-11-11
| | | | | | | This patch migrates the memset optimizations from the simplify-libcalls pass into the instcombine library call simplifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167689 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the vectorizer docs.Nadav Rotem2012-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167688 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine: Migrate memmove optimizationsMeador Inge2012-11-11
| | | | | | | This patch migrates the memmove optimizations from the simplify-libcalls pass into the instcombine library call simplifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167687 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine: Migrate memcpy optimizationsMeador Inge2012-11-11
| | | | | | | This patch migrates the memcpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167686 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the isTruncFree and isZExtFree API to figure out of these operations are ↵Nadav Rotem2012-11-11
| | | | | | free. Thanks Andy! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167685 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment typo and add comments.Nadav Rotem2012-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167684 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine: Migrate memcmp optimizationsMeador Inge2012-11-11
| | | | | | | This patch migrates the memcmp optimizations from the simplify-libcalls pass into the instcombine library call simplifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167683 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine: Migrate strstr optimizationsMeador Inge2012-11-11
| | | | | | | This patch migrates the strstr optimizations from the simplify-libcalls pass into the instcombine library call simplifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167682 91177308-0d34-0410-b5e6-96231b3b80d8
* Add method for replacing instructions to LibCallSimplifierMeador Inge2012-11-11
| | | | | | | | | | | | | | | In some cases the library call simplifier may need to replace instructions other than the library call being simplified. In those cases it may be necessary for clients of the simplifier to override how the replacements are actually done. As such, a new overrideable method for replacing instructions was added to LibCallSimplifier. A new subclass of LibCallSimplifier is also defined which overrides the instruction replacement method. This is because the instruction combiner defines its own replacement method which updates the worklist when instructions are replaced. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167681 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide definitions for all functions.Benjamin Kramer2012-11-10
| | | | | | | ICC refuses to compile a class in an anonymous namespace if some functions aren't defined. Fixes PR13477. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167676 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine: Migrate strcspn optimizationsMeador Inge2012-11-10
| | | | | | | This patch migrates the strcspn optimizations from the simplify-libcalls pass into the instcombine library call simplifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167675 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the SmallVector pretty printer for LLDB a bit and make it work with ↵Benjamin Kramer2012-11-10
| | | | | | reference types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167674 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary subtraction and addition by 1 around a couple for loops.Craig Topper2012-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167673 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove empty directory.Duncan Sands2012-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167672 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up spacing. No functional change.Craig Topper2012-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167671 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed unimplemented method declaration.Craig Topper2012-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167670 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify custom emitter code for pcmp(e/i)str(i/m) and make the helper ↵Craig Topper2012-11-10
| | | | | | functions static. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167669 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert an improper CodeGen test to a MC test.Evan Cheng2012-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167663 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine: Query target library information to gate libcall simplificationsMeador Inge2012-11-10
| | | | | | | | | Several of the simplifiers migrated from the simplify-libcalls pass to the instcombine pass were not correctly checking the target library information to gate the simplifications. This patch ensures that the check is made. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167660 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more functions to the target library information.Meador Inge2012-11-10
| | | | | | | | | | | In the process of migrating optimizations from the simplify-libcalls pass to the instcombine pass I noticed that a few functions are missing from the target library information. These functions need to be available for querying in the instcombine library call simplifiers. More functions will probably be added in the future as more simplifiers are migrated to instcombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167659 91177308-0d34-0410-b5e6-96231b3b80d8
* xfail a bad test. This is a MC test but it's dependent on a codegen ↵Evan Cheng2012-11-10
| | | | | | optimization which is now disabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167658 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable the Thumb no-return call optimization:Evan Cheng2012-11-10
| | | | | | | | | | | | | mov lr, pc b.w _foo The "mov" instruction doesn't set bit zero to one, it's putting incorrect value in lr. It messes up backtraces. rdar://12663632 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167657 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup pcmp(e/i)str(m/i) instruction definitions and load folding support.Craig Topper2012-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167652 91177308-0d34-0410-b5e6-96231b3b80d8
* [NVPTX] Use ABI alignment for parameters when alignment is not specified.Justin Holewinski2012-11-09
| | | | | | Affects SM 2.0+. Fixes bug 13324. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167646 91177308-0d34-0410-b5e6-96231b3b80d8