[llvm] [VPlan] Fix broadcasted values using loop region during execution (PR #142594)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 11 06:55:53 PDT 2025


================
@@ -290,18 +290,22 @@ Value *VPTransformState::get(const VPValue *Def, bool NeedsScalar) {
     return Data.VPV2Vector[Def];
 
   auto GetBroadcastInstrs = [this, Def](Value *V) {
+    VPBasicBlock *PreheaderVPBB = nullptr;
+    if (auto *Header = vputils::getFirstLoopHeader(*Plan, VPDT))
----------------
david-arm wrote:

Ah thanks for explaining! In that case, is it worth asserting `assert(!getVectorLoopRegion() && ...)` at the start of `GetBroadcastInstrs`?

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


More information about the llvm-commits mailing list