diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-07-12 05:04:38 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-07-12 05:04:38 +0000 |
commit | 3ac9e109b24eaae482eb914d970ba7980f462925 (patch) | |
tree | a9bfc7d343de39ae7071ddb5aac65db7c7c0bab3 /test/Transforms/InstCombine/2008-07-11-RemAnd.ll | |
parent | 5330192ab59d65f285799ff5a9acd67d27417a56 (diff) | |
download | external_llvm-3ac9e109b24eaae482eb914d970ba7980f462925.zip external_llvm-3ac9e109b24eaae482eb914d970ba7980f462925.tar.gz external_llvm-3ac9e109b24eaae482eb914d970ba7980f462925.tar.bz2 |
Enhance analysis of srem.
Remove dead code analyzing urem. 'urem' of power-of-2 is canonicalized to an
'and' instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/2008-07-11-RemAnd.ll')
-rw-r--r-- | test/Transforms/InstCombine/2008-07-11-RemAnd.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2008-07-11-RemAnd.ll b/test/Transforms/InstCombine/2008-07-11-RemAnd.ll new file mode 100644 index 0000000..0bfd41d --- /dev/null +++ b/test/Transforms/InstCombine/2008-07-11-RemAnd.ll @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem +; PR2330 + +define i32 @a(i32 %b) nounwind { +entry: + srem i32 %b, 8 ; <i32>:0 [#uses=1] + and i32 %0, 1 ; <i32>:1 [#uses=1] + ret i32 %1 +} |