summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Set LLVM_EXPORTED_SYMBOL_FILE in CMakeLists whose corresponding Makefiles do so.Nico Weber2013-12-291-0/+8
| | | | | | | | (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.) llvm-svn: 198183
* [ASan] Fix the test for __asan_gen_ globals and actually fix ↵Alexander Potapenko2013-12-251-2/+2
| | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=17976 by setting the correct linkage (as stated in the bug). llvm-svn: 198018
* [ASan] Make sure none of the __asan_gen_ global strings end up in the symbol ↵Alexander Potapenko2013-12-251-10/+21
| | | | | | | | | 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. llvm-svn: 198017
* Add support to indvars for optimizing sadd.with.overflow.Andrew Trick2013-12-232-4/+92
| | | | | | | | | | | | | | | | 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. llvm-svn: 197926
* Fix Scalarizer insertion point when replacing PHIs with insertelementsRichard Sandiford2013-12-231-1/+4
| | | | | | | | | | 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. llvm-svn: 197909
* Fix Scalarizer handling of vector GEPs with multiple index operandsRichard Sandiford2013-12-231-11/+32
| | | | | | The old code only worked for one index operand. Also handle "inbounds". llvm-svn: 197908
* [asan] don't unpoison redzones on function exit in use-after-return mode.Kostya Serebryany2013-12-232-15/+57
| | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 197907
* [asan] produce fewer stores when poisoning stack shadowKostya Serebryany2013-12-231-20/+19
| | | | llvm-svn: 197904
* Transforms: Don't create bad weights when eliminating dead casesJustin Bogner2013-12-201-1/+1
| | | | | | | | | 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. llvm-svn: 197791
* Stay classy (and legal) LLVM. Remove links to 3rd party SMT solver whose ↵Kay Tiong Khoo2013-12-191-4/+2
| | | | | | links may not be permanent. llvm-svn: 197713
* Improved fix for PR17827 (instcombine of shift/and/compare).Kay Tiong Khoo2013-12-191-22/+32
| | | | | | | | | 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. llvm-svn: 197705
* [dfsan] Simplify code after r197677.Evgeniy Stepanov2013-12-191-19/+14
| | | | llvm-svn: 197679
* Add an explicit insert point argument to SplitBlockAndInsertIfThen.Evgeniy Stepanov2013-12-194-30/+25
| | | | | | | | Currently SplitBlockAndInsertIfThen requires that branch condition is an Instruction itself, which is very inconvenient, because it is sometimes an Operator, or even a Constant. llvm-svn: 197677
* LoopVectorizer: Don't if-convert constant expressions that can trapArnold Schwaighofer2013-12-171-1/+31
| | | | | | | | | | 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 llvm-svn: 197449
* Enable double to float shrinking optimizations for binary functions like ↵Yi Jiang2013-12-162-9/+86
| | | | | | 'fmin/fmax'. Fix radar:15283121 llvm-svn: 197434
* Fix a use-after-free error in GlobalOpt CleanupConstantGlobalUsersHal Finkel2013-12-121-2/+11
| | | | | | | | | | | | 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. llvm-svn: 197178
* Initialize the barrier pass llvm::initializeIPOHal Finkel2013-12-121-0/+1
| | | | | | | | | 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). llvm-svn: 197177
* Resubmit r196544: Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, ↵Yi Jiang2013-12-121-0/+6
| | | | | | x) ―> __exp10(x) llvm-svn: 197109
* Prune redundant dependencies in LLVMBuild.txt.NAKAMURA Takumi2013-12-112-2/+2
| | | | llvm-svn: 196988
* [asan] Fix the coverage.cc test broken by r196939Reid Kleckner2013-12-101-1/+13
| | | | | | | | | | | | | | | | 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. llvm-svn: 196973
* Add proper dependencies to LLVMBuild.txt in llvm/lib.NAKAMURA Takumi2013-12-102-2/+2
| | | | | | I'll prune redundant deps in LLVMBuild.txt, later. llvm-svn: 196881
* Whitespaces.NAKAMURA Takumi2013-12-101-1/+0
| | | | llvm-svn: 196880
* Transforms: Don't create bad branch weights when folding a switchJustin Bogner2013-12-101-2/+4
| | | | | | | | 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. llvm-svn: 196845
* Revert 196544 due to internal bot failures.Manman Ren2013-12-081-6/+0
| | | | llvm-svn: 196732
* Fix inlining to not lose the "cleanup" clause from landingpadsMark Seaborn2013-12-081-0/+2
| | | | | | | This fixes PR17872. This bug can lead to C++ destructors not being called when they should be, when an exception is thrown. llvm-svn: 196711
* Fix inlining to not produce duplicate landingpad clausesMark Seaborn2013-12-081-20/+12
| | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 196710
* Don't #include heavy Dominators.h file in LoopInfo.h. This change reducesJakub Staszak2013-12-076-0/+6
| | | | | | overall time of LLVM compilation by ~1%. llvm-svn: 196667
* Fix assert with copy from global through addrspacecastMatt Arsenault2013-12-071-3/+3
| | | | llvm-svn: 196638
* Don't use isNullValue to evaluate ConstantExprDuncan P. N. Exon Smith2013-12-061-1/+4
| | | | | | | | ConstantExpr can evaluate to false even when isNullValue gives false. Fixes PR18143. llvm-svn: 196611
* [asan] fix ndebug build with strict warnings (-Wunused-variable)Kostya Serebryany2013-12-061-0/+1
| | | | llvm-svn: 196574
* [asan] rewrite asan's stack frame layoutKostya Serebryany2013-12-063-145/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 196568
* Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x)Yi Jiang2013-12-051-0/+6
| | | | llvm-svn: 196544
* Add #pragma vectorize enable/disable to LLVMRenato Golin2013-12-052-32/+43
| | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 196537
* Change std::deque => std::vector. No functionality change.Michael Gottesman2013-12-051-6/+6
| | | | | | | | 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. llvm-svn: 196524
* Fix non-deterministic behavior.Rafael Espindola2013-12-051-1/+1
| | | | | | | | | | We use CSEBlocks to initialize a worklist: SmallVector<BasicBlock *, 8> CSEWorkList(CSEBlocks.begin(), CSEBlocks.end()); so it must have a deterministic order. llvm-svn: 196520
* SLPVectorizer: An in-tree vectorized entry cannot also be a scalar external useArnold Schwaighofer2013-12-051-5/+1
| | | | | | | | | | | | | | | 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 llvm-svn: 196508
* [tsan] fix PR18146: sometimes a variable written into vptr could have an ↵Kostya Serebryany2013-12-051-1/+3
| | | | | | integer type (after other optimizations) llvm-svn: 196507
* Correct word hyphenationsAlp Toker2013-12-0511-21/+21
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* llvm-cov: Replace size() with empty() in bool check.Yuchen Wu2013-12-041-2/+2
| | | | llvm-svn: 196400
* Un-revert r196358: "llvm-cov: Added support for function checksums."Daniel Jasper2013-12-041-3/+17
| | | | | | And add the proper fix. llvm-svn: 196367
* Revert r196358: "llvm-cov: Added support for function checksums."Daniel Jasper2013-12-041-16/+3
| | | | | | | 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. llvm-svn: 196365
* llvm-cov: Added support for function checksums.Yuchen Wu2013-12-041-3/+16
| | | | | | | The function checksums are hashed from the concatenation of the function name and line number. llvm-svn: 196358
* Teach the internalize pass to skip dllexported symbols because they could beYunzhong Gao2013-12-031-0/+4
| | | | | | | | referenced in a way that even the linker does not see. Differential Revision: http://llvm-reviews.chandlerc.com/D2280 llvm-svn: 196300
* Use local variable for repeated use rather than 'get' method. No functional ↵Kay Tiong Khoo2013-12-021-4/+3
| | | | | | change intended. llvm-svn: 196164
* Move variables to where they are used and give them better names. No ↵Kay Tiong Khoo2013-12-021-6/+8
| | | | | | functional change intended. llvm-svn: 196163
* Rename variables to be consistent (CST -> Cst). No functional change intended.Kay Tiong Khoo2013-12-021-30/+30
| | | | llvm-svn: 196161
* InlineFunction.cpp: Remove a return value that is always falseMark Seaborn2013-12-021-11/+3
| | | | | | | | Remove some associated dead code. This cleanup is associated with PR17872. llvm-svn: 196147
* Conservative fix for PR17827 - don't optimize a shift + and + compare ↵Kay Tiong Khoo2013-12-021-4/+12
| | | | | | sequence where the shift is logical unless the comparison is unsigned llvm-svn: 196129
* [tsan] fix instrumentation of vector vptr updates ↵Kostya Serebryany2013-12-021-4/+7
| | | | | | (https://code.google.com/p/thread-sanitizer/issues/detail?id=43) llvm-svn: 196079
* Use accessor methods instead.Bill Wendling2013-12-011-2/+1
| | | | llvm-svn: 196006
OpenPOWER on IntegriCloud