[llvm] 510a2bb - [IR] Allow matching pointer to vector with opaque pointers.

Hendrik Greving via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 09:34:59 PDT 2022


Author: Hendrik Greving
Date: 2022-03-22T09:34:48-07:00
New Revision: 510a2bbda4edd67e95d8797e748357fc9ceee484

URL: https://github.com/llvm/llvm-project/commit/510a2bbda4edd67e95d8797e748357fc9ceee484
DIFF: https://github.com/llvm/llvm-project/commit/510a2bbda4edd67e95d8797e748357fc9ceee484.diff

LOG: [IR] Allow matching pointer to vector with opaque pointers.

Allows for skipping the pointer to vector type if opaque pointers
are enabled and the matching pointer is a vector pointer when
matching an intrinsic signature in the verifier.

No test added since lacking a target using intrinsic with pointer
to vector arguments.

Differential Revision: https://reviews.llvm.org/D122203

Added: 
    

Modified: 
    llvm/lib/IR/Function.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index fa0fd5ead2b42..fcc0ef0459d02 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -1468,7 +1468,11 @@ static bool matchIntrinsicType(
         return matchIntrinsicType(PT->getNonOpaquePointerElementType(), Infos,
                                   ArgTys, DeferredChecks, IsDeferredCheck);
       // Consume IIT descriptors relating to the pointer element type.
-      while (Infos.front().Kind == IITDescriptor::Pointer)
+      // FIXME: Intrinsic type matching of nested single value types or even
+      // aggregates doesn't work properly with opaque pointers but hopefully
+      // doesn't happen in practice.
+      while (Infos.front().Kind == IITDescriptor::Pointer ||
+             Infos.front().Kind == IITDescriptor::Vector)
         Infos = Infos.slice(1);
       Infos = Infos.slice(1);
       return false;


        


More information about the llvm-commits mailing list