diff options
author | Dorit Nuzman <dorit.nuzman@intel.com> | 2017-12-10 11:13:35 +0000 |
---|---|---|
committer | Dorit Nuzman <dorit.nuzman@intel.com> | 2017-12-10 11:13:35 +0000 |
commit | 6ae5d1f67fd8f26fd1a007667b8615035b89a524 (patch) | |
tree | fb5849d5fb905a7dba8cc7c9a319c311e7346d28 /test/Transforms/LoopVectorize | |
parent | 9b5897c93f202f92b7f6e0b59dccabd820502b8b (diff) |
[SCEV] Fix wrong Equal predicate created in getAddRecForPhiWithCasts
CreateAddRecFromPHIWithCastsImpl() adds an IncrementNUSW overflow predicate
which allows the PSCEV rewriter to rewrite this scev expression:
(zext i8 {0, + , (trunc i32 step to i8)} to i32)
into
{0, +, (sext i8 (trunc i32 step to i8) to i32)}
But then it adds the wrong Equal predicate:
%step == (zext i8 (trunc i32 %step to i8) to i32).
instead of:
%step == (sext i8 (trunc i32 %step to i8) to i32)
This is fixed here.
Differential Revision: https://reviews.llvm.org/D40641
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopVectorize')
-rw-r--r-- | test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll b/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll index 40af8f3adf0..d9c9632be04 100644 --- a/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll +++ b/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll @@ -74,7 +74,7 @@ for.end: ; Same as above, but for checking the SCEV "zext(trunc(%p.09)) + %step". ; Here we expect the following two predicates to be added for runtime checking: ; 1) {0,+,(trunc i32 %step to i8)}<%for.body> Added Flags: <nusw> -; 2) Equal predicate: %step == (zext i8 (trunc i32 %step to i8) to i32) +; 2) Equal predicate: %step == (sext i8 (trunc i32 %step to i8) to i32) ; ; int a[N]; ; void doit2(int n, int step) { @@ -93,7 +93,8 @@ for.end: ; CHECK-NOT: %mul = call { i8, i1 } @llvm.umul.with.overflow.i8(i8 {{.*}}, i8 {{.*}}) ; CHECK: %[[TEST:[0-9]+]] = or i1 {{.*}}, %mul.overflow ; CHECK: %[[NTEST:[0-9]+]] = or i1 false, %[[TEST]] -; CHECK: %ident.check = icmp ne i32 {{.*}}, %{{.*}} +; CHECK: %[[EXT:[0-9]+]] = sext i8 {{.*}} to i32 +; CHECK: %ident.check = icmp ne i32 {{.*}}, %[[EXT]] ; CHECK: %{{.*}} = or i1 %[[NTEST]], %ident.check ; CHECK-NOT: %mul = call { i8, i1 } @llvm.umul.with.overflow.i8(i8 {{.*}}, i8 {{.*}}) ; CHECK: vector.body: |