[llvm] b0c9a71 - [VPlan] Handle VPInst without underlying instr in VPInterleavedAccess.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 13:01:03 PDT 2022


Author: Florian Hahn
Date: 2022-06-07T21:00:49+01:00
New Revision: b0c9a71be017594b9376f1bdaa01a8f7e18f83ef

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

LOG: [VPlan] Handle VPInst without underlying instr in VPInterleavedAccess.

This violation is hidden while `cast` is missing an isa assertion after
D123901.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 0f15b9949239d..1b77b7419dcb5 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -1739,7 +1739,10 @@ void VPInterleavedAccessInfo::visitBlock(VPBlockBase *Block, Old2NewTy &Old2New,
         continue;
       assert(isa<VPInstruction>(&VPI) && "Can only handle VPInstructions");
       auto *VPInst = cast<VPInstruction>(&VPI);
-      auto *Inst = cast<Instruction>(VPInst->getUnderlyingValue());
+
+      auto *Inst = dyn_cast_or_null<Instruction>(VPInst->getUnderlyingValue());
+      if (!Inst)
+        continue;
       auto *IG = IAI.getInterleaveGroup(Inst);
       if (!IG)
         continue;


        


More information about the llvm-commits mailing list