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
36 InterestingMemoryOperand(Instruction *I, unsigned OperandNo, bool IsWrite,
38 Value *MaybeMask = nullptr,
39 Value *MaybeEVL = nullptr,
40 Value *MaybeStride = nullptr)
43 const DataLayout &DL = I->getDataLayout();
44 TypeStoreSize = DL.getTypeStoreSizeInBits(OpType);
45 PtrUse = &I->getOperandUse(OperandNo);
46 }
47
48 Instruction *getInsn() { return cast<Instruction>(PtrUse->getUser()); }
49
50 Value *getPtr() { return PtrUse->get(); }
51};
52
53} // namespace llvm
54
55#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)
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:117