File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -397,17 +397,14 @@ bool VPBlockUtils::isLatch(const VPBlockBase *VPB,
397397
398398std::optional<MemoryLocation>
399399vputils::getMemoryLocation (const VPRecipeBase &R) {
400- return TypeSwitch<const VPRecipeBase *, std::optional<MemoryLocation>>(&R)
401- .Case <VPWidenMemoryRecipe, VPInterleaveBase, VPReplicateRecipe>(
402- [](auto *S) {
403- MemoryLocation Loc;
404- // Populate noalias metadata from VPIRMetadata.
405- if (MDNode *NoAliasMD = S->getMetadata (LLVMContext::MD_noalias))
406- Loc.AATags .NoAlias = NoAliasMD;
407- if (MDNode *AliasScopeMD =
408- S->getMetadata (LLVMContext::MD_alias_scope))
409- Loc.AATags .Scope = AliasScopeMD;
410- return Loc;
411- })
412- .Default ([](auto *) { return std::nullopt ; });
400+ auto *M = dyn_cast<VPIRMetadata>(&R);
401+ if (!M)
402+ return std::nullopt ;
403+ MemoryLocation Loc;
404+ // Populate noalias metadata from VPIRMetadata.
405+ if (MDNode *NoAliasMD = M->getMetadata (LLVMContext::MD_noalias))
406+ Loc.AATags .NoAlias = NoAliasMD;
407+ if (MDNode *AliasScopeMD = M->getMetadata (LLVMContext::MD_alias_scope))
408+ Loc.AATags .Scope = AliasScopeMD;
409+ return Loc;
413410}
You can’t perform that action at this time.
0 commit comments