Skip to content

Commit bfaacf7

Browse files
committed
Make isSafeToSpeculativelyExecute assertion a isSpeculatable check
1 parent 7bcb1c9 commit bfaacf7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,12 +1401,10 @@ static Instruction *factorizeMinMaxTree(IntrinsicInst *II) {
14011401
/// try to shuffle after the intrinsic.
14021402
Instruction *
14031403
InstCombinerImpl::foldShuffledIntrinsicOperands(IntrinsicInst *II) {
1404-
if (!isTriviallyVectorizable(II->getIntrinsicID()))
1404+
if (!isTriviallyVectorizable(II->getIntrinsicID()) ||
1405+
!II->getCalledFunction()->isSpeculatable())
14051406
return nullptr;
14061407

1407-
assert(isSafeToSpeculativelyExecute(II) &&
1408-
"Trivially vectorizable but not safe to speculatively execute?");
1409-
14101408
// fabs is canonicalized to fabs (shuffle ...) in foldShuffleOfUnaryOps, so
14111409
// avoid undoing it.
14121410
if (match(II, m_FAbs(m_Value())))

0 commit comments

Comments
 (0)