[JumpThread] Do RAUW in case Cond folds to a constant in the CFG
Details
Details
Diff Detail
Diff Detail
- Build Status
Buildable 5789 Build 5789: arc lint + arc unit
Event Timeline
Comment Actions
lgtm with nits
| lib/Transforms/Scalar/JumpThreading.cpp | ||
|---|---|---|
| 1252–1254 | Separately, it may be better to use DenseMapInfo<BasicBlock *>::getTombStoneKey() here. | |
| 1317 | I'd structure this as: if (auto *CondInst = dyn_cast<Instruction>(Cond)) {
if (CondInst->use_empty()) {
} else if (OnlyVal && ...) {
}
}Another thing is that this code needs to check !CondInst->mayHaveSideEffects() before removing it. | |
| test/Transforms/JumpThreading/fold-not-thread.ll | ||
| 142 | Please also add a negative test where %add = add i32 %value, 64 is not in L0. | |
| lib/Transforms/Scalar/JumpThreading.cpp | ||
|---|---|---|
| 1317 | Good catch with the extra check ! | |
Separately, it may be better to use DenseMapInfo<BasicBlock *>::getTombStoneKey() here.