diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2008-07-11 07:20:53 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2008-07-11 07:20:53 +0000 |
| commit | f95b64acaa98786690f1b45158cc5bd63589d258 (patch) | |
| tree | a26b74ea98ef845b73018350cfbec356ed4f38c5 /llvm/test/Transforms | |
| parent | 5774466a3323459e3b9843546cf173e4066eda35 (diff) | |
| download | bcm5719-llvm-f95b64acaa98786690f1b45158cc5bd63589d258.tar.gz bcm5719-llvm-f95b64acaa98786690f1b45158cc5bd63589d258.zip | |
Add another optimization from PR2330. Also catch some missing cases that are
similar.
llvm-svn: 53451
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll b/llvm/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll new file mode 100644 index 00000000000..50533db06d5 --- /dev/null +++ b/llvm/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll @@ -0,0 +1,19 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep add +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul +; PR2330 + +define i1 @f(i32 %x, i32 %y) nounwind { +entry: + %A = add i32 %x, 5 + %B = add i32 %y, 5 + %C = icmp eq i32 %A, %B + ret i1 %C +} + +define i1 @g(i32 %x, i32 %y) nounwind { +entry: + %A = mul i32 %x, 5 + %B = mul i32 %y, 5 + %C = icmp eq i32 %A, %B + ret i1 %C +} |

