[llvm] e077e3a - [InstCombine] add baseline test for (X * C2) << C1 --> X * (C2 << C1) without one use; NFC
via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 21 09:12:17 PDT 2022
Author: chenglin.bi
Date: 2022-04-22T00:12:06+08:00
New Revision: e077e3a6483efcb2099670537a6d7168629b2eb3
URL: https://github.com/llvm/llvm-project/commit/e077e3a6483efcb2099670537a6d7168629b2eb3
DIFF: https://github.com/llvm/llvm-project/commit/e077e3a6483efcb2099670537a6d7168629b2eb3.diff
LOG: [InstCombine] add baseline test for (X * C2) << C1 --> X * (C2 << C1) without one use; NFC
Added:
Modified:
llvm/test/Transforms/InstCombine/apint-shift.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/apint-shift.ll b/llvm/test/Transforms/InstCombine/apint-shift.ll
index a1f164cca32e6..039f263101f53 100644
--- a/llvm/test/Transforms/InstCombine/apint-shift.ll
+++ b/llvm/test/Transforms/InstCombine/apint-shift.ll
@@ -23,6 +23,21 @@ define i55 @test6a(i55 %A) {
ret i55 %C
}
+declare void @use(i55 %0)
+
+define i55 @test6a_negative_oneuse(i55 %A) {
+; CHECK-LABEL: @test6a_negative_oneuse(
+; CHECK-NEXT: [[B:%.*]] = mul i55 [[A:%.*]], 3
+; CHECK-NEXT: [[C:%.*]] = mul i55 [[A]], 6
+; CHECK-NEXT: call void @use(i55 [[B]])
+; CHECK-NEXT: ret i55 [[C]]
+;
+ %B = mul i55 %A, 3
+ %C = shl i55 %B, 1
+ call void @use(i55 %B)
+ ret i55 %C
+}
+
; (X * C2) << C1 --> X * (C2 << C1)
define <2 x i55> @test6a_vec(<2 x i55> %A) {
More information about the llvm-commits
mailing list