LLVM: include/llvm/Analysis/AliasAnalysis.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37#ifndef LLVM_ANALYSIS_ALIASANALYSIS_H
38#define LLVM_ANALYSIS_ALIASANALYSIS_H
39
48#include
49#include
50#include
51#include
52#include
53
54namespace llvm {
55
64
65
66
67
68
69
70
71
72
73
74
75
76
77
79private:
80 static const int OffsetBits = 23;
81 static const int AliasBits = 8;
82 static_assert(AliasBits + 1 + OffsetBits <= 32,
83 "AliasResult size is intended to be 4 bytes!");
84
85 unsigned int Alias : AliasBits;
86 unsigned int HasOffset : 1;
87 signed int Offset : OffsetBits;
88
89public:
91
92
93
94
95
97
98
100
102
104 };
105 static_assert(MustAlias < (1 << AliasBits),
106 "Not enough bit field size for the enum!");
107
110 : Alias(Alias), HasOffset(false), Offset(0) {}
111
112 operator Kind() const { return static_cast<Kind>(Alias); }
113
115 return Alias == Other.Alias && HasOffset == Other.HasOffset &&
116 Offset == Other.Offset;
117 }
119
122
123 constexpr bool hasOffset() const { return HasOffset; }
125 assert(HasOffset && "No offset!");
126 return Offset;
127 }
130 HasOffset = true;
131 Offset = NewOffset;
132 }
133 }
134
135
136 void swap(bool DoSwap = true) {
139 }
140};
141
142static_assert(sizeof(AliasResult) == 4,
143 "AliasResult size is intended to be 4 bytes!");
144
145
147
148
151
152
153
154
155
156
159};
160
161
162
163
166
167public:
169 bool OrAt) override;
170};
171
172
173
174
178
179
180
181
182
183
185 EarliestEscapes;
186
187
188
190
191public:
194
196 bool OrAt) override;
197
199};
200
201
202
203
213
228 return LHS.Ptr == RHS.Ptr && LHS.Size == RHS.Size;
229 }
230};
231
232class AAResults;
233
234
235
236
237
238
239
240
241
243public:
244 using LocPair = std::pair<AACacheLoc, AACacheLoc>;
246
247
249
250
252
254
255
256
258
259
261
263 };
264
265
266
268
271
273
274
276
277
279
280
281
282
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
300
301
302
304
306};
307
308
315
316class BatchAAResults;
317
319public:
320
321
325
326
327 template void addAAResult(AAResultT &AAResult) {
328
329
330
331 AAs.emplace_back(new Model(AAResult, *this));
332 }
333
334
335
336
337
338
340
341
342
343
344
346 FunctionAnalysisManager::Invalidator &Inv);
347
348
349
350
351
352
353
354
355
358
359
364
365
370
371
372
376
377
382
383
388
389
390
394
395
400
401
402
406
407
408
412
413
414
415
416
417
418
419
420
421
422
423
424
426 bool IgnoreLocals = false);
427
428
429
433
434
435
436
437
438
440
441
443
444
446
447
448
449
450
451
452
453
454
455
456
457
461
462
463
464
465
466
467
468
469
470
471
472
476
477
478
479
480
481
482
483
484
485
489
490
491
492
493
494
495
496
497
498
502
503
504
505
506
507
508
509
510
511
512
514 const std::optional &OptLoc) {
517 }
518
519
524
525
526
528
529
530
533
534
535
536
543
544
549
550
551
552
553
554
555
556
559
560
565
566
567
568
569
570
575
576
582
583
584
589
592 bool IgnoreLocals = false);
625 const std::optional &OptLoc,
634
635private:
636 class Concept;
637
638 template class Model;
639
641
643
644 std::vector<std::unique_ptr> AAs;
645
646 std::vector<AnalysisKey *> AADeps;
647
649};
650
651
652
653
654
655
656
661
662public:
665 : AA(AAR), AAQI(AAR, CA) {}
666
668 return AA.alias(LocA, LocB, AAQI);
669 }
671 return isNoModRef(AA.getModRefInfoMask(Loc, AAQI, OrLocal));
672 }
677 bool IgnoreLocals = false) {
678 return AA.getModRefInfoMask(Loc, AAQI, IgnoreLocals);
679 }
681 const std::optional &OptLoc) {
682 return AA.getModRefInfo(I, OptLoc, AAQI);
683 }
685 return AA.getModRefInfo(I, Call2, AAQI);
686 }
688 return AA.getArgModRefInfo(Call, ArgIdx);
689 }
691 return AA.getMemoryEffects(Call, AAQI);
692 }
707 return AA.callCapturesBefore(I, MemLoc, DT, AAQI);
708 }
709
710
712 AAQI.MayBeCrossIteration = true;
713 }
714
715
717};
718
719
720
722
723
724
725
726
727
728
729
730
731
733public:
735
736
737
738
739
740
741
742
743
747
748
749
751 const Module *M) = 0;
752
753
754
755
756
757
758
759
760
761
764 bool IgnoreLocals) = 0;
765
766
767
768
769
770
772 unsigned ArgIdx) = 0;
773
774
777
778
780
781
782
786
787
788
789
792
793
794};
795
796
797
798
799
800
801
802template class AAResults::Model final : public Concept {
803 AAResultT &Result;
804
805public:
806 explicit Model(AAResultT &Result, AAResults &AAR) : Result(Result) {}
807 ~Model() override = default;
808
811 return Result.alias(LocA, LocB, AAQI, CtxI);
812 }
813
814 AliasResult aliasErrno(const MemoryLocation &Loc, const Module *M) override {
815 return Result.aliasErrno(Loc, M);
816 }
817
818 ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI,
819 bool IgnoreLocals) override {
820 return Result.getModRefInfoMask(Loc, AAQI, IgnoreLocals);
821 }
822
823 ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx) override {
824 return Result.getArgModRefInfo(Call, ArgIdx);
825 }
826
828 AAQueryInfo &AAQI) override {
829 return Result.getMemoryEffects(Call, AAQI);
830 }
831
832 MemoryEffects getMemoryEffects(const Function *F) override {
833 return Result.getMemoryEffects(F);
834 }
835
836 ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc,
837 AAQueryInfo &AAQI) override {
838 return Result.getModRefInfo(Call, Loc, AAQI);
839 }
840
841 ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2,
842 AAQueryInfo &AAQI) override {
843 return Result.getModRefInfo(Call1, Call2, AAQI);
844 }
845};
846
847
848
849
850
851
852
853
854
855
856
857
859protected:
861
862
863
866
867public:
872
876
878 bool IgnoreLocals) {
880 }
881
885
889
893
898
903};
904
905
907
908
909
910
911
912
913
914
916
917
918
919
920
921
923
924
925
926
927
928
930
931
932
934
935
936
937
938
939
941 bool &RequiresNoCaptureBeforeUnwind);
942
943
944
945
946
947
948
949
950
951
952
953
955 bool &ExplicitlyDereferenceableOnly);
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
975public:
977
978
980 ResultGetters.push_back(&getFunctionAAResultImpl);
981 }
982
983
985 ResultGetters.push_back(&getModuleAAResultImpl);
986 }
987
989
990private:
992
994
997 4> ResultGetters;
998
999 template
1000 static void getFunctionAAResultImpl(Function &F,
1005 }
1006
1007 template
1009 AAResults &AAResults) {
1011 if (auto *R =
1012 MAMProxy.template getCachedResult(*F.getParent())) {
1013 AAResults.addAAResult(*R);
1014 MAMProxy
1015 .template registerOuterAnalysisInvalidation<AnalysisT, AAManager>();
1016 }
1017 }
1018};
1019
1020
1021
1023 std::unique_ptr AAR;
1024
1025public:
1027
1029
1032
1034
1035 void getAnalysisUsage(AnalysisUsage &AU) const override;
1036};
1037
1038
1039
1042
1044
1046
1048
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1067
1071};
1072
1073
1074
1075
1076
1077
1078
1079
1082
1083}
1084
1085#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the DenseMap class.
static bool runOnFunction(Function &F, bool PostInlining)
This header defines various interfaces for pass management in LLVM.
Machine Check Debug Module
This file provides utility analysis objects describing memory locations.
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This file defines the SmallVector class.
A manager for alias analyses.
Definition AliasAnalysis.h:974
void registerFunctionAnalysis()
Register a specific AA result.
Definition AliasAnalysis.h:979
AAResults Result
Definition AliasAnalysis.h:976
LLVM_ABI Result run(Function &F, FunctionAnalysisManager &AM)
void registerModuleAnalysis()
Register a specific AA result.
Definition AliasAnalysis.h:984
This class stores info we want to provide to or retain within an alias query.
Definition AliasAnalysis.h:242
AAQueryInfo(AAResults &AAR, CaptureAnalysis *CA)
Definition AliasAnalysis.h:305
AAResults & AAR
Definition AliasAnalysis.h:267
SmallVector< AAQueryInfo::LocPair, 4 > AssumptionBasedResults
Location pairs for which an assumption based result is currently stored.
Definition AliasAnalysis.h:283
unsigned Depth
Query depth used to distinguish recursive queries.
Definition AliasAnalysis.h:275
bool UseDominatorTree
Whether alias analysis is allowed to use the dominator tree, for use by passes that lazily update the...
Definition AliasAnalysis.h:303
int NumAssumptionUses
How many active NoAlias assumption uses there are.
Definition AliasAnalysis.h:278
std::pair< AACacheLoc, AACacheLoc > LocPair
Definition AliasAnalysis.h:244
AliasCacheT AliasCache
Definition AliasAnalysis.h:270
SmallDenseMap< LocPair, CacheEntry, 8 > AliasCacheT
Definition AliasAnalysis.h:269
bool MayBeCrossIteration
Tracks whether the accesses may be on different cycle iterations.
Definition AliasAnalysis.h:299
CaptureAnalysis * CA
Definition AliasAnalysis.h:272
ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI)
Definition AliasAnalysis.h:899
AAResultBase(const AAResultBase &Arg)=default
MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI)
Definition AliasAnalysis.h:886
ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals)
Definition AliasAnalysis.h:877
MemoryEffects getMemoryEffects(const Function *F)
Definition AliasAnalysis.h:890
AliasResult aliasErrno(const MemoryLocation &Loc, const Module *M)
Definition AliasAnalysis.h:873
AAResultBase(AAResultBase &&Arg)
Definition AliasAnalysis.h:865
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
Definition AliasAnalysis.h:894
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)
Definition AliasAnalysis.h:882
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *I)
Definition AliasAnalysis.h:868
static char ID
Definition AliasAnalysis.h:1026
const AAResults & getAAResults() const
Definition AliasAnalysis.h:1031
AAResults & getAAResults()
Definition AliasAnalysis.h:1030
A private abstract base class describing the concept of an individual alias analysis implementation.
Definition AliasAnalysis.h:732
virtual AliasResult aliasErrno(const MemoryLocation &Loc, const Module *M)=0
Returns an AliasResult indicating whether a specific memory location aliases errno.
virtual AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *CtxI)=0
The main low level interface to the alias analysis implementation.
virtual MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI)=0
Return the behavior of the given call site.
virtual ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI)=0
Return information about whether two call sites may refer to the same set of memory locations.
virtual ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals)=0
Returns a bitmask that should be unconditionally applied to the ModRef info of a memory location.
virtual ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)=0
getModRefInfo (for call sites) - Return information about whether a particular call site modifies or ...
virtual ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)=0
Get the ModRef info associated with a pointer argument of a callsite.
virtual MemoryEffects getMemoryEffects(const Function *F)=0
Return the behavior when calling the given function.
Definition AliasAnalysis.h:318
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2, const Value *Ptr, LocationSize Size, const ModRefInfo Mode)
A convenience wrapper synthesizing a memory location.
Definition AliasAnalysis.h:577
bool pointsToConstantMemory(const Value *P, bool OrLocal=false)
A convenience wrapper around the primary pointsToConstantMemory interface.
Definition AliasAnalysis.h:409
friend class AAResultBase
Definition AliasAnalysis.h:640
bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal=false)
Checks whether the given location points to constant memory, or if OrLocal is true whether it points ...
Definition AliasAnalysis.h:403
ModRefInfo getModRefInfo(const Instruction *I, const std::optional< MemoryLocation > &OptLoc)
Check whether or not an instruction may read or write the optionally specified memory location.
Definition AliasAnalysis.h:513
bool doesNotAccessMemory(const Function *F)
Checks if the specified function is known to never read or write memory.
Definition AliasAnalysis.h:473
AliasResult alias(const Value *V1, const Value *V2)
A convenience wrapper around the primary alias interface.
Definition AliasAnalysis.h:366
AliasResult alias(const Value *V1, LocationSize V1Size, const Value *V2, LocationSize V2Size)
A convenience wrapper around the primary alias interface.
Definition AliasAnalysis.h:360
bool isMustAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
A trivial helper function to check to see if the specified pointers are must-alias.
Definition AliasAnalysis.h:391
bool doesNotAccessMemory(const CallBase *Call)
Checks if the specified call is known to never read or write memory.
Definition AliasAnalysis.h:458
bool isNoAlias(const Value *V1, LocationSize V1Size, const Value *V2, LocationSize V2Size)
A convenience wrapper around the isNoAlias helper interface.
Definition AliasAnalysis.h:378
LLVM_ABI AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
The main low level interface to the alias analysis implementation.
friend class BatchAAResults
Definition AliasAnalysis.h:648
ModRefInfo getModRefInfo(const Instruction *I, const Value *P, LocationSize Size)
A convenience wrapper for constructing the memory location.
Definition AliasAnalysis.h:520
bool canBasicBlockModify(const BasicBlock &BB, const Value *P, LocationSize Size)
A convenience wrapper synthesizing a memory location.
Definition AliasAnalysis.h:561
LLVM_ABI ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, bool IgnoreLocals=false)
Returns a bitmask that should be unconditionally applied to the ModRef info of a memory location.
bool isNoAlias(const Value *V1, const Value *V2)
A convenience wrapper around the isNoAlias helper interface.
Definition AliasAnalysis.h:384
bool onlyReadsMemory(const Function *F)
Checks if the specified function is known to only read from non-volatile memory (or not access memory...
Definition AliasAnalysis.h:499
ModRefInfo callCapturesBefore(const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
Return information about whether a particular call site modifies or reads the specified memory locati...
Definition AliasAnalysis.h:537
LLVM_ABI AAResults(const TargetLibraryInfo &TLI)
LLVM_ABI MemoryEffects getMemoryEffects(const CallBase *Call)
Return the behavior of the given call site.
bool isNoAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
A trivial helper function to check to see if the specified pointers are no-alias.
Definition AliasAnalysis.h:373
ModRefInfo getModRefInfoMask(const Value *P, bool IgnoreLocals=false)
A convenience wrapper around the primary getModRefInfoMask interface.
Definition AliasAnalysis.h:430
LLVM_ABI bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
Handle invalidation events in the new pass manager.
LLVM_ABI ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)
Get the ModRef info associated with a pointer argument of a call.
bool onlyReadsMemory(const CallBase *Call)
Checks if the specified call is known to only read from non-volatile memory (or not access memory at ...
Definition AliasAnalysis.h:486
LLVM_ABI bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2, const MemoryLocation &Loc, const ModRefInfo Mode)
Check if it is possible for the execution of the specified instructions to mod(according to the mode)...
bool isMustAlias(const Value *V1, const Value *V2)
A convenience wrapper around the isMustAlias helper interface.
Definition AliasAnalysis.h:396
LLVM_ABI AliasResult aliasErrno(const MemoryLocation &Loc, const Module *M)
void addAAResult(AAResultT &AAResult)
Register a specific AA result.
Definition AliasAnalysis.h:327
void addAADependencyID(AnalysisKey *ID)
Register a function analysis ID that the results aggregation depends on.
Definition AliasAnalysis.h:339
ModRefInfo callCapturesBefore(const Instruction *I, const Value *P, LocationSize Size, DominatorTree *DT)
A convenience wrapper to synthesize a memory location.
Definition AliasAnalysis.h:545
LLVM_ABI bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc)
Check if it is possible for execution of the specified basic block to modify the location Loc.
The possible results of an alias query.
Definition AliasAnalysis.h:78
constexpr AliasResult(const Kind &Alias)
Definition AliasAnalysis.h:109
bool operator==(const AliasResult &Other) const
Definition AliasAnalysis.h:114
bool operator!=(Kind K) const
Definition AliasAnalysis.h:121
void swap(bool DoSwap=true)
Helper for processing AliasResult for swapped memory location pairs.
Definition AliasAnalysis.h:136
bool operator==(Kind K) const
Definition AliasAnalysis.h:120
Kind
Definition AliasAnalysis.h:90
@ MayAlias
The two locations may or may not alias.
Definition AliasAnalysis.h:99
@ NoAlias
The two locations do not alias at all.
Definition AliasAnalysis.h:96
@ PartialAlias
The two locations alias, but only due to a partial overlap.
Definition AliasAnalysis.h:101
@ MustAlias
The two locations precisely alias each other.
Definition AliasAnalysis.h:103
void setOffset(int32_t NewOffset)
Definition AliasAnalysis.h:128
bool operator!=(const AliasResult &Other) const
Definition AliasAnalysis.h:118
constexpr int32_t getOffset() const
Definition AliasAnalysis.h:124
constexpr bool hasOffset() const
Definition AliasAnalysis.h:123
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
An instruction that atomically checks whether a specified value is in a memory location,...
an instruction that atomically reads a memory location, combines it with another value,...
LLVM Basic Block Representation.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
Definition AliasAnalysis.h:667
BatchAAResults(AAResults &AAR)
Definition AliasAnalysis.h:663
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)
Definition AliasAnalysis.h:687
void disableDominatorTree()
Disable the use of the dominator tree during alias analysis queries.
Definition AliasAnalysis.h:716
BatchAAResults(AAResults &AAR, CaptureAnalysis *CA)
Definition AliasAnalysis.h:664
void enableCrossIterationMode()
Assume that values may come from different cycle iterations.
Definition AliasAnalysis.h:711
bool isMustAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
Definition AliasAnalysis.h:693
ModRefInfo getModRefInfo(const Instruction *I, const CallBase *Call2)
Definition AliasAnalysis.h:684
bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal=false)
Definition AliasAnalysis.h:670
bool isNoAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
Definition AliasAnalysis.h:701
MemoryEffects getMemoryEffects(const CallBase *Call)
Definition AliasAnalysis.h:690
bool isMustAlias(const Value *V1, const Value *V2)
Definition AliasAnalysis.h:696
ModRefInfo getModRefInfo(const Instruction *I, const std::optional< MemoryLocation > &OptLoc)
Definition AliasAnalysis.h:680
bool pointsToConstantMemory(const Value *P, bool OrLocal=false)
Definition AliasAnalysis.h:673
ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, bool IgnoreLocals=false)
Definition AliasAnalysis.h:676
ModRefInfo callCapturesBefore(const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
Definition AliasAnalysis.h:704
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
EarliestEscapeAnalysis(DominatorTree &DT, const LoopInfo *LI=nullptr)
Definition AliasAnalysis.h:192
An instruction for ordering other memory operations.
ImmutablePass class - This class is used to provide information that does not need to be run.
An instruction for reading from memory.
static LocationSize precise(uint64_t Value)
bool doesNotAccessMemory() const
Whether this function accesses no memory.
bool onlyReadsMemory() const
Whether this function only (at most) reads memory.
static MemoryEffectsBase unknown()
Representation for a specific memory location.
static MemoryLocation getBeforeOrAfter(const Value *Ptr, const AAMDNodes &AATags=AAMDNodes())
Return a location that may access any location before or after Ptr, while remaining within the underl...
A Module instance is used to store all the information related to an LLVM module.
Pass interface - Implemented by all 'passes'.
PointerIntPair - This class implements a pair of a pointer and small integer.
A set of analyses that are preserved following a run of a transformation pass.
AAQueryInfo that uses SimpleCaptureAnalysis.
Definition AliasAnalysis.h:309
SimpleAAQueryInfo(AAResults &AAR)
Definition AliasAnalysis.h:313
Context-free CaptureAnalysis provider, which computes and caches whether an object is captured in the...
Definition AliasAnalysis.h:164
CaptureComponents getCapturesBefore(const Value *Object, const Instruction *I, bool OrAt) override
Return how Object may be captured before instruction I, considering only provenance captures.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An instruction for storing to memory.
Provides information about what library functions are available for the current target.
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
LLVM Value Representation.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI bool isBaseOfObject(const Value *V)
Return true if we know V to the base address of the corresponding memory object.
LLVM_ABI bool isNoAliasCall(const Value *V)
Return true if this pointer is returned by a noalias function.
MemoryEffectsBase< IRMemLocation > MemoryEffects
Summary of how a function affects memory in the program.
LLVM_ABI bool isNotVisibleOnUnwind(const Value *Object, bool &RequiresNoCaptureBeforeUnwind)
Return true if Object memory is not visible after an unwind, in the sense that program semantics cann...
CaptureComponents
Components of the pointer that may be captured.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
@ ModRef
The access may reference and may modify the value stored in memory.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
LLVM_ABI bool isIdentifiedFunctionLocal(const Value *V)
Return true if V is umabigously identified at the function-level.
LLVM_ABI bool isEscapeSource(const Value *V)
Returns true if the pointer is one which would have been considered an escape by isNotCapturedBefore.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
AAResults AliasAnalysis
Temporary typedef for legacy code that uses a generic AliasAnalysis pointer or reference.
Definition AliasAnalysis.h:721
bool isNoModRef(const ModRefInfo MRI)
LLVM_ABI bool isIdentifiedObject(const Value *V)
Return true if this pointer refers to a distinct and identifiable object.
LLVM_ABI bool isWritableObject(const Value *Object, bool &ExplicitlyDereferenceableOnly)
Return true if the Object is writable, in the sense that any location based on this pointer that can ...
LLVM_ABI ImmutablePass * createExternalAAWrapperPass(std::function< void(Pass &, Function &, AAResults &)> Callback)
A wrapper pass around a callback which can be used to populate the AAResults in the AAResultsWrapperP...
Cache key for BasicAA results.
Definition AliasAnalysis.h:204
PointerIntPair< const Value *, 1, bool > PtrTy
Definition AliasAnalysis.h:205
PtrTy Ptr
Definition AliasAnalysis.h:206
AACacheLoc(const Value *Ptr, LocationSize Size, bool MayBeCrossIteration)
Definition AliasAnalysis.h:210
LocationSize Size
Definition AliasAnalysis.h:207
AACacheLoc(PtrTy Ptr, LocationSize Size)
Definition AliasAnalysis.h:209
Definition AliasAnalysis.h:245
bool isAssumption() const
Whether this is an assumption that has not been proven yet.
Definition AliasAnalysis.h:262
bool isDefinitive() const
Whether this is a definitive (non-assumption) result.
Definition AliasAnalysis.h:260
static constexpr int Definitive
Cache entry is neither an assumption nor does it use a (non-definitive) assumption.
Definition AliasAnalysis.h:248
AliasResult Result
Definition AliasAnalysis.h:253
static constexpr int AssumptionBased
Cache entry is not an assumption itself, but may be using an assumption from higher up the stack.
Definition AliasAnalysis.h:251
int NumAssumptionUses
Number of times a NoAlias assumption has been used, 0 for assumptions that have not been used.
Definition AliasAnalysis.h:257
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
Virtual base class for providers of capture analysis.
Definition AliasAnalysis.h:149
virtual CaptureComponents getCapturesBefore(const Value *Object, const Instruction *I, bool OrAt)=0
Return how Object may be captured before instruction I, considering only provenance captures.
virtual ~CaptureAnalysis()=0
static AACacheLoc getEmptyKey()
Definition AliasAnalysis.h:215
static bool isEqual(const AACacheLoc &LHS, const AACacheLoc &RHS)
Definition AliasAnalysis.h:227
static unsigned getHashValue(const AACacheLoc &Val)
Definition AliasAnalysis.h:223
static AACacheLoc getTombstoneKey()
Definition AliasAnalysis.h:219
An information struct used to provide DenseMap with the various necessary components for a given valu...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition AliasAnalysis.h:1068
std::function< void(Pass &, Function &, AAResults &)> CallbackT
Definition AliasAnalysis.h:1041
LLVM_ABI ExternalAAWrapperPass()
static LLVM_ABI char ID
Definition AliasAnalysis.h:1045
CallbackT CB
Definition AliasAnalysis.h:1043
bool RunEarly
Flag indicating whether this external AA should run before Basic AA.
Definition AliasAnalysis.h:1066