aboutsummaryrefslogtreecommitdiff
path: root/source/opt/ccp_pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/opt/ccp_pass.cpp')
-rw-r--r--source/opt/ccp_pass.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/opt/ccp_pass.cpp b/source/opt/ccp_pass.cpp
index 5099b477..5f855027 100644
--- a/source/opt/ccp_pass.cpp
+++ b/source/opt/ccp_pass.cpp
@@ -172,7 +172,8 @@ SSAPropagator::PropStatus CCPPass::VisitAssignment(Instruction* instr) {
if (folded_inst != nullptr) {
// We do not want to change the body of the function by adding new
// instructions. When folding we can only generate new constants.
- assert(folded_inst->IsConstant() &&
+ assert((folded_inst->IsConstant() ||
+ IsSpecConstantInst(folded_inst->opcode())) &&
"CCP is only interested in constant values.");
uint32_t new_val = ComputeLatticeMeet(instr, folded_inst->result_id());
values_[instr->result_id()] = new_val;