[PATCH] D54021: [LoopSimplifyCFG] Teach LoopSimplifyCFG to constant-fold branches and switches

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 5 09:17:12 PST 2018


anna added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopSimplifyCFG.cpp:248
+      for (auto *DeadSucc : DeadSuccessors)
+        DTU.deleteEdge(BB, DeadSucc);
+
----------------
reames wrote:
> Where's the code for LI updating?
>From the summary of this patch, it looks like we don't need LI update in this patch:
```
Only the simplest case supported in this patch: after the folding, no block
should become dead or stop being part of the loop. Support for more
sophisticated cases will go separately in follow-up patches.
```

If that's the case, I'd really like an assert to make sure that the LI is still correct after this transform is completed. 

I'll review the code to see if what's stated here is actually true (for example, we have a number of prechecks before performing the actual transform). See `run` function below.




https://reviews.llvm.org/D54021





More information about the llvm-commits mailing list