37
37
#ifndef LLVM_ANALYSIS_ALIASANALYSIS_H
38
38
#define LLVM_ANALYSIS_ALIASANALYSIS_H
39
39
40
- #include " llvm/Support/Compiler.h"
41
40
#include " llvm/ADT/DenseMap.h"
42
41
#include " llvm/ADT/SmallVector.h"
43
42
#include " llvm/Analysis/MemoryLocation.h"
44
43
#include " llvm/IR/Function.h"
45
44
#include " llvm/IR/PassManager.h"
46
45
#include " llvm/Pass.h"
46
+ #include " llvm/Support/Compiler.h"
47
47
#include " llvm/Support/ModRef.h"
48
48
#include < cstdint>
49
49
#include < functional>
@@ -165,7 +165,7 @@ class SimpleCaptureAnalysis final : public CaptureAnalysis {
165
165
166
166
public:
167
167
LLVM_ABI bool isNotCapturedBefore (const Value *Object, const Instruction *I,
168
- bool OrAt) override ;
168
+ bool OrAt) override ;
169
169
};
170
170
171
171
// / Context-sensitive CaptureAnalysis provider, which computes and caches the
@@ -190,7 +190,7 @@ class EarliestEscapeAnalysis final : public CaptureAnalysis {
190
190
: DT(DT), LI(LI) {}
191
191
192
192
LLVM_ABI bool isNotCapturedBefore (const Value *Object, const Instruction *I,
193
- bool OrAt) override ;
193
+ bool OrAt) override ;
194
194
195
195
LLVM_ABI void removeInstruction (Instruction *I);
196
196
};
@@ -340,7 +340,7 @@ class AAResults {
340
340
// / The aggregation is invalidated if any of the underlying analyses is
341
341
// / invalidated.
342
342
LLVM_ABI bool invalidate (Function &F, const PreservedAnalyses &PA,
343
- FunctionAnalysisManager::Invalidator &Inv);
343
+ FunctionAnalysisManager::Invalidator &Inv);
344
344
345
345
// ===--------------------------------------------------------------------===//
346
346
// / \name Alias Queries
@@ -350,7 +350,8 @@ class AAResults {
350
350
// / Returns an AliasResult indicating whether the two pointers are aliased to
351
351
// / each other. This is the interface that must be implemented by specific
352
352
// / alias analysis implementations.
353
- LLVM_ABI AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB);
353
+ LLVM_ABI AliasResult alias (const MemoryLocation &LocA,
354
+ const MemoryLocation &LocB);
354
355
355
356
// / A convenience wrapper around the primary \c alias interface.
356
357
AliasResult alias (const Value *V1, LocationSize V1Size, const Value *V2,
@@ -419,7 +420,7 @@ class AAResults {
419
420
// / If IgnoreLocals is true, then this method returns NoModRef for memory
420
421
// / that points to a local alloca.
421
422
LLVM_ABI ModRefInfo getModRefInfoMask (const MemoryLocation &Loc,
422
- bool IgnoreLocals = false );
423
+ bool IgnoreLocals = false );
423
424
424
425
// / A convenience wrapper around the primary \c getModRefInfoMask
425
426
// / interface.
@@ -524,7 +525,8 @@ class AAResults {
524
525
525
526
// / Return information about whether two instructions may refer to the same
526
527
// / memory locations.
527
- LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I1, const Instruction *I2);
528
+ LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I1,
529
+ const Instruction *I2);
528
530
529
531
// / Return information about whether a particular call site modifies
530
532
// / or reads the specified memory location \p MemLoc before instruction \p I
@@ -549,7 +551,8 @@ class AAResults {
549
551
550
552
// / Check if it is possible for execution of the specified basic block to
551
553
// / modify the location Loc.
552
- LLVM_ABI bool canBasicBlockModify (const BasicBlock &BB, const MemoryLocation &Loc);
554
+ LLVM_ABI bool canBasicBlockModify (const BasicBlock &BB,
555
+ const MemoryLocation &Loc);
553
556
554
557
// / A convenience wrapper synthesizing a memory location.
555
558
bool canBasicBlockModify (const BasicBlock &BB, const Value *P,
@@ -562,9 +565,10 @@ class AAResults {
562
565
// /
563
566
// / The instructions to consider are all of the instructions in the range of
564
567
// / [I1,I2] INCLUSIVE. I1 and I2 must be in the same basic block.
565
- LLVM_ABI bool canInstructionRangeModRef (const Instruction &I1, const Instruction &I2,
566
- const MemoryLocation &Loc,
567
- const ModRefInfo Mode);
568
+ LLVM_ABI bool canInstructionRangeModRef (const Instruction &I1,
569
+ const Instruction &I2,
570
+ const MemoryLocation &Loc,
571
+ const ModRefInfo Mode);
568
572
569
573
// / A convenience wrapper synthesizing a memory location.
570
574
bool canInstructionRangeModRef (const Instruction &I1, const Instruction &I2,
@@ -575,42 +579,54 @@ class AAResults {
575
579
576
580
// CtxI can be nullptr, in which case the query is whether or not the aliasing
577
581
// relationship holds through the entire function.
578
- LLVM_ABI AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB,
579
- AAQueryInfo &AAQI, const Instruction *CtxI = nullptr );
582
+ LLVM_ABI AliasResult alias (const MemoryLocation &LocA,
583
+ const MemoryLocation &LocB, AAQueryInfo &AAQI,
584
+ const Instruction *CtxI = nullptr );
580
585
581
- LLVM_ABI ModRefInfo getModRefInfoMask (const MemoryLocation &Loc, AAQueryInfo &AAQI,
582
- bool IgnoreLocals = false );
586
+ LLVM_ABI ModRefInfo getModRefInfoMask (const MemoryLocation &Loc,
587
+ AAQueryInfo &AAQI,
588
+ bool IgnoreLocals = false );
583
589
LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I, const CallBase *Call2,
584
- AAQueryInfo &AAQIP);
585
- LLVM_ABI ModRefInfo getModRefInfo (const CallBase *Call, const MemoryLocation &Loc,
586
- AAQueryInfo &AAQI);
587
- LLVM_ABI ModRefInfo getModRefInfo (const CallBase *Call1, const CallBase *Call2,
588
- AAQueryInfo &AAQI);
589
- LLVM_ABI ModRefInfo getModRefInfo (const VAArgInst *V, const MemoryLocation &Loc,
590
- AAQueryInfo &AAQI);
591
- LLVM_ABI ModRefInfo getModRefInfo (const LoadInst *L, const MemoryLocation &Loc,
592
- AAQueryInfo &AAQI);
593
- LLVM_ABI ModRefInfo getModRefInfo (const StoreInst *S, const MemoryLocation &Loc,
594
- AAQueryInfo &AAQI);
595
- LLVM_ABI ModRefInfo getModRefInfo (const FenceInst *S, const MemoryLocation &Loc,
596
- AAQueryInfo &AAQI);
590
+ AAQueryInfo &AAQIP);
591
+ LLVM_ABI ModRefInfo getModRefInfo (const CallBase *Call,
592
+ const MemoryLocation &Loc,
593
+ AAQueryInfo &AAQI);
594
+ LLVM_ABI ModRefInfo getModRefInfo (const CallBase *Call1,
595
+ const CallBase *Call2, AAQueryInfo &AAQI);
596
+ LLVM_ABI ModRefInfo getModRefInfo (const VAArgInst *V,
597
+ const MemoryLocation &Loc,
598
+ AAQueryInfo &AAQI);
599
+ LLVM_ABI ModRefInfo getModRefInfo (const LoadInst *L,
600
+ const MemoryLocation &Loc,
601
+ AAQueryInfo &AAQI);
602
+ LLVM_ABI ModRefInfo getModRefInfo (const StoreInst *S,
603
+ const MemoryLocation &Loc,
604
+ AAQueryInfo &AAQI);
605
+ LLVM_ABI ModRefInfo getModRefInfo (const FenceInst *S,
606
+ const MemoryLocation &Loc,
607
+ AAQueryInfo &AAQI);
597
608
LLVM_ABI ModRefInfo getModRefInfo (const AtomicCmpXchgInst *CX,
598
- const MemoryLocation &Loc, AAQueryInfo &AAQI);
599
- LLVM_ABI ModRefInfo getModRefInfo (const AtomicRMWInst *RMW, const MemoryLocation &Loc,
600
- AAQueryInfo &AAQI);
601
- LLVM_ABI ModRefInfo getModRefInfo (const CatchPadInst *I, const MemoryLocation &Loc,
602
- AAQueryInfo &AAQI);
603
- LLVM_ABI ModRefInfo getModRefInfo (const CatchReturnInst *I, const MemoryLocation &Loc,
604
- AAQueryInfo &AAQI);
609
+ const MemoryLocation &Loc,
610
+ AAQueryInfo &AAQI);
611
+ LLVM_ABI ModRefInfo getModRefInfo (const AtomicRMWInst *RMW,
612
+ const MemoryLocation &Loc,
613
+ AAQueryInfo &AAQI);
614
+ LLVM_ABI ModRefInfo getModRefInfo (const CatchPadInst *I,
615
+ const MemoryLocation &Loc,
616
+ AAQueryInfo &AAQI);
617
+ LLVM_ABI ModRefInfo getModRefInfo (const CatchReturnInst *I,
618
+ const MemoryLocation &Loc,
619
+ AAQueryInfo &AAQI);
605
620
LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I,
606
- const std::optional<MemoryLocation> &OptLoc,
607
- AAQueryInfo &AAQIP);
608
- LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I1, const Instruction *I2,
609
- AAQueryInfo &AAQI);
621
+ const std::optional<MemoryLocation> &OptLoc,
622
+ AAQueryInfo &AAQIP);
623
+ LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I1,
624
+ const Instruction *I2, AAQueryInfo &AAQI);
610
625
LLVM_ABI ModRefInfo callCapturesBefore (const Instruction *I,
611
- const MemoryLocation &MemLoc, DominatorTree *DT,
612
- AAQueryInfo &AAQIP);
613
- LLVM_ABI MemoryEffects getMemoryEffects (const CallBase *Call, AAQueryInfo &AAQI);
626
+ const MemoryLocation &MemLoc,
627
+ DominatorTree *DT, AAQueryInfo &AAQIP);
628
+ LLVM_ABI MemoryEffects getMemoryEffects (const CallBase *Call,
629
+ AAQueryInfo &AAQI);
614
630
615
631
private:
616
632
class Concept ;
@@ -905,7 +921,7 @@ LLVM_ABI bool isEscapeSource(const Value *V);
905
921
// / to true, then the memory is only not visible if the object has not been
906
922
// / captured prior to the unwind. Otherwise it is not visible even if captured.
907
923
LLVM_ABI bool isNotVisibleOnUnwind (const Value *Object,
908
- bool &RequiresNoCaptureBeforeUnwind);
924
+ bool &RequiresNoCaptureBeforeUnwind);
909
925
910
926
// / Return true if the Object is writable, in the sense that any location based
911
927
// / on this pointer that can be loaded can also be stored to without trapping.
@@ -918,7 +934,8 @@ LLVM_ABI bool isNotVisibleOnUnwind(const Value *Object,
918
934
// / using the dereferenceable(N) attribute. It does not necessarily hold for
919
935
// / parts that are only known to be dereferenceable due to the presence of
920
936
// / loads.
921
- LLVM_ABI bool isWritableObject (const Value *Object, bool &ExplicitlyDereferenceableOnly);
937
+ LLVM_ABI bool isWritableObject (const Value *Object,
938
+ bool &ExplicitlyDereferenceableOnly);
922
939
923
940
// / A manager for alias analyses.
924
941
// /
0 commit comments