AliasAnalysis::ModRefResult
AliasAnalysis::getModRefInfo(const AtomicCmpXchgInst *CX, const Location &Loc) {
// Acquire/Release cmpxchg has properties that matter for arbitrary addresses.
- if (CX->getOrdering() > Monotonic)
+ if (CX->getSuccessOrdering() > Monotonic)
return ModRef;
// If the cmpxchg address does not alias the location, it does not access it.
CapturesBefore(const Instruction *I, DominatorTree *DT)
: BeforeHere(I), DT(DT), Captured(false) {}
- void tooManyUses() { Captured = true; }
+ void tooManyUses() override { Captured = true; }
- bool shouldExplore(Use *U) {
+ bool shouldExplore(const Use *U) override {
Instruction *I = cast<Instruction>(U->getUser());
BasicBlock *BB = I->getParent();
// We explore this usage only if the usage can reach "BeforeHere".
return true;
}
- bool captured(Use *U) {
+ bool captured(const Use *U) override {
Instruction *I = cast<Instruction>(U->getUser());
BasicBlock *BB = I->getParent();
// Same logic as in shouldExplore.
/// AliasAnalysis interface before any other methods are called.
///
void AliasAnalysis::InitializeAliasAnalysis(Pass *P) {
- DL = P->getAnalysisIfAvailable<DataLayout>();
+ DataLayoutPass *DLP = P->getAnalysisIfAvailable<DataLayoutPass>();
+ DL = DLP ? &DLP->getDataLayout() : nullptr;
TLI = P->getAnalysisIfAvailable<TargetLibraryInfo>();
AA = &P->getAnalysis<AliasAnalysis>();
}