diff --git a/llvm/test/Transforms/InstCombine/D139275_c4001580.ll b/llvm/test/Transforms/InstCombine/D139275_c4001580.ll deleted file mode 100644 index 9eb2e913858465..00000000000000 --- a/llvm/test/Transforms/InstCombine/D139275_c4001580.ll +++ /dev/null @@ -1,19 +0,0 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes=instcombine -S < %s | FileCheck %s - -; Based on reproduced from https://reviews.llvm.org/D139275#4001580 -; FIXME: this is a miscompile. -define i8 @D139275_c4001580(i1 %c0, i1 %c1, i1 %c2, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.trueval) { -; CHECK-LABEL: @D139275_c4001580( -; CHECK-NEXT: [[INNER_COND:%.*]] = xor i1 [[C0:%.*]], [[C1:%.*]] -; CHECK-NEXT: [[OUTER_COND:%.*]] = and i1 [[C2:%.*]], [[C1]] -; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_COND]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]] -; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[OUTER_COND]], i8 [[OUTER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL]] -; CHECK-NEXT: ret i8 [[OUTER_SEL]] -; - %inner.cond = xor i1 %c0, %c1 - %outer.cond = and i1 %c2, %c1 - %inner.sel = select i1 %inner.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval - %outer.sel = select i1 %outer.cond, i8 %outer.sel.trueval, i8 %inner.sel - ret i8 %outer.sel -} diff --git a/llvm/test/Transforms/InstCombine/nested-select.ll b/llvm/test/Transforms/InstCombine/nested-select.ll index 4dcb4882070ec5..2eb481570cee08 100644 --- a/llvm/test/Transforms/InstCombine/nested-select.ll +++ b/llvm/test/Transforms/InstCombine/nested-select.ll @@ -241,6 +241,23 @@ define i1 @orcond.different.inner.cond.inverted.in.inner.sel(i1 %inner.cond.v0, ret i1 %outer.sel } +; Not an inversion +; Based on reproduced from https://reviews.llvm.org/D139275#4001580 +define i8 @D139275_c4001580(i1 %c0, i1 %c1, i1 %c2, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.trueval) { +; CHECK-LABEL: @D139275_c4001580( +; CHECK-NEXT: [[INNER_COND:%.*]] = xor i1 [[C0:%.*]], [[C1:%.*]] +; CHECK-NEXT: [[OUTER_COND:%.*]] = and i1 [[C2:%.*]], [[C1]] +; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_COND]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]] +; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[OUTER_COND]], i8 [[OUTER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL]] +; CHECK-NEXT: ret i8 [[OUTER_SEL]] +; + %inner.cond = xor i1 %c0, %c1 + %outer.cond = and i1 %c2, %c1 + %inner.sel = select i1 %inner.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval + %outer.sel = select i1 %outer.cond, i8 %outer.sel.trueval, i8 %inner.sel + ret i8 %outer.sel +} + ; Tests with intervening inversions ; In %outer.sel, %outer.cond is inverted