[llvm] aefe411 - [LoongArch] Add a test for spurious mask removal. NFC
WANG Rui via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 20 22:43:18 PDT 2024
Author: WANG Rui
Date: 2024-07-21T13:42:26+08:00
New Revision: aefe411dae156350721268161e6cac36a8d29333
URL: https://github.com/llvm/llvm-project/commit/aefe411dae156350721268161e6cac36a8d29333
DIFF: https://github.com/llvm/llvm-project/commit/aefe411dae156350721268161e6cac36a8d29333.diff
LOG: [LoongArch] Add a test for spurious mask removal. NFC
Link: https://github.com/llvm/llvm-project/pull/99272#issuecomment-2241348794
Added:
Modified:
llvm/test/CodeGen/LoongArch/andn-icmp.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/LoongArch/andn-icmp.ll b/llvm/test/CodeGen/LoongArch/andn-icmp.ll
index 4fc3c8df4664c..447f3ac5c34fd 100644
--- a/llvm/test/CodeGen/LoongArch/andn-icmp.ll
+++ b/llvm/test/CodeGen/LoongArch/andn-icmp.ll
@@ -601,3 +601,25 @@ define i1 @andn_icmp_ult_i8_nn(i8 %a, i8 %b) nounwind {
%cmp = icmp ult i8 %and, %b
ret i1 %cmp
}
+
+define i1 @andn_icmp_eq_i8_i32(i8 signext %a, i8 signext %b) nounwind {
+; LA32-LABEL: andn_icmp_eq_i8_i32:
+; LA32: # %bb.0:
+; LA32-NEXT: andn $a0, $a1, $a0
+; LA32-NEXT: andi $a0, $a0, 255
+; LA32-NEXT: sltui $a0, $a0, 1
+; LA32-NEXT: ret
+;
+; LA64-LABEL: andn_icmp_eq_i8_i32:
+; LA64: # %bb.0:
+; LA64-NEXT: andn $a0, $a1, $a0
+; LA64-NEXT: andi $a0, $a0, 255
+; LA64-NEXT: sltui $a0, $a0, 1
+; LA64-NEXT: ret
+ %x = zext i8 %a to i32
+ %y = zext i8 %b to i32
+ %not = xor i32 %x, -1
+ %and = and i32 %not, %y
+ %cmp = icmp eq i32 %and, 0
+ ret i1 %cmp
+}
More information about the llvm-commits
mailing list