diff options
author | Florian Hahn <flo@fhahn.com> | 2020-10-30 21:20:28 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2020-10-30 21:26:14 +0000 |
commit | a1b53db32418cb6ed6f5b2054d15a22b5aa3aeb9 (patch) | |
tree | 9c7d377ab03e6e3a812e1a0ca56deab4222570de /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 408c4408facc3a79ee4ff7e9983cc972f797e176 (diff) | |
download | llvm-a1b53db32418cb6ed6f5b2054d15a22b5aa3aeb9.zip llvm-a1b53db32418cb6ed6f5b2054d15a22b5aa3aeb9.tar.gz llvm-a1b53db32418cb6ed6f5b2054d15a22b5aa3aeb9.tar.bz2 |
Revert "[SLP] Consider alternatives for cost of select instructions."
This reverts commit 19225704890632cd2552f41ada41600a20db1371.
This appears to cause a crash in the following example
a, b, c;
l() {
int e = a, f = l, g, h, i, j;
float *d = c, *k = b;
for (;;)
for (; g < f; g++) {
k[h] = d[i];
k[h - 1] = d[j];
h += e << 1;
i += e;
}
}
clang -cc1 -triple i386-unknown-linux-gnu -emit-obj -target-cpu pentium-m -O1 -vectorize-loops -vectorize-slp reduced.c
llvm::Type *llvm::Type::getWithNewBitWidth(unsigned int) const: Assertion `isIntOrIntVectorTy() && "Original type expected to be a vector of integers or a scalar integer."' failed.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index ca4bb75..05eb2fc 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -5991,45 +5991,6 @@ CmpInst::Predicate llvm::getInverseMinMaxPred(SelectPatternFlavor SPF) { return getMinMaxPred(getInverseMinMaxFlavor(SPF)); } -std::pair<Intrinsic::ID, bool> -llvm::canConvertToMinOrMaxIntrinsic(ArrayRef<Value *> VL) { - // Check if VL contains select instructions that can be folded into a min/max - // vector intrinsic and return the intrinsic if it is possible. - // TODO: Support floating point min/max. - bool AllCmpSingleUse = true; - SelectPatternResult SelectPattern; - SelectPattern.Flavor = SPF_UNKNOWN; - if (all_of(VL, [&SelectPattern, &AllCmpSingleUse](Value *I) { - Value *LHS, *RHS; - auto CurrentPattern = matchSelectPattern(I, LHS, RHS); - if (!SelectPatternResult::isMinOrMax(CurrentPattern.Flavor) || - CurrentPattern.Flavor == SPF_FMINNUM || - CurrentPattern.Flavor == SPF_FMAXNUM) - return false; - if (SelectPattern.Flavor != SPF_UNKNOWN && - SelectPattern.Flavor != CurrentPattern.Flavor) - return false; - SelectPattern = CurrentPattern; - AllCmpSingleUse &= - match(I, m_Select(m_OneUse(m_Value()), m_Value(), m_Value())); - return true; - })) { - switch (SelectPattern.Flavor) { - case SPF_SMIN: - return {Intrinsic::smin, AllCmpSingleUse}; - case SPF_UMIN: - return {Intrinsic::umin, AllCmpSingleUse}; - case SPF_SMAX: - return {Intrinsic::smax, AllCmpSingleUse}; - case SPF_UMAX: - return {Intrinsic::umax, AllCmpSingleUse}; - default: - llvm_unreachable("unexpected select pattern flavor"); - } - } - return {Intrinsic::not_intrinsic, false}; -} - /// Return true if "icmp Pred LHS RHS" is always true. static bool isTruePredicate(CmpInst::Predicate Pred, const Value *LHS, const Value *RHS, const DataLayout &DL, |