[llvm] 1d7d9d6 - [InstCombine] add tests for masked add; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 09:13:55 PST 2020
Author: Sanjay Patel
Date: 2020-11-17T12:13:44-05:00
New Revision: 1d7d9d668545818b3b8c1019e9c0a8565f68f62c
URL: https://github.com/llvm/llvm-project/commit/1d7d9d668545818b3b8c1019e9c0a8565f68f62c
DIFF: https://github.com/llvm/llvm-project/commit/1d7d9d668545818b3b8c1019e9c0a8565f68f62c.diff
LOG: [InstCombine] add tests for masked add; NFC
Added:
Modified:
llvm/test/Transforms/InstCombine/and.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/and.ll b/llvm/test/Transforms/InstCombine/and.ll
index db54632b7149..68743ca15555 100644
--- a/llvm/test/Transforms/InstCombine/and.ll
+++ b/llvm/test/Transforms/InstCombine/and.ll
@@ -1062,6 +1062,29 @@ define i8 @lowmask_add(i8 %x) {
ret i8 %r
}
+define i8 @lowmask_add_2(i8 %x) {
+; CHECK-LABEL: @lowmask_add_2(
+; CHECK-NEXT: [[R:%.*]] = and i8 [[X:%.*]], 63
+; CHECK-NEXT: ret i8 [[R]]
+;
+ %a = add i8 %x, -64 ; 0xc0
+ %r = and i8 %a, 63 ; 0x3f
+ ret i8 %r
+}
+
+define i8 @lowmask_add_2_uses(i8 %x) {
+; CHECK-LABEL: @lowmask_add_2_uses(
+; CHECK-NEXT: [[A:%.*]] = add i8 [[X:%.*]], -64
+; CHECK-NEXT: call void @use8(i8 [[A]])
+; CHECK-NEXT: [[R:%.*]] = and i8 [[A]], 63
+; CHECK-NEXT: ret i8 [[R]]
+;
+ %a = add i8 %x, -64 ; 0xc0
+ call void @use8(i8 %a)
+ %r = and i8 %a, 63 ; 0x3f
+ ret i8 %r
+}
+
define i8 @not_lowmask_add(i8 %x) {
; CHECK-LABEL: @not_lowmask_add(
; CHECK-NEXT: [[A:%.*]] = add i8 [[X:%.*]], -64
More information about the llvm-commits
mailing list