[PATCH] D95103: [DAGCombiner] Precommit test case for D95086

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 15:41:40 PST 2021


Carrot created this revision.
Carrot added a reviewer: xbolva00.
Herald added a subscriber: pengfei.
Carrot requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is the test case for D95086 <https://reviews.llvm.org/D95086> with worse result.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95103

Files:
  llvm/test/CodeGen/X86/select-ext.ll


Index: llvm/test/CodeGen/X86/select-ext.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/X86/select-ext.ll
@@ -0,0 +1,21 @@
+; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s
+
+; TODO: (zext(select c, load1, load2)) -> (select c, zextload1, zextload2)
+
+; CHECK-LABEL: foo
+; CHECK:        movzbl  (%rdi), %eax
+; CHECK-NEXT:   movzbl  1(%rdi), %ecx
+; CHECK-NEXT:   testl   %esi, %esi
+; CHECK-NEXT:   cmovel  %eax, %ecx
+; CHECK-NEXT:   movzbl  %cl, %eax
+; CHECK-NEXT:   retq
+
+define i64 @foo(i8* %p, i1 zeroext %c) {
+  %ld1 = load volatile i8, i8* %p
+  %arrayidx1 = getelementptr inbounds i8, i8* %p, i64 1
+  %ld2 = load volatile i8, i8* %arrayidx1
+  %cond.v = select i1 %c, i8 %ld2, i8 %ld1
+  %cond = zext i8 %cond.v to i64
+  ret i64 %cond
+}
+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95103.318039.patch
Type: text/x-patch
Size: 831 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210120/77ab924e/attachment.bin>


More information about the llvm-commits mailing list