[llvm] [StructurizeCFG] Order IF Else block using Heuristics (PR #139605)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 12:03:51 PDT 2025


================
@@ -409,6 +411,31 @@ class StructurizeCFGLegacyPass : public RegionPass {
 
 } // end anonymous namespace
 
+/// Helper function for heuristics to order if else block
+/// Checks whether an instruction is potential vector copy instruction, if so,
+/// checks if the operands are from different BB. if so, returns True.
+// Then there's a possibility of coelescing without interference when ordered
+// first.
+static bool hasAffectingInstructions(Instruction *I, BasicBlock *BB) {
+
+  if (!I || I->getParent() != BB)
----------------
arsenm wrote:

```suggestion
  if (I->getParent() != BB)
```
I should be a reference 

https://github.com/llvm/llvm-project/pull/139605


More information about the llvm-commits mailing list