[llvm] [X86][AMX] Avoid to construct invalid shape for checking, NFCI (PR #105973)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 24 21:29:27 PDT 2024


https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/105973

None

>From 8270ae0897e0fefdbdb0c5282b37af40a140939f Mon Sep 17 00:00:00 2001
From: "Wang, Phoebe" <phoebe.wang at intel.com>
Date: Sun, 25 Aug 2024 11:25:27 +0800
Subject: [PATCH] [X86][AMX] Avoid to construct invalid shape for checking,
 NFCI

---
 llvm/include/llvm/CodeGen/VirtRegMap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/CodeGen/VirtRegMap.h b/llvm/include/llvm/CodeGen/VirtRegMap.h
index 42e8d294a637ad..864eb23e133ebd 100644
--- a/llvm/include/llvm/CodeGen/VirtRegMap.h
+++ b/llvm/include/llvm/CodeGen/VirtRegMap.h
@@ -114,7 +114,7 @@ class TargetInstrInfo;
     bool isShapeMapEmpty() const { return Virt2ShapeMap.empty(); }
 
     bool hasShape(Register virtReg) const {
-      return getShape(virtReg).isValid();
+      return Virt2ShapeMap.contains(virtReg);
     }
 
     ShapeT getShape(Register virtReg) const {



More information about the llvm-commits mailing list