diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2018-06-13 02:25:32 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-06-13 02:25:32 +0000 |
commit | 0ed79620c6d2ff008a483d62f51b21e69f5bfac6 (patch) | |
tree | 9fcfa1fc38b810aa083003a93c02883ca5d975f5 /llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll | |
parent | 8472ec9663a5131b04abd01bff1fcd778c9b19c8 (diff) | |
download | bcm5719-llvm-0ed79620c6d2ff008a483d62f51b21e69f5bfac6.tar.gz bcm5719-llvm-0ed79620c6d2ff008a483d62f51b21e69f5bfac6.zip |
[SimplifyIndVars] Ignore dead users
IndVarSimplify sometimes makes transforms basing on users that are trivially dead. In particular,
if DCE wasn't run before it, there may be a dead `sext/zext` in loop that will trigger widening
transforms, however it makes no sense to do it.
This patch teaches IndVarsSimplify ignore the mist trivial cases of that.
Differential Revision: https://reviews.llvm.org/D47974
Reviewed By: sanjoy
llvm-svn: 334567
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll')
-rw-r--r-- | llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll b/llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll index 1a63c795548..320f0b30cb9 100644 --- a/llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll +++ b/llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll @@ -293,6 +293,8 @@ for.end: ; preds = %if.end, %entry ret void } +declare void @use(i1 %x) + ; check that we handle conditions with loop invariant operands which ; *aren't* in the header - this is a very rare and fragile case where ; we have a "loop" which is known to run exactly one iteration but @@ -320,6 +322,7 @@ latch: br i1 true, label %exit, label %loop exit: + call void @use(i1 %cmp) ret void } |