Skip to content

Commit 122f3bf

Browse files
Vidush Singhalvidsinghal
authored andcommitted
[Attributor]: Change allocation size and load/store offsets using AAPointerInfo for Alloca instructions
1 parent 0edfd87 commit 122f3bf

File tree

15 files changed

+644
-137
lines changed

15 files changed

+644
-137
lines changed

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5827,8 +5827,10 @@ struct AANonConvergent : public StateWrapper<BooleanState, AbstractAttribute> {
58275827

58285828
/// An abstract interface for struct information.
58295829
struct AAPointerInfo : public AbstractAttribute {
5830+
protected:
58305831
AAPointerInfo(const IRPosition &IRP) : AbstractAttribute(IRP) {}
58315832

5833+
public:
58325834
/// See AbstractAttribute::isValidIRPositionForInit
58335835
static bool isValidIRPositionForInit(Attributor &A, const IRPosition &IRP) {
58345836
if (!IRP.getAssociatedType()->isPtrOrPtrVectorTy())
@@ -6385,6 +6387,9 @@ struct AAPointerInfo : public AbstractAttribute {
63856387
virtual int64_t numOffsetBins() const = 0;
63866388
virtual bool reachesReturn() const = 0;
63876389
virtual void addReturnedOffsetsTo(OffsetInfo &) const = 0;
6390+
virtual void dumpState(raw_ostream &O) const = 0;
6391+
virtual const Access &getBinAccess(unsigned Index) const = 0;
6392+
virtual const DenseMap<Value *, OffsetInfo> &getOffsetInfoMap() const = 0;
63886393

63896394
/// Call \p CB on all accesses that might interfere with \p Range and return
63906395
/// true if all such accesses were known and the callback returned true for
@@ -6639,6 +6644,9 @@ struct AAAllocationInfo : public StateWrapper<BooleanState, AbstractAttribute> {
66396644

66406645
virtual std::optional<TypeSize> getAllocatedSize() const = 0;
66416646

6647+
using NewOffsetsTy = DenseMap<AA::RangeTy, AA::RangeTy>;
6648+
virtual const NewOffsetsTy &getNewOffsets() const = 0;
6649+
66426650
/// See AbstractAttribute::getName()
66436651
StringRef getName() const override { return "AAAllocationInfo"; }
66446652

0 commit comments

Comments
 (0)