Skip to content

Commit 41dba9e

Browse files
committed
[AA] Remove some overloads (NFC)
Having all these instruction-specific overloads does not seem to provide any compile-time benefit, so drop them in favor of the generic methods accepting "const Instruction *". Only leave behind the per-instruction AAQI overloads, which are part of the internal implementation.
1 parent 4b42836 commit 41dba9e

File tree

2 files changed

+0
-160
lines changed

2 files changed

+0
-160
lines changed

llvm/include/llvm/Analysis/AliasAnalysis.h

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -459,97 +459,6 @@ class AAResults {
459459
return getMemoryEffects(F).onlyReadsMemory();
460460
}
461461

462-
/// getModRefInfo (for call sites) - Return information about whether
463-
/// a particular call site modifies or reads the specified memory location.
464-
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc);
465-
466-
/// getModRefInfo (for call sites) - A convenience wrapper.
467-
ModRefInfo getModRefInfo(const CallBase *Call, const Value *P,
468-
LocationSize Size) {
469-
return getModRefInfo(Call, MemoryLocation(P, Size));
470-
}
471-
472-
/// getModRefInfo (for loads) - Return information about whether
473-
/// a particular load modifies or reads the specified memory location.
474-
ModRefInfo getModRefInfo(const LoadInst *L, const MemoryLocation &Loc);
475-
476-
/// getModRefInfo (for loads) - A convenience wrapper.
477-
ModRefInfo getModRefInfo(const LoadInst *L, const Value *P,
478-
LocationSize Size) {
479-
return getModRefInfo(L, MemoryLocation(P, Size));
480-
}
481-
482-
/// getModRefInfo (for stores) - Return information about whether
483-
/// a particular store modifies or reads the specified memory location.
484-
ModRefInfo getModRefInfo(const StoreInst *S, const MemoryLocation &Loc);
485-
486-
/// getModRefInfo (for stores) - A convenience wrapper.
487-
ModRefInfo getModRefInfo(const StoreInst *S, const Value *P,
488-
LocationSize Size) {
489-
return getModRefInfo(S, MemoryLocation(P, Size));
490-
}
491-
492-
/// getModRefInfo (for fences) - Return information about whether
493-
/// a particular store modifies or reads the specified memory location.
494-
ModRefInfo getModRefInfo(const FenceInst *S, const MemoryLocation &Loc);
495-
496-
/// getModRefInfo (for fences) - A convenience wrapper.
497-
ModRefInfo getModRefInfo(const FenceInst *S, const Value *P,
498-
LocationSize Size) {
499-
return getModRefInfo(S, MemoryLocation(P, Size));
500-
}
501-
502-
/// getModRefInfo (for cmpxchges) - Return information about whether
503-
/// a particular cmpxchg modifies or reads the specified memory location.
504-
ModRefInfo getModRefInfo(const AtomicCmpXchgInst *CX,
505-
const MemoryLocation &Loc);
506-
507-
/// getModRefInfo (for cmpxchges) - A convenience wrapper.
508-
ModRefInfo getModRefInfo(const AtomicCmpXchgInst *CX, const Value *P,
509-
LocationSize Size) {
510-
return getModRefInfo(CX, MemoryLocation(P, Size));
511-
}
512-
513-
/// getModRefInfo (for atomicrmws) - Return information about whether
514-
/// a particular atomicrmw modifies or reads the specified memory location.
515-
ModRefInfo getModRefInfo(const AtomicRMWInst *RMW, const MemoryLocation &Loc);
516-
517-
/// getModRefInfo (for atomicrmws) - A convenience wrapper.
518-
ModRefInfo getModRefInfo(const AtomicRMWInst *RMW, const Value *P,
519-
LocationSize Size) {
520-
return getModRefInfo(RMW, MemoryLocation(P, Size));
521-
}
522-
523-
/// getModRefInfo (for va_args) - Return information about whether
524-
/// a particular va_arg modifies or reads the specified memory location.
525-
ModRefInfo getModRefInfo(const VAArgInst *I, const MemoryLocation &Loc);
526-
527-
/// getModRefInfo (for va_args) - A convenience wrapper.
528-
ModRefInfo getModRefInfo(const VAArgInst *I, const Value *P,
529-
LocationSize Size) {
530-
return getModRefInfo(I, MemoryLocation(P, Size));
531-
}
532-
533-
/// getModRefInfo (for catchpads) - Return information about whether
534-
/// a particular catchpad modifies or reads the specified memory location.
535-
ModRefInfo getModRefInfo(const CatchPadInst *I, const MemoryLocation &Loc);
536-
537-
/// getModRefInfo (for catchpads) - A convenience wrapper.
538-
ModRefInfo getModRefInfo(const CatchPadInst *I, const Value *P,
539-
LocationSize Size) {
540-
return getModRefInfo(I, MemoryLocation(P, Size));
541-
}
542-
543-
/// getModRefInfo (for catchrets) - Return information about whether
544-
/// a particular catchret modifies or reads the specified memory location.
545-
ModRefInfo getModRefInfo(const CatchReturnInst *I, const MemoryLocation &Loc);
546-
547-
/// getModRefInfo (for catchrets) - A convenience wrapper.
548-
ModRefInfo getModRefInfo(const CatchReturnInst *I, const Value *P,
549-
LocationSize Size) {
550-
return getModRefInfo(I, MemoryLocation(P, Size));
551-
}
552-
553462
/// Check whether or not an instruction may read or write the optionally
554463
/// specified memory location.
555464
///
@@ -576,11 +485,6 @@ class AAResults {
576485
/// the same memory locations.
577486
ModRefInfo getModRefInfo(const Instruction *I, const CallBase *Call);
578487

579-
/// Return information about whether two call sites may refer to the same set
580-
/// of memory locations. See the AA documentation for details:
581-
/// http://llvm.org/docs/AliasAnalysis.html#ModRefInfo
582-
ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2);
583-
584488
/// Return information about whether a particular call site modifies
585489
/// or reads the specified memory location \p MemLoc before instruction \p I
586490
/// in a BasicBlock.
@@ -705,12 +609,6 @@ class BatchAAResults {
705609
bool IgnoreLocals = false) {
706610
return AA.getModRefInfoMask(Loc, AAQI, IgnoreLocals);
707611
}
708-
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc) {
709-
return AA.getModRefInfo(Call, Loc, AAQI);
710-
}
711-
ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2) {
712-
return AA.getModRefInfo(Call1, Call2, AAQI);
713-
}
714612
ModRefInfo getModRefInfo(const Instruction *I,
715613
const Optional<MemoryLocation> &OptLoc) {
716614
return AA.getModRefInfo(I, OptLoc, AAQI);

llvm/lib/Analysis/AliasAnalysis.cpp

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,6 @@ ModRefInfo AAResults::getModRefInfo(const Instruction *I, const CallBase *Call2,
209209
return ModRefInfo::NoModRef;
210210
}
211211

212-
ModRefInfo AAResults::getModRefInfo(const CallBase *Call,
213-
const MemoryLocation &Loc) {
214-
SimpleAAQueryInfo AAQIP(*this);
215-
return getModRefInfo(Call, Loc, AAQIP);
216-
}
217-
218212
ModRefInfo AAResults::getModRefInfo(const CallBase *Call,
219213
const MemoryLocation &Loc,
220214
AAQueryInfo &AAQI) {
@@ -269,12 +263,6 @@ ModRefInfo AAResults::getModRefInfo(const CallBase *Call,
269263
return Result;
270264
}
271265

272-
ModRefInfo AAResults::getModRefInfo(const CallBase *Call1,
273-
const CallBase *Call2) {
274-
SimpleAAQueryInfo AAQIP(*this);
275-
return getModRefInfo(Call1, Call2, AAQIP);
276-
}
277-
278266
ModRefInfo AAResults::getModRefInfo(const CallBase *Call1,
279267
const CallBase *Call2, AAQueryInfo &AAQI) {
280268
ModRefInfo Result = ModRefInfo::ModRef;
@@ -476,11 +464,6 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, MemoryEffects ME) {
476464
// Helper method implementation
477465
//===----------------------------------------------------------------------===//
478466

479-
ModRefInfo AAResults::getModRefInfo(const LoadInst *L,
480-
const MemoryLocation &Loc) {
481-
SimpleAAQueryInfo AAQIP(*this);
482-
return getModRefInfo(L, Loc, AAQIP);
483-
}
484467
ModRefInfo AAResults::getModRefInfo(const LoadInst *L,
485468
const MemoryLocation &Loc,
486469
AAQueryInfo &AAQI) {
@@ -499,11 +482,6 @@ ModRefInfo AAResults::getModRefInfo(const LoadInst *L,
499482
return ModRefInfo::Ref;
500483
}
501484

502-
ModRefInfo AAResults::getModRefInfo(const StoreInst *S,
503-
const MemoryLocation &Loc) {
504-
SimpleAAQueryInfo AAQIP(*this);
505-
return getModRefInfo(S, Loc, AAQIP);
506-
}
507485
ModRefInfo AAResults::getModRefInfo(const StoreInst *S,
508486
const MemoryLocation &Loc,
509487
AAQueryInfo &AAQI) {
@@ -530,12 +508,6 @@ ModRefInfo AAResults::getModRefInfo(const StoreInst *S,
530508
return ModRefInfo::Mod;
531509
}
532510

533-
ModRefInfo AAResults::getModRefInfo(const FenceInst *S,
534-
const MemoryLocation &Loc) {
535-
SimpleAAQueryInfo AAQIP(*this);
536-
return getModRefInfo(S, Loc, AAQIP);
537-
}
538-
539511
ModRefInfo AAResults::getModRefInfo(const FenceInst *S,
540512
const MemoryLocation &Loc,
541513
AAQueryInfo &AAQI) {
@@ -547,12 +519,6 @@ ModRefInfo AAResults::getModRefInfo(const FenceInst *S,
547519
return ModRefInfo::ModRef;
548520
}
549521

550-
ModRefInfo AAResults::getModRefInfo(const VAArgInst *V,
551-
const MemoryLocation &Loc) {
552-
SimpleAAQueryInfo AAQIP(*this);
553-
return getModRefInfo(V, Loc, AAQIP);
554-
}
555-
556522
ModRefInfo AAResults::getModRefInfo(const VAArgInst *V,
557523
const MemoryLocation &Loc,
558524
AAQueryInfo &AAQI) {
@@ -572,12 +538,6 @@ ModRefInfo AAResults::getModRefInfo(const VAArgInst *V,
572538
return ModRefInfo::ModRef;
573539
}
574540

575-
ModRefInfo AAResults::getModRefInfo(const CatchPadInst *CatchPad,
576-
const MemoryLocation &Loc) {
577-
SimpleAAQueryInfo AAQIP(*this);
578-
return getModRefInfo(CatchPad, Loc, AAQIP);
579-
}
580-
581541
ModRefInfo AAResults::getModRefInfo(const CatchPadInst *CatchPad,
582542
const MemoryLocation &Loc,
583543
AAQueryInfo &AAQI) {
@@ -591,12 +551,6 @@ ModRefInfo AAResults::getModRefInfo(const CatchPadInst *CatchPad,
591551
return ModRefInfo::ModRef;
592552
}
593553

594-
ModRefInfo AAResults::getModRefInfo(const CatchReturnInst *CatchRet,
595-
const MemoryLocation &Loc) {
596-
SimpleAAQueryInfo AAQIP(*this);
597-
return getModRefInfo(CatchRet, Loc, AAQIP);
598-
}
599-
600554
ModRefInfo AAResults::getModRefInfo(const CatchReturnInst *CatchRet,
601555
const MemoryLocation &Loc,
602556
AAQueryInfo &AAQI) {
@@ -610,12 +564,6 @@ ModRefInfo AAResults::getModRefInfo(const CatchReturnInst *CatchRet,
610564
return ModRefInfo::ModRef;
611565
}
612566

613-
ModRefInfo AAResults::getModRefInfo(const AtomicCmpXchgInst *CX,
614-
const MemoryLocation &Loc) {
615-
SimpleAAQueryInfo AAQIP(*this);
616-
return getModRefInfo(CX, Loc, AAQIP);
617-
}
618-
619567
ModRefInfo AAResults::getModRefInfo(const AtomicCmpXchgInst *CX,
620568
const MemoryLocation &Loc,
621569
AAQueryInfo &AAQI) {
@@ -634,12 +582,6 @@ ModRefInfo AAResults::getModRefInfo(const AtomicCmpXchgInst *CX,
634582
return ModRefInfo::ModRef;
635583
}
636584

637-
ModRefInfo AAResults::getModRefInfo(const AtomicRMWInst *RMW,
638-
const MemoryLocation &Loc) {
639-
SimpleAAQueryInfo AAQIP(*this);
640-
return getModRefInfo(RMW, Loc, AAQIP);
641-
}
642-
643585
ModRefInfo AAResults::getModRefInfo(const AtomicRMWInst *RMW,
644586
const MemoryLocation &Loc,
645587
AAQueryInfo &AAQI) {

0 commit comments

Comments
 (0)