[PATCH] D32482: [EarlyCSE] Mark the condition of assume intrinsic as true
Sanjoy Das via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 25 11:20:14 PDT 2017
sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.
lgtm
================
Comment at: lib/Transforms/Scalar/EarlyCSE.cpp:638
// they're marked as such to ensure preservation of control dependencies),
- // and this pass will not disturb any of the assumption's control
- // dependencies.
+ // and this pass will not bother with its removal. However, we should mark
+ // its condition as true for all dominated blocks.
----------------
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()));
```
https://reviews.llvm.org/D32482
More information about the llvm-commits
mailing list