diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-04-12 15:15:19 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-04-12 15:15:19 +0000 |
commit | f9cea17f750eea65da0b5a270f57ba2f39908ccc (patch) | |
tree | 162904609406d3768c86cf1486fccd2e731917d0 /llvm/lib | |
parent | 755eb32a398c8c47540bc73c5cc8c12076b639f7 (diff) | |
download | bcm5719-llvm-f9cea17f750eea65da0b5a270f57ba2f39908ccc.tar.gz bcm5719-llvm-f9cea17f750eea65da0b5a270f57ba2f39908ccc.zip |
LoopVectorizer: integer division is not a reduction operation
Don't classify idiv/udiv as a reduction operation. Integer division is lossy.
For example : (1 / 2) * 4 != 4/2.
Example:
int a[] = { 2, 5, 2, 2}
int x = 80;
for()
x /= a[i];
Scalar:
x /= 2 // = 40
x /= 5 // = 8
x /= 2 // = 4
x /= 2 // = 2
Vectorized:
<80, 1> / <2,5> //= <40,0>
<40, 0> / <2,2> //= <20,0>
20*0 = 0
radar://13640654
llvm-svn: 179381
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index acf2b819b81..238fc8bfb70 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2833,8 +2833,6 @@ LoopVectorizationLegality::isReductionInstr(Instruction *I, case Instruction::Sub: case Instruction::Add: return Kind == RK_IntegerAdd; - case Instruction::SDiv: - case Instruction::UDiv: case Instruction::Mul: return Kind == RK_IntegerMult; case Instruction::And: |