diff options
author | Chad Rosier <mcrosier@codeaurora.org> | 2014-09-26 20:05:35 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@codeaurora.org> | 2014-09-26 20:05:35 +0000 |
commit | 7b974b73ae0d0a2533431b3f22845ee9aeb3d837 (patch) | |
tree | 739501b4d607eb499a09214763fe0530f3c98d5c /llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll | |
parent | 7e38e429b7360ffac1f0853bb8023f9dd88b9fea (diff) | |
download | bcm5719-llvm-7b974b73ae0d0a2533431b3f22845ee9aeb3d837.tar.gz bcm5719-llvm-7b974b73ae0d0a2533431b3f22845ee9aeb3d837.zip |
[IndVar] Don't widen loop compare unless IV user is sign extended.
PR21030
llvm-svn: 218539
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll')
-rw-r--r-- | llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll b/llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll index a6963948d8b..b85fc6d1e4c 100644 --- a/llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll +++ b/llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll @@ -136,3 +136,29 @@ for.body: for.end: ret i32 %sum.0 } + +declare i32 @fn1(i8 signext) + +; PR21030 +; CHECK-LABEL: @test4 +; CHECK: for.body: +; CHECK: phi i32 +; CHECK: icmp sgt i8 + +define i32 @test4(i32 %a) { +entry: + br label %for.body + +for.body: + %c.07 = phi i8 [ -3, %entry ], [ %dec, %for.body ] + %conv6 = zext i8 %c.07 to i32 + %or = or i32 %a, %conv6 + %conv3 = trunc i32 %or to i8 + %call = call i32 @fn1(i8 signext %conv3) + %dec = add i8 %c.07, -1 + %cmp = icmp sgt i8 %dec, -14 + br i1 %cmp, label %for.body, label %for.end + +for.end: + ret i32 0 +} |