[PATCH] D79416: [SVE] Fix wrong usage of getNumElements() in matchIntrinsicType

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 01:34:55 PDT 2020


david-arm updated this revision to Diff 262310.
david-arm edited the summary of this revision.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79416/new/

https://reviews.llvm.org/D79416

Files:
  llvm/lib/IR/Function.cpp


Index: llvm/lib/IR/Function.cpp
===================================================================
--- llvm/lib/IR/Function.cpp
+++ llvm/lib/IR/Function.cpp
@@ -1180,7 +1180,7 @@
     case IITDescriptor::Quad: return !Ty->isFP128Ty();
     case IITDescriptor::Integer: return !Ty->isIntegerTy(D.Integer_Width);
     case IITDescriptor::Vector: {
-      VectorType *VT = dyn_cast<VectorType>(Ty);
+      FixedVectorType *VT = dyn_cast<FixedVectorType>(Ty);
       return !VT || VT->getNumElements() != D.Vector_Width ||
              matchIntrinsicType(VT->getElementType(), Infos, ArgTys,
                                 DeferredChecks, IsDeferredCheck);
@@ -1357,7 +1357,11 @@
     case IITDescriptor::ScalableVecArgument: {
       if (!isa<ScalableVectorType>(Ty))
         return true;
-      return matchIntrinsicType(Ty, Infos, ArgTys, DeferredChecks,
+      ScalableVectorType *STy = cast<ScalableVectorType>(Ty);
+      unsigned MinElts = STy->getElementCount().Min;
+      FixedVectorType *FVTy =
+          FixedVectorType::get(STy->getElementType(), MinElts);
+      return matchIntrinsicType(FVTy, Infos, ArgTys, DeferredChecks,
                                 IsDeferredCheck);
     }
     case IITDescriptor::VecOfBitcastsToInt: {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79416.262310.patch
Type: text/x-patch
Size: 1247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200506/af6392c3/attachment.bin>


More information about the llvm-commits mailing list