summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Drop spurious handle in comment.Benjamin Kramer2013-09-221-1/+1
| | | | llvm-svn: 191172
* SROA: Handle casts involving vectors of pointers and integer scalars.Benjamin Kramer2013-09-211-11/+47
| | | | | | | | | | SROA wants to convert any types of equivalent widths but it's not possible to convert vectors of pointers to an integer scalar with a single cast. As a workaround we add a bitcast to the corresponding int ptr type first. This type of cast used to be an edge case but has become common with SLP vectorization. Fixes PR17271. llvm-svn: 191143
* SLPVectorizer: Fix multiline comment warningArnold Schwaighofer2013-09-211-2/+2
| | | | llvm-svn: 191135
* Reapply "SLPVectorizer: Handle more horizontal reductions (disabled)""Arnold Schwaighofer2013-09-211-8/+364
| | | | | | | | | | | | | | Reapply r191108 with a fix for a memory corruption error I introduced. Of course, we can't reference the scalars that we replace by vectorizing and then call their eraseFromParent method. I only 'needed' the scalars to get the DebugLoc. Just store the DebugLoc before actually vectorizing instead. As a nice side effect, this also simplifies the interface between BoUpSLP and the HorizontalReduction class to returning a value pointer (the vectorized tree root). radar://14607682 llvm-svn: 191123
* LoopVectorizer: Only allow vectorization of intrinsics. We can't know for ↵Nadav Rotem2013-09-211-2/+11
| | | | | | | | sure that the functions 'abs' or 'round' are the functions from libm. rdar://15012650 llvm-svn: 191122
* Revert "SLPVectorizer: Handle more horizontal reductions (disabled)"Arnold Schwaighofer2013-09-211-368/+8
| | | | | | | | | This reverts commit r191108. The horizontal.ll test case fails under libgmalloc. Thanks Shuxin for pointing this out to me. llvm-svn: 191121
* Resurrect r191017 " GVN proceeds in the presence of dead code" plus a fix to ↵Shuxin Yang2013-09-201-6/+168
| | | | | | | | | PR17307 & 17308. The problem of r191017 is that when GVN fabricate a val-number for a dead instruction (in order to make following expr-PRE happy), it forget to fabricate a leader-table entry for it as well. llvm-svn: 191118
* InstCombine: Remove unused argument. No functionality change.Benjamin Kramer2013-09-202-12/+6
| | | | llvm-svn: 191112
* SLPVectorizer: Handle more horizontal reductions (disabled)Arnold Schwaighofer2013-09-201-8/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Match reductions starting at binary operation feeding into a phi. The code handles trees like r += v1 + v2 + v3 ... and r += v1 r += v2 ... and r *= v1 + v2 + ... We currently only handle associative operations (add, fadd fast). The code can now also handle reductions feeding into stores. a[i] = v1 + v2 + v3 + ... The code is currently disabled behind the flag "-slp-vectorize-hor". The cost model for most architectures is not there yet. I found one opportunity of a horizontal reduction feeding a phi in TSVC (LoopRerolling-flt) and there are several opportunities where reductions feed into stores. radar://14607682 llvm-svn: 191108
* Revert r191017, it results in segmentation faults in Qt.Joerg Sonnenberger2013-09-201-164/+6
| | | | llvm-svn: 191104
* InstCombine: Canonicalize (gep i8* X, -(ptrtoint Y)) to (sub (ptrtoint X), ↵Benjamin Kramer2013-09-201-0/+14
| | | | | | | | | | (ptrtoint Y)) The GEP pattern is what SCEV expander emits for "ugly geps". The latter is what you get for pointer subtraction in C code. The rest of instcombine already knows how to deal with that so just canonicalize on that. llvm-svn: 191090
* [Fast-math] Disable "(C1/X)*C2 => (C1*C2)/X" if C1/X has multiple uses.Shuxin Yang2013-09-191-3/+6
| | | | | | | | | | | | | | | | | | If "C1/X" were having multiple uses, the only benefit of this transformation is to potentially shorten critical path. But it is at the cost of instroducing additional div. The additional div may or may not incur cost depending on how div is implemented. If it is implemented using Newton–Raphson iteration, it dosen't seem to incur any cost (FIXME). However, if the div blocks the entire pipeline, that sounds to be pretty expensive. Let CodeGen to take care this transformation. This patch sees 6% on a benchmark. rdar://15032743 llvm-svn: 191037
* InstCombine: Don't allow turning vector-of-pointer loads into vector-of-integer.Benjamin Kramer2013-09-191-1/+2
| | | | | | The code below can't handle any pointers. PR17293. llvm-svn: 191036
* GVN proceeds in the presence of dead code.Shuxin Yang2013-09-191-6/+164
| | | | | | | | | | | | | | | | | | | | | | This is how it ignores the dead code: 1) When a dead branch target, say block B, is identified, all the blocks dominated by B is dead as well. 2) The PHIs of those blocks in dominance-frontier(B) is updated such that the operands corresponding to dead predecessors are replaced by "UndefVal". Using lattice's jargon, the "UndefVal" is the "Top" in essence. Phi node like this "phi(v1 bb1, undef xx)" will be optimized into "v1" if v1 is constant, or v1 is an instruction which dominate this PHI node. 3) When analyzing the availability of a load L, all dead mem-ops which L depends on disguise as a load which evaluate exactly same value as L. 4) The dead mem-ops will be materialized as "UndefVal" during code motion. llvm-svn: 191017
* [msan] Wrap indirect functions.Evgeniy Stepanov2013-09-191-7/+43
| | | | | | | | | Adds a flag to the MemorySanitizer pass that enables runtime rewriting of indirect calls. This is part of MSanDR implementation and is needed to return control to the DynamiRio-based helper tool on transition between instrumented and non-instrumented modules. Disabled by default. llvm-svn: 191006
* [asan] call __asan_stack_malloc_N only if use-after-return detection is ↵Kostya Serebryany2013-09-181-1/+22
| | | | | | enabled with the run-time option llvm-svn: 190939
* Prevent LoopVectorizer and SLPVectorizer running if the target has no vector ↵Robert Lytton2013-09-182-0/+10
| | | | | | | | | | registers. XCore target: Add XCoreTargetTransformInfo This is where getNumberOfRegisters() resides, which in turn returns the number of vector registers (=0). llvm-svn: 190936
* Revert accidental commit I had to make to get the test case in PR17268 to ↵Craig Topper2013-09-181-1/+1
| | | | | | still work correctly. llvm-svn: 190917
* Lift alignment restrictions for load/store folding on ↵Craig Topper2013-09-181-1/+1
| | | | | | VINSERTF128/VEXTRACTF128. Fixes PR17268. llvm-svn: 190916
* ifndef NDEBUG-out an asserts-only constant committed in r190863David Blaikie2013-09-181-0/+2
| | | | llvm-svn: 190905
* Revert the load slicing done in r190870.Quentin Colombet2013-09-171-285/+0
| | | | | | | To avoid regressions with bitfield optimizations, this slicing should take place later, like ISel time. llvm-svn: 190891
* Cleanup handling of constant function casts.Matt Arsenault2013-09-171-24/+8
| | | | | | | | | | Some of this code is no longer necessary since int<->ptr casts are no longer occur as of r187444. This also fixes handling vectors of pointers, and adds a bunch of new testcases for vectors and address spaces. llvm-svn: 190885
* SLPVectorizer: Don't vectorize phi nodes that use invoke valuesArnold Schwaighofer2013-09-171-0/+12
| | | | | | | | | We can't insert an insertelement after an invoke. We would have to split a critical edge. So when we see a phi node that uses an invoke we just give up. radar://14990770 llvm-svn: 190871
* [InstCombiner] Slice a big load in two loads when the elements are next to eachQuentin Colombet2013-09-171-0/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | other in memory. The motivation was to get rid of truncate and shift right instructions that get in the way of paired load or floating point load. E.g., Consider the following example: struct Complex { float real; float imm; }; When accessing a complex, llvm was generating a 64-bits load and the imm field was obtained by a trunc(lshr) sequence, resulting in poor code generation, at least for x86. The idea is to declare that two load instructions is the canonical form for loading two arithmetic type, which are next to each other in memory. Two scalar loads at a constant offset from each other are pretty easy to detect for the sorts of passes that like to mess with loads. <rdar://problem/14477220> llvm-svn: 190870
* [asan] inline the calls to __asan_stack_free_* with small sizes. Yet another ↵Kostya Serebryany2013-09-171-3/+48
| | | | | | 10%-20% speedup for use-after-return llvm-svn: 190863
* Bugfix for PR17099:Stepan Dyatkovskiy2013-09-171-8/+15
| | | | | | | | | | | Wrong cast operation. MergeFunctions emits Bitcast instead of pointer-to-integer operation. Patch fixes MergeFunctions::writeThunk function. It replaces unconditional Bitcast creation with "Value* createCast(...)" method, that checks operand types and selects proper instruction. See unit-test as example. llvm-svn: 190859
* MemCpyOptimizer: Use max legal int size instead of pointer sizeMatt Arsenault2013-09-161-5/+8
| | | | | | | | | | | | If there are no legal integers, assume 1 byte. This makes more sense than using the pointer size as a guess for the maximum GPR width. It is conceivable to want to use some 64-bit pointers on a target where 64-bit integers aren't legal. llvm-svn: 190817
* Don't vectorize if there are outside loop users of the induction variable.Arnold Schwaighofer2013-09-161-0/+6
| | | | | | | | | | | | We would have to compute the pre increment value, either by computing it on every loop iteration or by splitting the edge out of the loop and inserting a computation for it there. For now, just give up vectorizing such loops. Fixes PR17179. llvm-svn: 190790
* [msan] Check return value of main().Evgeniy Stepanov2013-09-161-4/+13
| | | | llvm-svn: 190782
* Implement function prefix data as an IR feature.Peter Collingbourne2013-09-161-0/+3
| | | | | | | | | Previous discussion: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html Differential Revision: http://llvm-reviews.chandlerc.com/D1191 llvm-svn: 190773
* Replace some unnecessary vector copies with references.Benjamin Kramer2013-09-151-2/+0
| | | | llvm-svn: 190770
* Fix spelling.Robert Wilhelm2013-09-141-1/+1
| | | | llvm-svn: 190750
* Remove the long, long defunct IR block placement pass.Chandler Carruth2013-09-143-154/+0
| | | | | | | | | | | | | | | | | This pass was based on the previous (essentially unused) profiling infrastructure and the assumption that by ordering the basic blocks at the IR level in a particular way, the correct layout would happen in the end. This sometimes worked, and mostly didn't. It also was a really naive implementation of the classical paper that dates from when branch predictors were primarily directional and when loop structure wasn't commonly available. It also didn't factor into the equation non-fallthrough branches and other machine level details. Anyways, for all of these reasons and more, I wrote MachineBlockPlacement, which completely supercedes this pass. It both uses modern profile information infrastructure, and actually works. =] llvm-svn: 190748
* [msan] Add source file:line to stack origin reports.Evgeniy Stepanov2013-09-131-6/+8
| | | | | | Compiler part. llvm-svn: 190689
* Avoid a compiler warning about Found not being used when assertions areDuncan Sands2013-09-131-0/+1
| | | | | | disabled. llvm-svn: 190668
* Add getUnrollingPreferences to TTIHal Finkel2013-09-111-7/+25
| | | | | | | | | Allow targets to customize the default behavior of the generic loop unrolling transformation. This will be used by the PowerPC backend when targeting the A2 core (which is in-order with a deep pipeline), and using more aggressive defaults is important. llvm-svn: 190542
* Revert "Give internal classes hidden visibility."Benjamin Kramer2013-09-114-5/+5
| | | | | | | It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. llvm-svn: 190536
* Give internal classes hidden visibility.Benjamin Kramer2013-09-114-5/+5
| | | | | | Worth 100k on a linux/x86_64 Release+Asserts clang. llvm-svn: 190534
* Use type form of getIntPtrTypeMatt Arsenault2013-09-111-2/+2
| | | | | | | This doesn't change anything since malloc always returns address space 0. llvm-svn: 190498
* Teach loop-idiom about address space pointer sizesMatt Arsenault2013-09-111-12/+21
| | | | llvm-svn: 190491
* Add bracesMatt Arsenault2013-09-111-6/+9
| | | | llvm-svn: 190490
* Get rid of unused isPodLike definitions.Eli Friedman2013-09-112-12/+0
| | | | llvm-svn: 190461
* Don't assert on invalid loop vectorization hint.Eli Friedman2013-09-101-7/+10
| | | | llvm-svn: 190450
* Fix mistake in r190442.Eli Friedman2013-09-101-0/+7
| | | | llvm-svn: 190446
* Remove unused functions.Eli Friedman2013-09-101-5/+0
| | | | llvm-svn: 190442
* Teach ScalarEvolution about pointer address spacesMatt Arsenault2013-09-101-1/+1
| | | | llvm-svn: 190425
* LoopVectorize: PHI nodes are always at the beginning of a block, no need to ↵Benjamin Kramer2013-09-101-2/+2
| | | | | | scan the whole block. llvm-svn: 190422
* [asan] refactor the use-after-return API so that the size class is computed ↵Kostya Serebryany2013-09-101-10/+32
| | | | | | at compile time instead of at run-time. llvm part llvm-svn: 190407
* Use StringRef::npos for StringRef instead of std::string oneMatt Arsenault2013-09-101-3/+3
| | | | llvm-svn: 190375
* Don't shrink atomic ops to bool in GlobalOpt.Eli Friedman2013-09-091-4/+7
| | | | | | | | | LLVM IR doesn't currently allow atomic bool load/store operations, and the transformation is dubious anyway because it isn't profitable on all platforms. PR17163. llvm-svn: 190357
OpenPOWER on IntegriCloud