[llvm] 79909c0 - [NFC][InstCombine] fold-nested-selects: fix profitability check
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 14:04:02 PST 2022
Author: Roman Lebedev
Date: 2022-12-13T01:03:38+03:00
New Revision: 79909c031d43de21ce9c10394a5aac08bec0a874
URL: https://github.com/llvm/llvm-project/commit/79909c031d43de21ce9c10394a5aac08bec0a874
DIFF: https://github.com/llvm/llvm-project/commit/79909c031d43de21ce9c10394a5aac08bec0a874.diff
LOG: [NFC][InstCombine] fold-nested-selects: fix profitability check
We'd check the cost of the wrong 'cond', after potentially skipping `not`.
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/nested-select.ll
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 739c449575274..b18fd79c690af 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -2718,7 +2718,7 @@ static Instruction *foldNestedSelects(SelectInst &OuterSel,
std::swap(InnerSel, OuterSelFalseVal);
// Profitability check - avoid increasing instruction count.
- if (none_of(ArrayRef<Value *>({OuterCond, InnerSel}),
+ if (none_of(ArrayRef<Value *>({OuterSel.getCondition(), InnerSel}),
[](Value *V) { return V->hasOneUse(); }))
return nullptr;
diff --git a/llvm/test/Transforms/InstCombine/nested-select.ll b/llvm/test/Transforms/InstCombine/nested-select.ll
index 2f4e91151f3ce..4dcb4882070ec 100644
--- a/llvm/test/Transforms/InstCombine/nested-select.ll
+++ b/llvm/test/Transforms/InstCombine/nested-select.ll
@@ -7,7 +7,7 @@ declare void @use.i8(i8)
; Basic test
define i8 @andcond(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond(
+; CHECK-LABEL: define {{[^@]+}}@andcond(
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i8 [[OUTER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[INNER_COND:%.*]], i8 [[INNER_SEL]], i8 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: ret i8 [[OUTER_SEL]]
@@ -18,7 +18,7 @@ define i8 @andcond(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inne
ret i8 %outer.sel
}
define i8 @orcond(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond(
+; CHECK-LABEL: define {{[^@]+}}@orcond(
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]], i8 [[OUTER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[INNER_COND:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL]]
; CHECK-NEXT: ret i8 [[OUTER_SEL]]
@@ -32,7 +32,7 @@ define i8 @orcond(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner
; Extra use tests (basic test, no inversions)
define i8 @andcond.extrause0(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.extrause0(
+; CHECK-LABEL: define {{[^@]+}}@andcond.extrause0(
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[INNER_COND:%.*]], i1 [[ALT_COND:%.*]], i1 false
; CHECK-NEXT: call void @use.i1(i1 [[OUTER_COND]])
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND]], i8 [[OUTER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]]
@@ -46,7 +46,7 @@ define i8 @andcond.extrause0(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval
ret i8 %outer.sel
}
define i8 @orcond.extrause0(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.extrause0(
+; CHECK-LABEL: define {{[^@]+}}@orcond.extrause0(
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[INNER_COND:%.*]], i1 true, i1 [[ALT_COND:%.*]]
; CHECK-NEXT: call void @use.i1(i1 [[OUTER_COND]])
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND]], i8 [[INNER_SEL_FALSEVAL:%.*]], i8 [[OUTER_SEL_FALSEVAL:%.*]]
@@ -61,7 +61,7 @@ define i8 @orcond.extrause0(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval,
}
define i8 @andcond.extrause1(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.extrause1(
+; CHECK-LABEL: define {{[^@]+}}@andcond.extrause1(
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[INNER_COND:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: call void @use.i8(i8 [[TMP1]])
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i8 [[OUTER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_TRUEVAL]]
@@ -75,7 +75,7 @@ define i8 @andcond.extrause1(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval
ret i8 %outer.sel
}
define i8 @orcond.extrause1(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.extrause1(
+; CHECK-LABEL: define {{[^@]+}}@orcond.extrause1(
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[INNER_COND:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: call void @use.i8(i8 [[TMP1]])
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i8 [[INNER_SEL_FALSEVAL]], i8 [[OUTER_SEL_FALSEVAL:%.*]]
@@ -90,7 +90,7 @@ define i8 @orcond.extrause1(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval,
}
define i8 @andcond.extrause2(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.extrause2(
+; CHECK-LABEL: define {{[^@]+}}@andcond.extrause2(
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[INNER_COND:%.*]], i1 [[ALT_COND:%.*]], i1 false
; CHECK-NEXT: call void @use.i1(i1 [[OUTER_COND]])
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_COND]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]]
@@ -106,7 +106,7 @@ define i8 @andcond.extrause2(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval
ret i8 %outer.sel
}
define i8 @orcond.extrause2(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.extrause2(
+; CHECK-LABEL: define {{[^@]+}}@orcond.extrause2(
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[INNER_COND:%.*]], i1 true, i1 [[ALT_COND:%.*]]
; CHECK-NEXT: call void @use.i1(i1 [[OUTER_COND]])
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_COND]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]]
@@ -125,7 +125,7 @@ define i8 @orcond.extrause2(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval,
; Mismatched 'common' cond
define i8 @andcond.
diff erent.inner.cond(i1 %inner.cond.v0, i1 %inner.cond.v1, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.
diff erent.inner.cond(
+; CHECK-LABEL: define {{[^@]+}}@andcond.
diff erent.inner.cond(
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[INNER_COND_V0:%.*]], i1 [[ALT_COND:%.*]], i1 false
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_COND_V1:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[OUTER_COND]], i8 [[OUTER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL]]
@@ -138,7 +138,7 @@ define i8 @andcond.
diff erent.inner.cond(i1 %inner.cond.v0, i1 %inner.cond.v1, i1
ret i8 %outer.sel
}
define i8 @orcond.
diff erent.inner.cond(i1 %inner.cond.v0, i1 %inner.cond.v1, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.
diff erent.inner.cond(
+; CHECK-LABEL: define {{[^@]+}}@orcond.
diff erent.inner.cond(
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[INNER_COND_V0:%.*]], i1 true, i1 [[ALT_COND:%.*]]
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_COND_V1:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[OUTER_COND]], i8 [[INNER_SEL]], i8 [[OUTER_SEL_FALSEVAL:%.*]]
@@ -151,7 +151,7 @@ define i8 @orcond.
diff erent.inner.cond(i1 %inner.cond.v0, i1 %inner.cond.v1, i1
}
define i1 @andcond.
diff erent.inner.cond.both.inverted(i1 %inner.cond.v0, i1 %inner.cond.v1, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.
diff erent.inner.cond.both.inverted(
+; CHECK-LABEL: define {{[^@]+}}@andcond.
diff erent.inner.cond.both.inverted(
; CHECK-NEXT: [[NOT_INNER_COND_0:%.*]] = xor i1 [[INNER_COND_V0:%.*]], true
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[NOT_INNER_COND_0]], i1 [[ALT_COND:%.*]], i1 false
; CHECK-NEXT: [[NOT_INNER_COND_1:%.*]] = xor i1 [[INNER_COND_V1:%.*]], true
@@ -167,7 +167,7 @@ define i1 @andcond.
diff erent.inner.cond.both.inverted(i1 %inner.cond.v0, i1 %inn
ret i1 %outer.sel
}
define i1 @orcond.
diff erent.inner.cond.both.inverted(i1 %inner.cond.v0, i1 %inner.cond.v1, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.
diff erent.inner.cond.both.inverted(
+; CHECK-LABEL: define {{[^@]+}}@orcond.
diff erent.inner.cond.both.inverted(
; CHECK-NEXT: [[NOT_INNER_COND_0:%.*]] = xor i1 [[INNER_COND_V0:%.*]], true
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[NOT_INNER_COND_0]], i1 true, i1 [[ALT_COND:%.*]]
; CHECK-NEXT: [[NOT_INNER_COND_1:%.*]] = xor i1 [[INNER_COND_V1:%.*]], true
@@ -184,7 +184,7 @@ define i1 @orcond.
diff erent.inner.cond.both.inverted(i1 %inner.cond.v0, i1 %inne
}
define i1 @andcond.
diff erent.inner.cond.inverted.in.outer.cond(i1 %inner.cond.v0, i1 %inner.cond.v1, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.
diff erent.inner.cond.inverted.in.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@andcond.
diff erent.inner.cond.inverted.in.outer.cond(
; CHECK-NEXT: [[NOT_INNER_COND_0:%.*]] = xor i1 [[INNER_COND_V0:%.*]], true
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[NOT_INNER_COND_0]], i1 [[ALT_COND:%.*]], i1 false
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_COND_V1:%.*]], i1 [[INNER_SEL_FALSEVAL:%.*]], i1 false
@@ -198,7 +198,7 @@ define i1 @andcond.
diff erent.inner.cond.inverted.in.outer.cond(i1 %inner.cond.v0
ret i1 %outer.sel
}
define i1 @orcond.
diff erent.inner.cond.inverted.in.outer.cond(i1 %inner.cond.v0, i1 %inner.cond.v1, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.
diff erent.inner.cond.inverted.in.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@orcond.
diff erent.inner.cond.inverted.in.outer.cond(
; CHECK-NEXT: [[NOT_INNER_COND_0:%.*]] = xor i1 [[INNER_COND_V0:%.*]], true
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[NOT_INNER_COND_0]], i1 true, i1 [[ALT_COND:%.*]]
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_COND_V1:%.*]], i1 true, i1 [[INNER_SEL_TRUEVAL:%.*]]
@@ -213,7 +213,7 @@ define i1 @orcond.
diff erent.inner.cond.inverted.in.outer.cond(i1 %inner.cond.v0,
}
define i1 @andcond.
diff erent.inner.cond.inverted.in.inner.sel(i1 %inner.cond.v0, i1 %inner.cond.v1, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.
diff erent.inner.cond.inverted.in.inner.sel(
+; CHECK-LABEL: define {{[^@]+}}@andcond.
diff erent.inner.cond.inverted.in.inner.sel(
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[INNER_COND_V0:%.*]], i1 [[ALT_COND:%.*]], i1 false
; CHECK-NEXT: [[NOT_INNER_COND_1:%.*]] = xor i1 [[INNER_COND_V1:%.*]], true
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[NOT_INNER_COND_1]], i1 [[INNER_SEL_FALSEVAL:%.*]], i1 false
@@ -227,7 +227,7 @@ define i1 @andcond.
diff erent.inner.cond.inverted.in.inner.sel(i1 %inner.cond.v0,
ret i1 %outer.sel
}
define i1 @orcond.
diff erent.inner.cond.inverted.in.inner.sel(i1 %inner.cond.v0, i1 %inner.cond.v1, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.
diff erent.inner.cond.inverted.in.inner.sel(
+; CHECK-LABEL: define {{[^@]+}}@orcond.
diff erent.inner.cond.inverted.in.inner.sel(
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[INNER_COND_V0:%.*]], i1 true, i1 [[ALT_COND:%.*]]
; CHECK-NEXT: [[NOT_INNER_COND_1:%.*]] = xor i1 [[INNER_COND_V1:%.*]], true
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[NOT_INNER_COND_1]], i1 true, i1 [[INNER_SEL_TRUEVAL:%.*]]
@@ -245,7 +245,7 @@ define i1 @orcond.
diff erent.inner.cond.inverted.in.inner.sel(i1 %inner.cond.v0,
; In %outer.sel, %outer.cond is inverted
define i1 @andcond.001.inv.outer.cond(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.001.inv.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@andcond.001.inv.outer.cond(
; CHECK-NEXT: [[NOT_ALT_COND:%.*]] = xor i1 [[ALT_COND:%.*]], true
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[NOT_ALT_COND]], i1 [[INNER_SEL_TRUEVAL:%.*]], i1 false
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[INNER_COND:%.*]], i1 [[INNER_SEL]], i1 [[INNER_SEL_FALSEVAL:%.*]]
@@ -258,7 +258,7 @@ define i1 @andcond.001.inv.outer.cond(i1 %inner.cond, i1 %alt.cond, i1 %inner.se
ret i1 %outer.sel
}
define i1 @orcond.001.inv.outer.cond(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.001.inv.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@orcond.001.inv.outer.cond(
; CHECK-NEXT: [[NOT_ALT_COND:%.*]] = xor i1 [[ALT_COND:%.*]], true
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[NOT_ALT_COND]], i1 true, i1 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[INNER_COND:%.*]], i1 [[INNER_SEL_TRUEVAL:%.*]], i1 [[INNER_SEL]]
@@ -273,7 +273,7 @@ define i1 @orcond.001.inv.outer.cond(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel
; In %inner.sel, %inner.cond is inverted
define i1 @andcond.010.inv.inner.cond.in.inner.sel(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.010.inv.inner.cond.in.inner.sel(
+; CHECK-LABEL: define {{[^@]+}}@andcond.010.inv.inner.cond.in.inner.sel(
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i1 [[OUTER_SEL_TRUEVAL:%.*]], i1 false
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[INNER_COND:%.*]], i1 [[INNER_SEL]], i1 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: ret i1 [[OUTER_SEL]]
@@ -285,7 +285,7 @@ define i1 @andcond.010.inv.inner.cond.in.inner.sel(i1 %inner.cond, i1 %alt.cond,
ret i1 %outer.sel
}
define i1 @orcond.010.inv.inner.cond.in.inner.sel(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.010.inv.inner.cond.in.inner.sel(
+; CHECK-LABEL: define {{[^@]+}}@orcond.010.inv.inner.cond.in.inner.sel(
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i1 true, i1 [[OUTER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[INNER_COND:%.*]], i1 [[INNER_SEL_TRUEVAL:%.*]], i1 [[INNER_SEL]]
; CHECK-NEXT: ret i1 [[OUTER_SEL]]
@@ -299,7 +299,7 @@ define i1 @orcond.010.inv.inner.cond.in.inner.sel(i1 %inner.cond, i1 %alt.cond,
; In %outer.cond, %inner.cond is inverted
define i8 @andcond.100.inv.inner.cond.in.outer.cond(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.100.inv.inner.cond.in.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@andcond.100.inv.inner.cond.in.outer.cond(
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i8 [[OUTER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[INNER_COND:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[INNER_SEL]]
; CHECK-NEXT: ret i8 [[OUTER_SEL]]
@@ -311,7 +311,7 @@ define i8 @andcond.100.inv.inner.cond.in.outer.cond(i1 %inner.cond, i1 %alt.cond
ret i8 %outer.sel
}
define i8 @orcond.100.inv.inner.cond.in.outer.cond(i1 %inner.cond, i1 %alt.cond, i8 %inner.sel.trueval, i8 %inner.sel.falseval, i8 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.100.inv.inner.cond.in.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@orcond.100.inv.inner.cond.in.outer.cond(
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i8 [[INNER_SEL_TRUEVAL:%.*]], i8 [[OUTER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[INNER_COND:%.*]], i8 [[INNER_SEL]], i8 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: ret i8 [[OUTER_SEL]]
@@ -326,7 +326,7 @@ define i8 @orcond.100.inv.inner.cond.in.outer.cond(i1 %inner.cond, i1 %alt.cond,
; In %outer.sel, %outer.cond is inverted
; In %inner.sel, %inner.cond is inverted
define i1 @andcond.011.inv.outer.cond.inv.inner.cond.in.inner.sel(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.011.inv.outer.cond.inv.inner.cond.in.inner.sel(
+; CHECK-LABEL: define {{[^@]+}}@andcond.011.inv.outer.cond.inv.inner.cond.in.inner.sel(
; CHECK-NEXT: [[NOT_INNER_COND:%.*]] = xor i1 [[INNER_COND:%.*]], true
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[NOT_INNER_COND]], i1 true, i1 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: call void @use.i1(i1 [[TMP1]])
@@ -345,7 +345,7 @@ define i1 @andcond.011.inv.outer.cond.inv.inner.cond.in.inner.sel(i1 %inner.cond
ret i1 %outer.sel
}
define i1 @orcond.011.inv.outer.cond.inv.inner.cond.in.inner.sel(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.011.inv.outer.cond.inv.inner.cond.in.inner.sel(
+; CHECK-LABEL: define {{[^@]+}}@orcond.011.inv.outer.cond.inv.inner.cond.in.inner.sel(
; CHECK-NEXT: [[NOT_INNER_COND:%.*]] = xor i1 [[INNER_COND:%.*]], true
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[NOT_INNER_COND]], i1 [[INNER_SEL_TRUEVAL:%.*]], i1 false
; CHECK-NEXT: call void @use.i1(i1 [[TMP1]])
@@ -367,7 +367,7 @@ define i1 @orcond.011.inv.outer.cond.inv.inner.cond.in.inner.sel(i1 %inner.cond,
; In %outer.sel, %outer.cond is inverted
; In %outer.cond, %inner.cond is inverted
define i1 @andcond.101.inv.outer.cond.inv.inner.cond.in.outer.cond(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.101.inv.outer.cond.inv.inner.cond.in.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@andcond.101.inv.outer.cond.inv.inner.cond.in.outer.cond(
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[INNER_COND:%.*]], i1 [[INNER_SEL_TRUEVAL:%.*]], i1 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: call void @use.i1(i1 [[TMP1]])
; CHECK-NEXT: [[ALT_COND_NOT:%.*]] = xor i1 [[ALT_COND:%.*]], true
@@ -384,7 +384,7 @@ define i1 @andcond.101.inv.outer.cond.inv.inner.cond.in.outer.cond(i1 %inner.con
ret i1 %outer.sel
}
define i1 @orcond.101.inv.outer.cond.inv.inner.cond.in.outer.cond(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.101.inv.outer.cond.inv.inner.cond.in.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@orcond.101.inv.outer.cond.inv.inner.cond.in.outer.cond(
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[INNER_COND:%.*]], i1 [[INNER_SEL_TRUEVAL:%.*]], i1 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: call void @use.i1(i1 [[TMP1]])
; CHECK-NEXT: [[ALT_COND_NOT:%.*]] = xor i1 [[ALT_COND:%.*]], true
@@ -404,7 +404,7 @@ define i1 @orcond.101.inv.outer.cond.inv.inner.cond.in.outer.cond(i1 %inner.cond
; In %inner.sel, %inner.cond is inverted
; In %outer.cond, %inner.cond is inverted
define i1 @andcond.110.inv.inner.cond.in.inner.sel.inv.inner.cond.in.outer.cond(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.110.inv.inner.cond.in.inner.sel.inv.inner.cond.in.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@andcond.110.inv.inner.cond.in.inner.sel.inv.inner.cond.in.outer.cond(
; CHECK-NEXT: [[NOT_INNER_COND_0:%.*]] = xor i1 [[INNER_COND:%.*]], true
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i1 [[OUTER_SEL_TRUEVAL:%.*]], i1 [[INNER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[NOT_INNER_COND_0]], i1 [[INNER_SEL]], i1 false
@@ -418,7 +418,7 @@ define i1 @andcond.110.inv.inner.cond.in.inner.sel.inv.inner.cond.in.outer.cond(
ret i1 %outer.sel
}
define i1 @orcond.110.inv.inner.cond.in.inner.sel.inv.inner.cond.in.outer.cond(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.110.inv.inner.cond.in.inner.sel.inv.inner.cond.in.outer.cond(
+; CHECK-LABEL: define {{[^@]+}}@orcond.110.inv.inner.cond.in.inner.sel.inv.inner.cond.in.outer.cond(
; CHECK-NEXT: [[NOT_INNER_COND_0:%.*]] = xor i1 [[INNER_COND:%.*]], true
; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[ALT_COND:%.*]], i1 [[INNER_SEL_TRUEVAL:%.*]], i1 [[OUTER_SEL_FALSEVAL:%.*]]
; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[NOT_INNER_COND_0]], i1 true, i1 [[INNER_SEL]]
@@ -436,15 +436,16 @@ define i1 @orcond.110.inv.inner.cond.in.inner.sel.inv.inner.cond.in.outer.cond(i
; In %inner.sel, %inner.cond is inverted
; In %outer.cond, %inner.cond is inverted
define i1 @andcond.111.inv.all.conds(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.trueval) {
-; CHECK-LABEL: @andcond.111.inv.all.conds(
+; CHECK-LABEL: define {{[^@]+}}@andcond.111.inv.all.conds(
; CHECK-NEXT: [[NOT_INNER_COND_0:%.*]] = xor i1 [[INNER_COND:%.*]], true
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[NOT_INNER_COND_0]], i1 [[ALT_COND:%.*]], i1 false
; CHECK-NEXT: call void @use.i1(i1 [[OUTER_COND]])
; CHECK-NEXT: [[NOT_INNER_COND_1:%.*]] = xor i1 [[INNER_COND]], true
-; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[NOT_INNER_COND_1]], i1 [[INNER_SEL_FALSEVAL:%.*]], i1 false
-; CHECK-NEXT: call void @use.i1(i1 [[INNER_SEL]])
-; CHECK-NEXT: [[NOT_OUTER_COND:%.*]] = xor i1 [[OUTER_COND]], true
-; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[NOT_OUTER_COND]], i1 [[INNER_SEL]], i1 false
+; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[NOT_INNER_COND_1]], i1 [[INNER_SEL_FALSEVAL:%.*]], i1 false
+; CHECK-NEXT: call void @use.i1(i1 [[TMP1]])
+; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[INNER_COND]], i1 true, i1 [[ALT_COND]]
+; CHECK-NEXT: [[TMP3:%.*]] = xor i1 [[TMP2]], true
+; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[TMP3]], i1 [[INNER_SEL_FALSEVAL]], i1 false
; CHECK-NEXT: ret i1 [[OUTER_SEL]]
;
%not.inner.cond.0 = xor i1 %inner.cond, -1
@@ -458,15 +459,16 @@ define i1 @andcond.111.inv.all.conds(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel
ret i1 %outer.sel
}
define i1 @orcond.111.inv.all.conds(i1 %inner.cond, i1 %alt.cond, i1 %inner.sel.trueval, i1 %inner.sel.falseval, i1 %outer.sel.falseval) {
-; CHECK-LABEL: @orcond.111.inv.all.conds(
+; CHECK-LABEL: define {{[^@]+}}@orcond.111.inv.all.conds(
; CHECK-NEXT: [[NOT_INNER_COND_0:%.*]] = xor i1 [[INNER_COND:%.*]], true
; CHECK-NEXT: [[OUTER_COND:%.*]] = select i1 [[NOT_INNER_COND_0]], i1 true, i1 [[ALT_COND:%.*]]
; CHECK-NEXT: call void @use.i1(i1 [[OUTER_COND]])
; CHECK-NEXT: [[NOT_INNER_COND_1:%.*]] = xor i1 [[INNER_COND]], true
-; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[NOT_INNER_COND_1]], i1 true, i1 [[INNER_SEL_TRUEVAL:%.*]]
-; CHECK-NEXT: call void @use.i1(i1 [[INNER_SEL]])
-; CHECK-NEXT: [[NOT_OUTER_COND:%.*]] = xor i1 [[OUTER_COND]], true
-; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[NOT_OUTER_COND]], i1 true, i1 [[INNER_SEL]]
+; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[NOT_INNER_COND_1]], i1 true, i1 [[INNER_SEL_TRUEVAL:%.*]]
+; CHECK-NEXT: call void @use.i1(i1 [[TMP1]])
+; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[INNER_COND]], i1 [[ALT_COND]], i1 false
+; CHECK-NEXT: [[TMP3:%.*]] = xor i1 [[TMP2]], true
+; CHECK-NEXT: [[OUTER_SEL:%.*]] = select i1 [[TMP3]], i1 true, i1 [[INNER_SEL_TRUEVAL]]
; CHECK-NEXT: ret i1 [[OUTER_SEL]]
;
%not.inner.cond.0 = xor i1 %inner.cond, -1
More information about the llvm-commits
mailing list