[PATCH] D67203: [IfConversion] Fix diamond conversion with unanalyzable branches.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 12:44:58 PDT 2019


efriedma marked an inline comment as done.
efriedma added inline comments.


================
Comment at: llvm/trunk/lib/CodeGen/IfConversion.cpp:1764
   DI1 = MBB1.end();
+  while (DI1 != MBB1.begin()) {
+    MachineBasicBlock::iterator Prev = std::prev(DI1);
----------------
hans wrote:
> The previous code also decremented BBI1->NonPredSize. Do we not need to do that anymore?
> 
> (I don't know this code, just driving by.)
In theory, we probably should decrement NonPredSize, for both this loop and the following loop, to account for the instructions we're erasing.

We only use the NonPredSize as input to the if-conversion heuristics, though.  It's unlikely we're going to predicate a basic block that's already predicated.  So whatever we do probably has very little, if any, effect.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67203/new/

https://reviews.llvm.org/D67203





More information about the llvm-commits mailing list