diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-10 23:30:57 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-10 23:30:57 +0000 |
commit | c1ae01688f27f61edf1c449b7c67688275ac8fba (patch) | |
tree | 951f9cf8d62a105dbd189fe7b191df826135f8ee /llvm/test/Transforms/InstCombine/div-cmp-overflow.ll | |
parent | b034bc71d4b75081371dd430a9976e743454eac2 (diff) | |
download | bcm5719-llvm-c1ae01688f27f61edf1c449b7c67688275ac8fba.tar.gz bcm5719-llvm-c1ae01688f27f61edf1c449b7c67688275ac8fba.zip |
Fix an icmp+sdiv optimization to check for and handle an overflow
condition. This fixes PR2740.
llvm-svn: 56076
Diffstat (limited to 'llvm/test/Transforms/InstCombine/div-cmp-overflow.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/div-cmp-overflow.ll | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/div-cmp-overflow.ll b/llvm/test/Transforms/InstCombine/div-cmp-overflow.ll new file mode 100644 index 00000000000..9276c96479d --- /dev/null +++ b/llvm/test/Transforms/InstCombine/div-cmp-overflow.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sdiv +; PR2740 + +define i1 @func_75(i32 %i2) nounwind { + %i3 = sdiv i32 %i2, -1328634635 + %i4 = icmp eq i32 %i3, -1 + ret i1 %i4 +} |