Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
InterestingMemoryOperand.h
Go to the documentation of this file.
1//===- InterestingMemoryOperand.h -------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines InterestingMemoryOperand class that is used when getting
10// the information of a memory reference instruction.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_ANALYSIS_INTERESTINGMEMORYOPERAND_H
15#define LLVM_ANALYSIS_INTERESTINGMEMORYOPERAND_H
16
17#include "llvm/IR/DataLayout.h"
18#include "llvm/IR/Instruction.h"
20
21namespace llvm {
23public:
25 bool IsWrite;
29 // The mask Value, if we're looking at a masked load/store.
31 // The EVL Value, if we're looking at a vp intrinsic.
33 // The Stride Value, if we're looking at a strided load/store.
35 // The Offset Value, if we're looking at a indexed load/store. The
36 // offset actually means byte-offset instead of array index.
38
39 InterestingMemoryOperand(Instruction *I, unsigned OperandNo, bool IsWrite,
41 Value *MaybeMask = nullptr,
42 Value *MaybeEVL = nullptr,
43 Value *MaybeStride = nullptr,
44 Value *MaybeByteOffset = nullptr)
48 const DataLayout &DL = I->getDataLayout();
49 TypeStoreSize = DL.getTypeStoreSizeInBits(OpType);
50 PtrUse = &I->getOperandUse(OperandNo);
51 }
52
53 Instruction *getInsn() { return cast<Instruction>(PtrUse->getUser()); }
54
55 Value *getPtr() { return PtrUse->get(); }
56};
57
58} // namespace llvm
59
60#endif // LLVM_ANALYSIS_INTERESTINGMEMORYOPERAND_H
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define I(x, y, z)
Definition MD5.cpp:58
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:63
InterestingMemoryOperand(Instruction *I, unsigned OperandNo, bool IsWrite, class Type *OpType, MaybeAlign Alignment, Value *MaybeMask=nullptr, Value *MaybeEVL=nullptr, Value *MaybeStride=nullptr, Value *MaybeByteOffset=nullptr)
static constexpr TypeSize getFixed(ScalarTy ExactSize)
Definition TypeSize.h:343
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
A Use represents the edge between a Value definition and its users.
Definition Use.h:35
LLVM Value Representation.
Definition Value.h:75
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:565
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition Alignment.h:106