Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Jul 14, 2024
1 parent 12b5833 commit 03b54bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions llvm/test/Transforms/InstCombine/select-of-sym-selects.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s

define i32 @src(i32 %a, i32 %b, i1 %c1, i1 %c2) {
; CHECK-LABEL: @src(
; CHECK-NEXT: [[TMP1:%.*]] = xor i1 [[C1:%.*]], [[C2:%.*]]
; CHECK-NEXT: [[RET:%.*]] = select i1 [[TMP1]], i32 [[B:%.*]], i32 [[A:%.*]]
; CHECK-NEXT: ret i32 [[RET]]
;
%sel1 = select i1 %c1, i32 %a, i32 %b
%sel2 = select i1 %c1, i32 %b, i32 %a
%ret = select i1 %c2, i32 %sel1, i32 %sel2
ret i32 %ret
}

0 comments on commit 03b54bc

Please sign in to comment.