Skip to content

Commit

Permalink
[DAGCombiner] Precommit test case for D95086
Browse files Browse the repository at this point in the history
This is the test case for D95086 with worse result.

Differential Revision: https://reviews.llvm.org/D95103
  • Loading branch information
weiguozhi committed Jan 21, 2021
1 parent 825c2b4 commit 96296d9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions llvm/test/CodeGen/X86/select-ext.ll
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 96296d9

Please sign in to comment.