LLVM: lib/Analysis/PtrUseVisitor.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

17

18using namespace llvm;

19

21 for (Use &U : I.uses()) {

26 };

27 Worklist.push_back(std::move(NewU));

28 }

29 }

30}

31

34 return false;

35

36 APInt TmpOffset(DL.getIndexTypeSizeInBits(GEPI.getType()), 0);

39 return true;

40 }

41

42 return false;

43}

This file provides a collection of visitors which walk the (instruction) uses of a pointer.

Class for arbitrary precision integers.

LLVM_ABI APInt sextOrTrunc(unsigned width) const

Sign extend or truncate to width.

an instruction for type-safe pointer arithmetic to access elements of arrays and structs

LLVM_ABI bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const

Accumulate the constant address offset of this GEP if possible.

A Use represents the edge between a Value definition and its users.

LLVM Value Representation.

Type * getType() const

All values are typed, get the type of this value.

APInt Offset

The constant offset of the use if that is known.

void enqueueUsers(Value &I)

Enqueue the users of this instruction in the visit worklist.

Definition PtrUseVisitor.cpp:20

SmallVector< UseToVisit, 8 > Worklist

The worklist of to-visit uses.

bool IsOffsetKnown

True if we have a known constant offset for the use currently being visited.

bool adjustOffsetForGEP(GetElementPtrInst &GEPI)

Walk the operands of a GEP and adjust the offset as appropriate.

Definition PtrUseVisitor.cpp:32

Use * U

The use currently being visited.

SmallPtrSet< Use *, 8 > VisitedUses

A set of visited uses to break cycles in unreachable code.

This is an optimization pass for GlobalISel generic memory operations.

A struct of the data needed to visit a particular use.

PointerIntPair< Use *, 1, bool > UseAndIsOffsetKnownPair