diff options
| author | Owen Anderson <resistor@mac.com> | 2010-09-16 17:42:36 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2010-09-16 17:42:36 +0000 |
| commit | 94532cb297f9ddbef0390b3047e6b9cbec592382 (patch) | |
| tree | f8c26a279ea548efc77924a59b83b1c7bc81c761 /llvm/test/Transforms | |
| parent | ee1934a2da25d427a5c5e5b8937ae002b8546235 (diff) | |
| download | bcm5719-llvm-94532cb297f9ddbef0390b3047e6b9cbec592382.tar.gz bcm5719-llvm-94532cb297f9ddbef0390b3047e6b9cbec592382.zip | |
Fix PR8161, in which an unreachable loop causes recursive instruction simplification to try
to replace an instruction with itself. Add a predicate to the simplifier to prevent this case.
llvm-svn: 114097
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/CorrelatedValuePropagation/crash.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/CorrelatedValuePropagation/crash.ll b/llvm/test/Transforms/CorrelatedValuePropagation/crash.ll new file mode 100644 index 00000000000..8636788511e --- /dev/null +++ b/llvm/test/Transforms/CorrelatedValuePropagation/crash.ll @@ -0,0 +1,20 @@ +; RUN: opt < %s -correlated-propagation + +; PR8161 +define void @test1() nounwind ssp { +entry: + br label %for.end + +for.cond.us.us: ; preds = %for.cond.us.us + %cmp6.i.us.us = icmp sgt i32 1, 0 + %lor.ext.i.us.us = zext i1 %cmp6.i.us.us to i32 + %lor.ext.add.i.us.us = select i1 %cmp6.i.us.us, i32 %lor.ext.i.us.us, i32 undef + %conv.i.us.us = trunc i32 %lor.ext.add.i.us.us to i16 + %sext.us.us = shl i16 %conv.i.us.us, 8 + %conv6.us.us = ashr i16 %sext.us.us, 8 + %and.us.us = and i16 %conv6.us.us, %and.us.us + br i1 false, label %for.end, label %for.cond.us.us + +for.end: ; preds = %for.cond.us, %for.cond.us.us, %entry + ret void +} |

