- Jul 14, 2013
-
-
Stephen Lin authored
This update was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done llvm-svn: 186268
-
Stephen Lin authored
Modify two Transforms tests to explicitly check for full function names in some cases, rather than just a common prefix. No functionality change. (This is to avoid confusing a scripted mass update of these tests to use CHECK-LABEL) llvm-svn: 186267
-
Stephen Lin authored
llvm-svn: 186263
-
- Jul 13, 2013
-
-
Arnold Schwaighofer authored
If an outside loop user of the reduction value uses the header phi node we cannot just reduce the vectorized phi value in the vector code epilog because we would loose VF-1 reductions. lp: p = phi (0, lv) lv = lv + 1 ... brcond , lp, outside outside: usr = add 0, p (Say the loop iterates two times, the value of p coming out of the loop is one). We cannot just transform this to: vlp: p = phi (<0,0>, lv) lv = lv + <1,1> .. brcond , lp, outside outside: p_reduced = p[0] + [1]; usr = add 0, p_reduced (Because the original loop iterated two times the vectorized loop would iterate one time, but p_reduced ends up being zero instead of one). We would have to execute VF-1 iterations in the scalar remainder loop in such cases. For now, just disable vectorization. PR16522 llvm-svn: 186256
-
Andrew Trick authored
llvm-svn: 186242
-
Andrew Trick authored
In general, one should always complete CFG modifications first, update CFG-based analyses, like Dominatores and LoopInfo, then generate instruction sequences. LoopVectorizer was creating a new loop, calling SCEVExpander to generate checks, then updating LoopInfo. I just changed the order. llvm-svn: 186241
-
Nick Lewycky authored
llvm-svn: 186235
-
Nick Lewycky authored
Fixes PR16605. llvm-svn: 186229
-
Joey Gouly authored
undef vector of the wrong type. LGTM'd by Nick Lewycky on IRC. llvm-svn: 186224
-
Andrew Trick authored
This is a reimplemntation of the patch originally in r186107. llvm-svn: 186215
-
- Jul 12, 2013
-
-
Arnold Schwaighofer authored
radar://14351991 llvm-svn: 186189
-
Arnold Schwaighofer authored
Fixes a 35% degradation compared to unvectorized code in MiBench/automotive-susan and an equally serious regression on a private image processing benchmark. radar://14351991 llvm-svn: 186188
-
Stephen Lin authored
llvm-svn: 186163
-
Chandler Carruth authored
against a constant." This reverts commit r186107. It didn't handle wrapping arithmetic in the loop correctly and thus caused the following C program to count from 0 to UINT64_MAX instead of from 0 to 255 as intended: #include <stdio.h> int main() { unsigned char first = 0, last = 255; do { printf("%d\n", first); } while (first++ != last); } Full test case and instructions to reproduce with just the -indvars pass sent to the original review thread rather than to r186107's commit. llvm-svn: 186152
-
Nadav Rotem authored
llvm-svn: 186145
-
Nadav Rotem authored
SLPVectorize: Replace the code that checks for vectorization candidates in successor blocks with code that scans PHINodes. Before we could vectorize PHINodes scanning successors was a good way of finding candidates. Now we can vectorize the phinodes which is simpler. llvm-svn: 186139
-
- Jul 11, 2013
-
-
Andrew Trick authored
Patch by Michele Scandale! Adds a special handling of the case where, during the loop exit condition rewriting, the exit value is a constant of bitwidth lower than the type of the induction variable: instead of introducing a trunc operation in order to match correctly the operand types, it allows to convert the constant value to an equivalent constant, depending on the initial value of the induction variable and the trip count, in order have an equivalent comparison between the induction variable and the new constant. llvm-svn: 186107
-
Arnold Schwaighofer authored
We can vectorize them because in the case where we wrap in the address space the unvectorized code would have had to access a pointer value of zero which is undefined behavior in address space zero according to the LLVM IR semantics. (Thank you Duncan, for pointing this out to me). Fixes PR16592. llvm-svn: 186088
-
Duncan Sands authored
predecessors of the two blocks it is attempting to merge supply the same incoming values to any phi in the successor block. This change allows merging in the case where there is one or more incoming values that are undef. The undef values are rewritten to match the non-undef value that flows from the other edge. Patch by Mark Lacey. llvm-svn: 186069
-
Nadav Rotem authored
llvm-svn: 186063
-
Nadav Rotem authored
llvm-svn: 186062
-
Nadav Rotem authored
llvm-svn: 186060
-
Michael Gottesman authored
Without the changes introduced into this patch, if TRE saw any allocas at all, TRE would not perform TRE *or* mark callsites with the tail marker. Because TRE runs after mem2reg, this inadequacy is not a death sentence. But given a callsite A without escaping alloca argument, A may not be able to have the tail marker placed on it due to a separate callsite B having a write-back parameter passed in via an argument with the nocapture attribute. Assume that B is the only other callsite besides A and B only has nocapture escaping alloca arguments (*NOTE* B may have other arguments that are not passed allocas). In this case not marking A with the tail marker is unnecessarily conservative since: 1. By assumption A has no escaping alloca arguments itself so it can not access the caller's stack via its arguments. 2. Since all of B's escaping alloca arguments are passed as parameters with the nocapture attribute, we know that B does not stash said escaping allocas in a manner that outlives B itself and thus could be accessed indirectly by A. With the changes introduced by this patch: 1. If we see any escaping allocas passed as a capturing argument, we do nothing and bail early. 2. If we do not see any escaping allocas passed as captured arguments but we do see escaping allocas passed as nocapture arguments: i. We do not perform TRE to avoid PR962 since the code generator produces significantly worse code for the dynamic allocas that would be created by the TRE algorithm. ii. If we do not return twice, mark call sites without escaping allocas with the tail marker. *NOTE* This excludes functions with escaping nocapture allocas. 3. If we do not see any escaping allocas at all (whether captured or not): i. If we do not have usage of setjmp, mark all callsites with the tail marker. ii. If there are no dynamic/variable sized allocas in the function, attempt to perform TRE on all callsites in the function. Based off of a patch by Nick Lewycky. rdar://14324281. llvm-svn: 186057
-
- Jul 10, 2013
-
-
David Majnemer authored
llvm-svn: 185973
-
- Jul 09, 2013
-
-
Nadav Rotem authored
Fix PR16571, which is a bug in the code that checks that all of the types in the bundle are uniform. llvm-svn: 185970
-
David Majnemer authored
(add nsw x, (and x, y)) isn't a power of two if x is zero, it's zero (add nsw x, (xor x, y)) isn't a power of two if y has bits set that aren't set in x llvm-svn: 185954
-
David Majnemer authored
The following transforms are valid if -C is a power of 2: (icmp ugt (xor X, C), ~C) -> (icmp ult X, C) (icmp ult (xor X, C), -C) -> (icmp uge X, C) These are nice, they get rid of the xor. llvm-svn: 185915
-
David Majnemer authored
Tests were added in r185910 somehow. llvm-svn: 185912
-
David Majnemer authored
llvm-svn: 185910
-
David Majnemer authored
C1-X <u C2 -> (X|(C2-1)) == C1 C1-X >u C2 -> (X|C2) == C1 X-C1 <u C2 -> (X & -C2) == C1 X-C1 >u C2 -> (X & ~C2) == C1 llvm-svn: 185909
-
- Jul 08, 2013
-
-
David Majnemer authored
Back in r179493 we determined that two transforms collided with each other. The fix back then was to reorder the transforms so that the preferred transform would give it a try and then we would try the secondary transform. However, it was noted that the best approach would canonicalize one transform into the other, removing the collision and allowing us to optimize IR given to us in that form. llvm-svn: 185808
-
Michael Gottesman authored
llvm-svn: 185782
-
- Jul 07, 2013
-
-
Nick Lewycky authored
pointer arguments. llvm-svn: 185776
-
Nadav Rotem authored
This is a complete re-write if the bottom-up vectorization class. Before this commit we scanned the instruction tree 3 times. First in search of merge points for the trees. Second, for estimating the cost. And finally for vectorization. There was a lot of code duplication and adding the DCE exposed bugs. The new design is simpler and DCE was a part of the design. In this implementation we build the tree once. After that we estimate the cost by scanning the different entries in the constructed tree (in any order). The vectorization phase also works on the built tree. llvm-svn: 185774
-
Michael Gottesman authored
Upon further reflection, the alias analysis part of r185764 is not a safe change. llvm-svn: 185770
-
Michael Gottesman authored
[objc-arc] Teach the ARC optimizer that objc_sync_enter/objc_sync_exit do not modify the ref count of an objc object and additionally are inert for modref purposes. llvm-svn: 185769
-
- Jul 06, 2013
-
-
David Majnemer authored
llvm-svn: 185737
-
Nick Lewycky authored
functions. Make the function attributes pass add it to known library functions and when it can deduce it. llvm-svn: 185735
-
Michael Gottesman authored
llvm-svn: 185729
-
- Jul 05, 2013
-
-
Michael Gottesman authored
llvm-svn: 185723
-