| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 |
| ; RUN: opt -S --passes=slp-vectorizer < %s | FileCheck %s |
| |
| define i1 @test_explicit_poison_leaves(i1 %a, i1 %b) { |
| ; Tree effectively: (a || poison) || (b || poison) |
| ; If %a is true, 'op1' is true. Short-circuit protects against poison. |
| ; If %b is false, 'op2' is poison. |
| ; 'res' = op1 || op2. |
| ; If 'op1' is true (because a is true), 'res' should be true. |
| ; Vectorizer sees <a, b> and <poison, poison>. |
| ; CHECK-LABEL: define i1 @test_explicit_poison_leaves( |
| ; CHECK-SAME: i1 [[A:%.*]], i1 [[B:%.*]]) { |
| ; CHECK-NEXT: [[OP_RDX:%.*]] = select i1 [[A]], i1 true, i1 poison |
| ; CHECK-NEXT: [[OP_RDX1:%.*]] = select i1 [[OP_RDX]], i1 true, i1 [[B]] |
| ; CHECK-NEXT: ret i1 [[OP_RDX1]] |
| ; |
| %op1 = select i1 %a, i1 true, i1 poison |
| %op2 = select i1 %b, i1 true, i1 poison |
| %res = select i1 %op1, i1 true, i1 %op2 |
| ret i1 %res |
| } |
| |