mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 03:44:59 +00:00
[NFC] Switch last couple of invariant_load checks to use hasMetadata
llvm-svn: 370948
This commit is contained in:
parent
3b705ef712
commit
4228245e41
@ -370,7 +370,7 @@ static bool isUseTriviallyOptimizableToLiveOnEntry(AliasAnalysisType &AA,
|
||||
const Instruction *I) {
|
||||
// If the memory can't be changed, then loads of the memory can't be
|
||||
// clobbered.
|
||||
return isa<LoadInst>(I) && (I->getMetadata(LLVMContext::MD_invariant_load) ||
|
||||
return isa<LoadInst>(I) && (I->hasMetadata(LLVMContext::MD_invariant_load) ||
|
||||
AA.pointsToConstantMemory(MemoryLocation(
|
||||
cast<LoadInst>(I)->getPointerOperand())));
|
||||
}
|
||||
|
@ -791,7 +791,7 @@ bool EarlyCSE::isOperatingOnInvariantMemAt(Instruction *I, unsigned GenAt) {
|
||||
// A location loaded from with an invariant_load is assumed to *never* change
|
||||
// within the visible scope of the compilation.
|
||||
if (auto *LI = dyn_cast<LoadInst>(I))
|
||||
if (LI->getMetadata(LLVMContext::MD_invariant_load))
|
||||
if (LI->hasMetadata(LLVMContext::MD_invariant_load))
|
||||
return true;
|
||||
|
||||
auto MemLocOpt = MemoryLocation::getOrNone(I);
|
||||
|
@ -1099,7 +1099,7 @@ bool llvm::canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
|
||||
// in the same alias set as something that ends up being modified.
|
||||
if (AA->pointsToConstantMemory(LI->getOperand(0)))
|
||||
return true;
|
||||
if (LI->getMetadata(LLVMContext::MD_invariant_load))
|
||||
if (LI->hasMetadata(LLVMContext::MD_invariant_load))
|
||||
return true;
|
||||
|
||||
if (LI->isAtomic() && !TargetExecutesOncePerLoop)
|
||||
|
@ -665,7 +665,7 @@ Vectorizer::getVectorizablePrefix(ArrayRef<Instruction *> Chain) {
|
||||
// We can ignore the alias if the we have a load store pair and the load
|
||||
// is known to be invariant. The load cannot be clobbered by the store.
|
||||
auto IsInvariantLoad = [](const LoadInst *LI) -> bool {
|
||||
return LI->getMetadata(LLVMContext::MD_invariant_load);
|
||||
return LI->hasMetadata(LLVMContext::MD_invariant_load);
|
||||
};
|
||||
|
||||
// We can ignore the alias as long as the load comes before the store,
|
||||
|
Loading…
Reference in New Issue
Block a user