summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/nsw.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-10 05:36:31 +0000
committerChris Lattner <sabre@nondot.org>2011-02-10 05:36:31 +0000
commit7a6aa1a3919af8ece92702c36dc552d81be9151a (patch)
treebf7aae31c9fef6342c9b6e785c700e6e3f7cbdec /test/Transforms/InstCombine/nsw.ll
parentb20c0b5092f11ff349855ec1e732590160aeba23 (diff)
downloadllvm-7a6aa1a3919af8ece92702c36dc552d81be9151a.tar.gz
llvm-7a6aa1a3919af8ece92702c36dc552d81be9151a.tar.bz2
llvm-7a6aa1a3919af8ece92702c36dc552d81be9151a.tar.xz
Enhance a bunch of transformations in instcombine to start generating
exact/nsw/nuw shifts and have instcombine infer them when it can prove that the relevant properties are true for a given shift without them. Also, a variety of refactoring to use the new patternmatch logic thrown in for good luck. I believe that this takes care of a bunch of related code quality issues attached to PR8862. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/nsw.ll')
-rw-r--r--test/Transforms/InstCombine/nsw.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/nsw.ll b/test/Transforms/InstCombine/nsw.ll
index efe2391cd7..681bdc234b 100644
--- a/test/Transforms/InstCombine/nsw.ll
+++ b/test/Transforms/InstCombine/nsw.ll
@@ -28,3 +28,12 @@ define i1 @shl_icmp(i64 %X) nounwind {
ret i1 %B
}
+; CHECK: @shl1
+; CHECK: %B = shl nuw nsw i64 %A, 8
+; CHECK: ret i64 %B
+define i64 @shl1(i64 %X, i64* %P) nounwind {
+ %A = and i64 %X, 312
+ store i64 %A, i64* %P ; multiple uses of A.
+ %B = shl i64 %A, 8
+ ret i64 %B
+}