Skip to content

[CodeGen] Enable HandleUnknown for pointer types #93464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jplehr
Copy link
Contributor

@jplehr jplehr commented May 27, 2024

This is a temporary workaround for the build issues we are observing after #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.

This is a temporary workaround for the build issues we are observing
after llvm#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.
@jplehr jplehr requested review from arsenm and jrtc27 May 27, 2024 12:30
@llvmbot
Copy link
Member

llvmbot commented May 27, 2024

@llvm/pr-subscribers-backend-x86

Author: Jan Patrick Lehr (jplehr)

Changes

This is a temporary workaround for the build issues we are observing after #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.


Full diff: https://github.com/llvm/llvm-project/pull/93464.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86TargetTransformInfo.cpp (+3-1)
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) {

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 7a28a5b3fee6c78ad59af79a3d03c00db153c49f 3fdfc1b1111bf1eafcbbad65d4c205a4fd1a9c22 -- llvm/lib/Target/X86/X86TargetTransformInfo.cpp
View the diff from clang-format here.
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index e0a43fb0fb..bc1ce1ac90 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -6259,7 +6259,8 @@ InstructionCost X86TTIImpl::getInterleavedMemoryOpCostAVX512(
   unsigned VF = VecTy->getNumElements() / Factor;
   // FIXME: Handle this case correctly
   bool IgnorePtrTy = VecTy->getScalarType()->isPointerTy();
-  MVT VT = MVT::getVectorVT(MVT::getVT(VecTy->getScalarType(), IgnorePtrTy), VF);
+  MVT VT =
+      MVT::getVectorVT(MVT::getVT(VecTy->getScalarType(), IgnorePtrTy), VF);
 
   InstructionCost MaskCost;
   if (UseMaskedMemOp) {

@jplehr jplehr closed this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants