[llvm] [CodeGen] Enable `HandleUnknown` for pointer types (PR #93464)

Jan Patrick Lehr via llvm-commits llvm-commits at lists.llvm.org
Mon May 27 05:30:25 PDT 2024


https://github.com/jplehr created https://github.com/llvm/llvm-project/pull/93464

This is a temporary workaround for the build issues we are observing after https://github.com/llvm/llvm-project/pull/92671. It re-enables the handling of pointer types by simply passing the HandleUnknown flag to getVT set to true whenever a PointerTy is encountered.

I don't know if this is acceptable, or preferred over a revert of the referenced patch.

>From 3fdfc1b1111bf1eafcbbad65d4c205a4fd1a9c22 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Mon, 27 May 2024 06:27:13 -0500
Subject: [PATCH] [CodeGen] Enable `HandleUnknown` for pointer types

This is a temporary workaround for the build issues we are observing
after https://github.com/llvm/llvm-project/pull/92671.
It re-enables the handling of pointer types by simply passing the
HandleUnknown flag to getVT set to true whenever a PointerTy is
encountered.
---
 llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index ac66144aeaaec..e0a43fb0fb75f 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -6257,7 +6257,9 @@ InstructionCost X86TTIImpl::getInterleavedMemoryOpCostAVX512(
                                 AddressSpace, CostKind);
 
   unsigned VF = VecTy->getNumElements() / Factor;
-  MVT VT = MVT::getVectorVT(MVT::getVT(VecTy->getScalarType()), VF);
+  // FIXME: Handle this case correctly
+  bool IgnorePtrTy = VecTy->getScalarType()->isPointerTy();
+  MVT VT = MVT::getVectorVT(MVT::getVT(VecTy->getScalarType(), IgnorePtrTy), VF);
 
   InstructionCost MaskCost;
   if (UseMaskedMemOp) {



More information about the llvm-commits mailing list