diff options
author | Andreas Jonson <andjo403@hotmail.com> | 2024-09-17 18:25:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-17 18:25:53 +0200 |
commit | a0d00c94c251ba7aff9d58a42a8e41c4ed432b8b (patch) | |
tree | 22ec695e827fdc5f625eadb81f84427f5ee9bb91 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 0050503b7a278a50b406a47378f6161bf55059ec (diff) | |
download | llvm-a0d00c94c251ba7aff9d58a42a8e41c4ed432b8b.zip llvm-a0d00c94c251ba7aff9d58a42a8e41c4ed432b8b.tar.gz llvm-a0d00c94c251ba7aff9d58a42a8e41c4ed432b8b.tar.bz2 |
[SimplifyCFG] Swap range metadata to attribute for calls. (#108984)
Among the last usages of range metadata for call before being able to
deprecate and only have the range attribute for calls.
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 5a694b5..1a4820e 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -3334,7 +3334,7 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI, // extended for vector types in the future. assert(!getLoadStoreType(I)->isVectorTy() && "not implemented"); auto *Op0 = I->getOperand(0); - Instruction *MaskedLoadStore = nullptr; + CallInst *MaskedLoadStore = nullptr; if (auto *LI = dyn_cast<LoadInst>(I)) { // Handle Load. auto *Ty = I->getType(); @@ -3367,8 +3367,9 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI, // vector specifies a per-element range, so the semantics stay the // same. Keep it. // !annotation: Not impact semantics. Keep it. - I->dropUBImplyingAttrsAndUnknownMetadata( - {LLVMContext::MD_range, LLVMContext::MD_annotation}); + if (const MDNode *Ranges = I->getMetadata(LLVMContext::MD_range)) + MaskedLoadStore->addRangeRetAttr(getConstantRangeFromMetadata(*Ranges)); + I->dropUBImplyingAttrsAndUnknownMetadata({LLVMContext::MD_annotation}); // FIXME: DIAssignID is not supported for masked store yet. // (Verifier::visitDIAssignIDMetadata) at::deleteAssignmentMarkers(I); |