We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2381d39 + 14d9b05 commit 02dd40fCopy full SHA for 02dd40f
lib/SILOptimizer/Utils/ConstExpr.cpp
@@ -1785,8 +1785,8 @@ ConstExprFunctionState::evaluateInstructionAndGetNext(
1785
// Set up basic block arguments.
1786
for (unsigned i = 0, e = br->getNumArgs(); i != e; ++i) {
1787
auto argument = getConstantValue(br->getArg(i));
1788
- if (!argument.isConstant())
1789
- return {std::nullopt, argument};
+ // Do not fail if an argument is not constant because we still know enough to know what the next instruction will be.
+ // Failure may occur later, however, if/when this unknown argument value is used by an instruction in the target basic block.
1790
setValue(destBB->getArgument(i), argument);
1791
}
1792
// Set the instruction pointer to the first instruction of the block.
0 commit comments