summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
...
* Fix addrspacecast with metadata globalsMatt Arsenault2014-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198345 91177308-0d34-0410-b5e6-96231b3b80d8
* indvars: insert truncate at loop boundary to avoid redundant IVs.Andrew Trick2014-01-02
| | | | | | | | | When widening an IV to remove s/zext, we generally try to eliminate the original narrow IV. However, LCSSA phi nodes outside the loop were still using the original IV. Clean this up more aggressively to avoid redundancy in generated code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198338 91177308-0d34-0410-b5e6-96231b3b80d8
* Set LLVM_EXPORTED_SYMBOL_FILE in CMakeLists whose corresponding Makefiles do so.Nico Weber2013-12-29
| | | | | | | | | (unittests/ExecutionEngine/JIT/CMakeLists.txt is still missing for now, since it handles export files in a strange way: It generates a .exports file from a .def file instead of the other way round.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198183 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix the test for __asan_gen_ globals and actually fix ↵Alexander Potapenko2013-12-25
| | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=17976 by setting the correct linkage (as stated in the bug). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198018 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Make sure none of the __asan_gen_ global strings end up in the symbol ↵Alexander Potapenko2013-12-25
| | | | | | | | | | | table, add a test. This should fix http://llvm.org/bugs/show_bug.cgi?id=17976 Another test checking for the global variables' locations and prefixes on Darwin will be committed separately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198017 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to indvars for optimizing sadd.with.overflow.Andrew Trick2013-12-23
| | | | | | | | | | | | | | | | Split sadd.with.overflow into add + sadd.with.overflow to allow analysis and optimization. This should ideally be done after InstCombine, which can perform code motion (eventually indvars should run after all canonical instcombines). We want ISEL to recombine the add and the check, at least on x86. This is currently under an option for reducing live induction variables: -liv-reduce. The next step is reducing liveness of IVs that are live out of the overflow check paths. Once the related optimizations are fully developed, reviewed and tested, I do expect this to become default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197926 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Scalarizer insertion point when replacing PHIs with insertelementsRichard Sandiford2013-12-23
| | | | | | | | | | | If the Scalarizer scalarized a vector PHI but could not scalarize all uses of it, it would insert a series of insertelements to reconstruct the vector PHI value from the scalar ones. The problem was that it would emit these insertelements immediately after the PHI, even if there were other PHIs after it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197909 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Scalarizer handling of vector GEPs with multiple index operandsRichard Sandiford2013-12-23
| | | | | | | The old code only worked for one index operand. Also handle "inbounds". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197908 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] don't unpoison redzones on function exit in use-after-return mode.Kostya Serebryany2013-12-23
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change the instrumented code before Ret instructions looked like: <Unpoison Frame Redzones> if (Frame != OriginalFrame) // I.e. Frame is fake <Poison Complete Frame> Now the instrumented code looks like: if (Frame != OriginalFrame) // I.e. Frame is fake <Poison Complete Frame> else <Unpoison Frame Redzones> Reviewers: eugenis Reviewed By: eugenis CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2458 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197907 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] produce fewer stores when poisoning stack shadowKostya Serebryany2013-12-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197904 91177308-0d34-0410-b5e6-96231b3b80d8
* Transforms: Don't create bad weights when eliminating dead casesJustin Bogner2013-12-20
| | | | | | | | | If we happen to eliminate every case in a switch that has branch weights, we currently try to create metadata for the one remaining branch, triggering an assert. Instead, we need to check that the metadata we're trying to create is sensible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197791 91177308-0d34-0410-b5e6-96231b3b80d8
* Stay classy (and legal) LLVM. Remove links to 3rd party SMT solver whose ↵Kay Tiong Khoo2013-12-19
| | | | | | links may not be permanent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197713 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved fix for PR17827 (instcombine of shift/and/compare).Kay Tiong Khoo2013-12-19
| | | | | | | | | This change fixes the case of arithmetic shift right - do not attempt to fold that case. This change also relaxes the conditions when attempting to fold the logical shift right and shift left cases. No additional IR-level test cases included at this time. See http://llvm.org/bugs/show_bug.cgi?id=17827 for proofs that these are correct transformations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197705 91177308-0d34-0410-b5e6-96231b3b80d8
* [dfsan] Simplify code after r197677.Evgeniy Stepanov2013-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197679 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an explicit insert point argument to SplitBlockAndInsertIfThen.Evgeniy Stepanov2013-12-19
| | | | | | | | | Currently SplitBlockAndInsertIfThen requires that branch condition is an Instruction itself, which is very inconvenient, because it is sometimes an Operator, or even a Constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197677 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopVectorizer: Don't if-convert constant expressions that can trapArnold Schwaighofer2013-12-17
| | | | | | | | | | A phi node operand or an instruction operand could be a constant expression that can trap (division). Check that we don't vectorize such cases. PR16729 radar://15653590 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197449 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable double to float shrinking optimizations for binary functions like ↵Yi Jiang2013-12-16
| | | | | | 'fmin/fmax'. Fix radar:15283121 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197434 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a use-after-free error in GlobalOpt CleanupConstantGlobalUsersHal Finkel2013-12-12
| | | | | | | | | | | | GlobalOpt's CleanupConstantGlobalUsers function uses a worklist array to manage constant users to be visited. The pointers in this array need to be weak handles because when we delete a constant array, we may also be holding a pointer to one of its elements (or an element of one of its elements if we're dealing with an array of arrays) in the worklist. Fixes PR17347. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197178 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize the barrier pass llvm::initializeIPOHal Finkel2013-12-12
| | | | | | | | | The barrier pass is a temporary hack, and should go away soon. Nevertheless, if we don't initialize it, then opt will not understand -barrier, and this will break bugpoint (because when it dumps the passes from the default pass manager -barrier will be there). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197177 91177308-0d34-0410-b5e6-96231b3b80d8
* Resubmit r196544: Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, ↵Yi Jiang2013-12-12
| | | | | | x) ―> __exp10(x) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197109 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune redundant dependencies in LLVMBuild.txt.NAKAMURA Takumi2013-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196988 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Fix the coverage.cc test broken by r196939Reid Kleckner2013-12-10
| | | | | | | | | | | | | | | | It was failing because ASan was adding all of the following to one function: - dynamic alloca - stack realignment - inline asm This patch avoids making the static alloca dynamic when coverage is used. ASan should probably not be inserting empty inline asm blobs to inhibit duplicate tail elimination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196973 91177308-0d34-0410-b5e6-96231b3b80d8
* Add proper dependencies to LLVMBuild.txt in llvm/lib.NAKAMURA Takumi2013-12-10
| | | | | | I'll prune redundant deps in LLVMBuild.txt, later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196881 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespaces.NAKAMURA Takumi2013-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196880 91177308-0d34-0410-b5e6-96231b3b80d8
* Transforms: Don't create bad branch weights when folding a switchJustin Bogner2013-12-10
| | | | | | | | This avoids creating branch weight metadata of length one when we fold cases into the default of a switch instruction, which was triggering an assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196845 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 196544 due to internal bot failures.Manman Ren2013-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196732 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix inlining to not lose the "cleanup" clause from landingpadsMark Seaborn2013-12-08
| | | | | | | This fixes PR17872. This bug can lead to C++ destructors not being called when they should be, when an exception is thrown. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196711 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix inlining to not produce duplicate landingpad clausesMark Seaborn2013-12-08
| | | | | | | | | | | | | | | | | | | | | | | Before this change, inlining one "invoke" into an outer "invoke" call site can lead to the outer landingpad's catch/filter clauses being copied multiple times into the resulting landingpad. This happens: * when the inlined function contains multiple "resume" instructions, because forwardResume() copies the clauses but is called multiple times; * when the inlined function contains a "resume" and a "call", because HandleCallsInBlockInlinedThroughInvoke() copies the clauses but is redundant with forwardResume(). Fix this by deduplicating the code. This problem doesn't lead to any incorrect execution; it's only untidy. This change will make fixing PR17872 a little easier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196710 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't #include heavy Dominators.h file in LoopInfo.h. This change reducesJakub Staszak2013-12-07
| | | | | | | overall time of LLVM compilation by ~1%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196667 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assert with copy from global through addrspacecastMatt Arsenault2013-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196638 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use isNullValue to evaluate ConstantExprDuncan P. N. Exon Smith2013-12-06
| | | | | | | | ConstantExpr can evaluate to false even when isNullValue gives false. Fixes PR18143. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196611 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix ndebug build with strict warnings (-Wunused-variable)Kostya Serebryany2013-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196574 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] rewrite asan's stack frame layoutKostya Serebryany2013-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Rewrite asan's stack frame layout. First, most of the stack layout logic is moved into a separte file to make it more testable and (potentially) useful for other projects. Second, make the frames more compact by using adaptive redzones (smaller for small objects, larger for large objects). Third, try to minimized gaps due to large alignments (this is hypothetical since today we don't see many stack vars aligned by more than 32). The frames indeed become more compact, but I'll still need to run more benchmarks before committing, but I am sking for review now to get early feedback. This change will be accompanied by a trivial change in compiler-rt tests to match the new frame sizes. Reviewers: samsonov, dvyukov Reviewed By: samsonov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2324 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196568 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x)Yi Jiang2013-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196544 91177308-0d34-0410-b5e6-96231b3b80d8
* Add #pragma vectorize enable/disable to LLVMRenato Golin2013-12-05
| | | | | | | | | | | | | | | | | | | | | | | | The intended behaviour is to force vectorization on the presence of the flag (either turn on or off), and to continue the behaviour as expected in its absence. Tests were added to make sure the all cases are covered in opt. No tests were added in other tools with the assumption that they should use the PassManagerBuilder in the same way. This patch also removes the outdated -late-vectorize flag, which was on by default and not helping much. The pragma metadata is being attached to the same place as other loop metadata, but nothing forbids one from attaching it to a function (to enable #pragma optimize) or basic blocks (to hint the basic-block vectorizers), etc. The logic should be the same all around. Patches to Clang to produce the metadata will be produced after the initial implementation is agreed upon and committed. Patches to other vectorizers (such as SLP and BB) will be added once we're happy with the pass manager changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196537 91177308-0d34-0410-b5e6-96231b3b80d8
* Change std::deque => std::vector. No functionality change.Michael Gottesman2013-12-05
| | | | | | | | There is no reason to use std::deque here over std::vector. Thus given the performance differences inbetween the two it makes sense to change deque to vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196524 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix non-deterministic behavior.Rafael Espindola2013-12-05
| | | | | | | | | | We use CSEBlocks to initialize a worklist: SmallVector<BasicBlock *, 8> CSEWorkList(CSEBlocks.begin(), CSEBlocks.end()); so it must have a deterministic order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196520 91177308-0d34-0410-b5e6-96231b3b80d8
* SLPVectorizer: An in-tree vectorized entry cannot also be a scalar external useArnold Schwaighofer2013-12-05
| | | | | | | | | | | | | | | We were creating external uses for scalar values in MustGather entries that also had a ScalarToTreeEntry (they also are present in a vectorized tuple). This meant we would keep a value 'alive' as a scalar and vectorized causing havoc. This is not necessary because when we create a MustGather vector we explicitly create external uses entries for the insertelement instructions of the MustGather vector elements. Fixes PR18129. radar://15582184 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196508 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] fix PR18146: sometimes a variable written into vptr could have an ↵Kostya Serebryany2013-12-05
| | | | | | integer type (after other optimizations) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196507 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct word hyphenationsAlp Toker2013-12-05
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Replace size() with empty() in bool check.Yuchen Wu2013-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196400 91177308-0d34-0410-b5e6-96231b3b80d8
* Un-revert r196358: "llvm-cov: Added support for function checksums."Daniel Jasper2013-12-04
| | | | | | And add the proper fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196367 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r196358: "llvm-cov: Added support for function checksums."Daniel Jasper2013-12-04
| | | | | | | This currently breaks clang/test/CodeGen/code-coverage.c. The root cause is that the newly introduced access to Funcs[j] is out of bounds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196365 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added support for function checksums.Yuchen Wu2013-12-04
| | | | | | | The function checksums are hashed from the concatenation of the function name and line number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196358 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the internalize pass to skip dllexported symbols because they could beYunzhong Gao2013-12-03
| | | | | | | | | | referenced in a way that even the linker does not see. Differential Revision: http://llvm-reviews.chandlerc.com/D2280 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196300 91177308-0d34-0410-b5e6-96231b3b80d8
* Use local variable for repeated use rather than 'get' method. No functional ↵Kay Tiong Khoo2013-12-02
| | | | | | change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196164 91177308-0d34-0410-b5e6-96231b3b80d8
* Move variables to where they are used and give them better names. No ↵Kay Tiong Khoo2013-12-02
| | | | | | functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196163 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename variables to be consistent (CST -> Cst). No functional change intended.Kay Tiong Khoo2013-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196161 91177308-0d34-0410-b5e6-96231b3b80d8
* InlineFunction.cpp: Remove a return value that is always falseMark Seaborn2013-12-02
| | | | | | | | Remove some associated dead code. This cleanup is associated with PR17872. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196147 91177308-0d34-0410-b5e6-96231b3b80d8
* Conservative fix for PR17827 - don't optimize a shift + and + compare ↵Kay Tiong Khoo2013-12-02
| | | | | | sequence where the shift is logical unless the comparison is unsigned git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196129 91177308-0d34-0410-b5e6-96231b3b80d8