[llvm] [IA]: Construct (de)interleave4 out of (de)interleave2 (PR #89276)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 06:50:34 PDT 2024


================
@@ -17137,6 +17131,11 @@ bool getValuesToInterleave(Value *II,
     ValuesToInterleave.push_back(B);
     ValuesToInterleave.push_back(C);
     ValuesToInterleave.push_back(D);
+    // intermediate II will not be needed anymore
+    Value *II1, *II2;
+    assert(match(II, m_Interleave2(m_Value(II1), m_Value(II2))) && "II tree is expected");
+    DeadInsts.push_back(cast<Instruction>(II1));
+    DeadInsts.push_back(cast<Instruction>(II2));
----------------
paulwalker-arm wrote:

Here `II1` and `II2` will only be populated when asserts are enabled, which means a release build will use uninitialised variables. Given you only get here when the main `match` statement passes you can safely omit the assert and use `II->getOperand(#)` directly.

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


More information about the llvm-commits mailing list