[llvm] bc3056b - [X86] Add test showing failure to modulo the rotation amounts before merging an inner rotation

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 08:54:59 PDT 2022


Author: Simon Pilgrim
Date: 2022-05-03T16:54:37+01:00
New Revision: bc3056b382ac3dc4ee1e80583ff8b0526e10f2ff

URL: https://github.com/llvm/llvm-project/commit/bc3056b382ac3dc4ee1e80583ff8b0526e10f2ff
DIFF: https://github.com/llvm/llvm-project/commit/bc3056b382ac3dc4ee1e80583ff8b0526e10f2ff.diff

LOG: [X86] Add test showing failure to modulo the rotation amounts before merging an inner rotation

Thanks to @spatel for the test case

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/combine-rotates.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/combine-rotates.ll b/llvm/test/CodeGen/X86/combine-rotates.ll
index eade7a8b126ed..ba775fca649a0 100644
--- a/llvm/test/CodeGen/X86/combine-rotates.ll
+++ b/llvm/test/CodeGen/X86/combine-rotates.ll
@@ -435,5 +435,18 @@ define i32 @fuzz9935() {
   ret i32 %4
 }
 
+; FIXME: Failure to modulo the inner rotation before adding the results
+define i5 @rotl_merge_i5(i5 %x) {
+; CHECK-LABEL: rotl_merge_i5:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    movl %edi, %eax
+; CHECK-NEXT:    # kill: def $al killed $al killed $eax
+; CHECK-NEXT:    retq
+  %r1 = call i5 @llvm.fshl.i5(i5 %x, i5 %x, i5 -1)
+  %r2 = call i5 @llvm.fshl.i5(i5 %r1, i5 %r1, i5 1)
+  ret i5 %r2
+}
+declare i5 @llvm.fshl.i5(i5, i5, i5)
+
 declare <4 x i32> @llvm.fshl.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)
 declare <4 x i32> @llvm.fshr.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)


        


More information about the llvm-commits mailing list