[llvm] [GlobalISel] Fix dangling reference in CombinerHelper::matchCombineExtractedVectorLoad (PR #134363)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 03:48:28 PDT 2025


https://github.com/KRM7 created https://github.com/llvm/llvm-project/pull/134363

The `LegalityQuery` object contains references to the temporary objects `{VecEltTy, PtrTy}` and `{MMDesc}`.

>From f85e2e539b35a956cee479c1199296ac59dbf9e8 Mon Sep 17 00:00:00 2001
From: Krisztian Rugasi <Krisztian.Rugasi at hightec-rt.com>
Date: Fri, 4 Apr 2025 12:35:34 +0200
Subject: [PATCH] [GlobalISel] Fix dangling reference in
 CombinerHelper::matchCombineExtractedVectorLoad

---
 llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
index bab0c1596ca40..fed1dc53f9bb8 100644
--- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
@@ -1411,9 +1411,8 @@ bool CombinerHelper::matchCombineExtractedVectorLoad(
 
   LegalityQuery::MemDesc MMDesc(*NewMMO);
 
-  LegalityQuery Q = {TargetOpcode::G_LOAD, {VecEltTy, PtrTy}, {MMDesc}};
-
-  if (!isLegalOrBeforeLegalizer(Q))
+  if (!isLegalOrBeforeLegalizer(
+          {TargetOpcode::G_LOAD, {VecEltTy, PtrTy}, {MMDesc}}))
     return false;
 
   // Load must be allowed and fast on the target.



More information about the llvm-commits mailing list