From 7a6aa1a3919af8ece92702c36dc552d81be9151a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 10 Feb 2011 05:36:31 +0000 Subject: 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 --- test/Transforms/InstCombine/nsw.ll | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/Transforms/InstCombine/nsw.ll') diff --git a/test/Transforms/InstCombine/nsw.ll b/test/Transforms/InstCombine/nsw.ll index efe2391..681bdc2 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 +} -- cgit v1.1