[PATCH] D141076: [X86] Add additional tests to no-shift.ll
Phoebe Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 5 22:45:04 PST 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa698790c51ec: [X86] Add additional tests to no-shift.ll (authored by goldstein.w.n, committed by pengfei).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141076/new/
https://reviews.llvm.org/D141076
Files:
llvm/test/CodeGen/X86/not-shift.ll
Index: llvm/test/CodeGen/X86/not-shift.ll
===================================================================
--- llvm/test/CodeGen/X86/not-shift.ll
+++ llvm/test/CodeGen/X86/not-shift.ll
@@ -641,3 +641,72 @@
%result = lshr i32 %val, %adjcnt
ret i32 %result
}
+define i32 @invalid_sub31(i32 %val, i32 %cnt) nounwind {
+; X86-NOBMI2-LABEL: invalid_sub31:
+; X86-NOBMI2: # %bb.0:
+; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NOBMI2-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-NOBMI2-NEXT: addb $-31, %cl
+; X86-NOBMI2-NEXT: shll %cl, %eax
+; X86-NOBMI2-NEXT: retl
+;
+; X86-BMI2-LABEL: invalid_sub31:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movzbl {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: addb $-31, %al
+; X86-BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: retl
+;
+; X64-NOBMI2-LABEL: invalid_sub31:
+; X64-NOBMI2: # %bb.0:
+; X64-NOBMI2-NEXT: # kill: def $esi killed $esi def $rsi
+; X64-NOBMI2-NEXT: movl %edi, %eax
+; X64-NOBMI2-NEXT: leal -31(%rsi), %ecx
+; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx
+; X64-NOBMI2-NEXT: shll %cl, %eax
+; X64-NOBMI2-NEXT: retq
+;
+; X64-BMI2-LABEL: invalid_sub31:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: addb $-31, %sil
+; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
+; X64-BMI2-NEXT: retq
+ %adjcnt = sub i32 %cnt, 31
+ %result = shl i32 %val, %adjcnt
+ ret i32 %result
+}
+
+define i32 @invalid_add31(i32 %val, i32 %cnt) nounwind {
+; X86-NOBMI2-LABEL: invalid_add31:
+; X86-NOBMI2: # %bb.0:
+; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NOBMI2-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-NOBMI2-NEXT: addb $31, %cl
+; X86-NOBMI2-NEXT: shll %cl, %eax
+; X86-NOBMI2-NEXT: retl
+;
+; X86-BMI2-LABEL: invalid_add31:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movzbl {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: addb $31, %al
+; X86-BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: retl
+;
+; X64-NOBMI2-LABEL: invalid_add31:
+; X64-NOBMI2: # %bb.0:
+; X64-NOBMI2-NEXT: # kill: def $esi killed $esi def $rsi
+; X64-NOBMI2-NEXT: movl %edi, %eax
+; X64-NOBMI2-NEXT: leal 31(%rsi), %ecx
+; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx
+; X64-NOBMI2-NEXT: shll %cl, %eax
+; X64-NOBMI2-NEXT: retq
+;
+; X64-BMI2-LABEL: invalid_add31:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: addb $31, %sil
+; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
+; X64-BMI2-NEXT: retq
+ %adjcnt = add i32 %cnt, 31
+ %result = shl i32 %val, %adjcnt
+ ret i32 %result
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141076.486750.patch
Type: text/x-patch
Size: 2597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230106/6c8e84f8/attachment.bin>
More information about the llvm-commits
mailing list