EarlyCSE should not just ignore assumes. It should use the fact that its condition is true for all dominated instructions.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
lgtm
lib/Transforms/Scalar/EarlyCSE.cpp | ||
---|---|---|
638–639 | I think you can do: Instruction *CondI; if (match(Inst, m_Intrinsic<Intrinsic::assume>(m_Instruction(CondI))) && SimpleValue::canHandle(CondI)) AvailableValues.insert(CondI, ConstantInt::getTrue(BB->getContext())); |
Comment Actions
LGTM
I think we should constant fold the condition as well as infer it, but that can be a separate patch.
I think you can do: