[llvm] 4c41e7c - [X86] Add the second test case mentioned on Issue #65895

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 09:20:04 PDT 2023


Author: Simon Pilgrim
Date: 2023-11-02T16:19:34Z
New Revision: 4c41e7ce2045ff7cfa2d9d5dd2b8529041ac9bee

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

LOG: [X86] Add the second test case mentioned on Issue #65895

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/pr65895.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/pr65895.ll b/llvm/test/CodeGen/X86/pr65895.ll
index 4fbbed4b18aff03..ced60ee73cc84a1 100644
--- a/llvm/test/CodeGen/X86/pr65895.ll
+++ b/llvm/test/CodeGen/X86/pr65895.ll
@@ -58,3 +58,24 @@ for.end:
   store i64 %conv11, ptr @e, align 8
   ret i32 0
 }
+
+declare void @bar(i32)
+define void @foo(i8 %arg) nounwind {
+; CHECK-LABEL: foo:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    pushq %rax
+; CHECK-NEXT:    addb $-109, %dil
+; CHECK-NEXT:    movsbl %dil, %eax
+; CHECK-NEXT:    leal 1(%rax,%rax,2), %edi
+; CHECK-NEXT:    callq bar at PLT
+; CHECK-NEXT:    popq %rax
+; CHECK-NEXT:    retq
+entry:
+  %0 = add nsw i8 %arg, -109
+  %1 = sext i8 %0 to i32
+  %reassoc = shl i32 %1, 1
+  %2 = add i32 %1, 1
+  %3 = add i32 %2, %reassoc
+  call void @bar(i32 %3)
+  ret void
+}


        


More information about the llvm-commits mailing list