[PATCH] D109106: [ISEL][BitTestBlock] pre-commit test for D109103

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 12:49:43 PDT 2021


nickdesaulniers updated this revision to Diff 370372.
nickdesaulniers added a comment.

- add llvm/test/CodeGen/X86/switch-bit-test-unreachable-default.ll from D109103 <https://reviews.llvm.org/D109103>, add -global-isel=1 coverage.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109106/new/

https://reviews.llvm.org/D109106

Files:
  llvm/test/CodeGen/X86/SwitchLowering.ll


Index: llvm/test/CodeGen/X86/SwitchLowering.ll
===================================================================
--- llvm/test/CodeGen/X86/SwitchLowering.ll
+++ llvm/test/CodeGen/X86/SwitchLowering.ll
@@ -62,3 +62,46 @@
 
 declare void @foo(i8)
 
+define i32 @baz(i32 %0) {
+; CHECK-LABEL: baz:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    xorl %eax, %eax
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; CHECK-NEXT:    movl $13056, %edx # imm = 0x3300
+; CHECK-NEXT:    btl %ecx, %edx
+; CHECK-NEXT:    jae .LBB1_1
+; CHECK-NEXT:  # %bb.3: # %return
+; CHECK-NEXT:    retl
+; CHECK-NEXT:  .LBB1_1:
+; CHECK-NEXT:    movl $48, %eax
+; CHECK-NEXT:    btl %ecx, %eax
+; CHECK-NEXT:    jae .LBB1_4
+; CHECK-NEXT:  # %bb.2: # %sw.epilog8
+; CHECK-NEXT:    movl $1, %eax
+; CHECK-NEXT:    retl
+; CHECK-NEXT:  .LBB1_4: # %if.then.unreachabledefault
+  switch i32 %0, label %if.then.unreachabledefault [
+    i32 4, label %sw.epilog8
+    i32 5, label %sw.epilog8
+    i32 8, label %sw.bb2
+    i32 9, label %sw.bb2
+    i32 12, label %sw.bb4
+    i32 13, label %sw.bb4
+  ]
+
+sw.bb2:
+  br label %return
+
+sw.bb4:
+  br label %return
+
+sw.epilog8:
+  br label %return
+
+if.then.unreachabledefault:
+  unreachable
+
+return:
+  %retval.0 = phi i32 [ 1, %sw.epilog8 ], [ 0, %sw.bb2 ], [ 0, %sw.bb4 ]
+  ret i32 %retval.0
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109106.370372.patch
Type: text/x-patch
Size: 1321 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210902/b32effb3/attachment.bin>


More information about the llvm-commits mailing list