File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -521,6 +521,10 @@ class AAResults {
521
521
// / the same memory locations.
522
522
ModRefInfo getModRefInfo (const Instruction *I, const CallBase *Call);
523
523
524
+ // / Return information about whether two instructions may refer to the same
525
+ // / memory locations.
526
+ ModRefInfo getModRefInfo (const Instruction *I1, const Instruction *I2);
527
+
524
528
// / Return information about whether a particular call site modifies
525
529
// / or reads the specified memory location \p MemLoc before instruction \p I
526
530
// / in a BasicBlock.
@@ -600,7 +604,8 @@ class AAResults {
600
604
ModRefInfo getModRefInfo (const Instruction *I,
601
605
const std::optional<MemoryLocation> &OptLoc,
602
606
AAQueryInfo &AAQIP);
603
- ModRefInfo getModRefInfo (const Instruction *I1, const Instruction *I2);
607
+ ModRefInfo getModRefInfo (const Instruction *I1, const Instruction *I2,
608
+ AAQueryInfo &AAQI);
604
609
ModRefInfo callCapturesBefore (const Instruction *I,
605
610
const MemoryLocation &MemLoc, DominatorTree *DT,
606
611
AAQueryInfo &AAQIP);
Original file line number Diff line number Diff line change @@ -369,19 +369,22 @@ ModRefInfo AAResults::getModRefInfo(const CallBase *Call1,
369
369
return Result;
370
370
}
371
371
372
- // Check whether two instructions may read or write the same memory location.
373
372
ModRefInfo AAResults::getModRefInfo (const Instruction *I1,
374
373
const Instruction *I2) {
375
374
SimpleAAQueryInfo AAQIP (*this );
375
+ return getModRefInfo (I1, I2, AAQIP);
376
+ }
376
377
378
+ ModRefInfo AAResults::getModRefInfo (const Instruction *I1,
379
+ const Instruction *I2, AAQueryInfo &AAQI) {
377
380
// Early-exit if either instruction does not read or write memory.
378
381
if (!I1->mayReadOrWriteMemory () || !I2->mayReadOrWriteMemory ())
379
382
return ModRefInfo::NoModRef;
380
383
381
384
if (const auto *Call2 = dyn_cast<CallBase>(I2))
382
- return getModRefInfo (I1, Call2, AAQIP );
385
+ return getModRefInfo (I1, Call2, AAQI );
383
386
384
- ModRefInfo MR = getModRefInfo (I1, MemoryLocation::getOrNone (I2), AAQIP );
387
+ ModRefInfo MR = getModRefInfo (I1, MemoryLocation::getOrNone (I2), AAQI );
385
388
return isModOrRefSet (MR) ? ModRefInfo::ModRef : ModRefInfo::NoModRef;
386
389
}
387
390
You can’t perform that action at this time.
0 commit comments