LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SystemZInstrBuilder.h
Go to the documentation of this file.
1 //===-- SystemZInstrBuilder.h - Functions to aid building insts -*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file exposes functions that may be used with BuildMI from the
11 // MachineInstrBuilder.h file to handle SystemZ'isms in a clean way.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef SYSTEMZINSTRBUILDER_H
16 #define SYSTEMZINSTRBUILDER_H
17 
22 
23 namespace llvm {
24 
25 /// Add a BDX memory reference for frame object FI to MIB.
26 static inline const MachineInstrBuilder &
28  MachineInstr *MI = MIB;
29  MachineFunction &MF = *MI->getParent()->getParent();
30  MachineFrameInfo *MFFrame = MF.getFrameInfo();
31  const MCInstrDesc &MCID = MI->getDesc();
32  unsigned Flags = 0;
33  if (MCID.mayLoad())
35  if (MCID.mayStore())
37  int64_t Offset = 0;
38  MachineMemOperand *MMO =
41  Flags, MFFrame->getObjectSize(FI),
42  MFFrame->getObjectAlignment(FI));
43  return MIB.addFrameIndex(FI).addImm(Offset).addReg(0).addMemOperand(MMO);
44 }
45 
46 } // End llvm namespace
47 
48 #endif
The memory access reads data.
const MachineFunction * getParent() const
The memory access writes data.
bool mayStore() const
Return true if this instruction could possibly modify memory. Instructions with this flag set are not...
Definition: MCInstrDesc.h:376
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, unsigned f, uint64_t s, unsigned base_alignment, const MDNode *TBAAInfo=0, const MDNode *Ranges=0)
const MCInstrDesc & getDesc() const
Definition: MachineInstr.h:257
Abstract Stack Frame Information.
static const PseudoSourceValue * getFixedStack(int FI)
const MachineInstrBuilder & addImm(int64_t Val) const
const MachineBasicBlock * getParent() const
Definition: MachineInstr.h:119
static const MachineInstrBuilder & addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset=0, bool mem=true)
unsigned getObjectAlignment(int ObjectIdx) const
getObjectAlignment - Return the alignment of the specified stack object.
bool mayLoad() const
Return true if this instruction could possibly read memory. Instructions with this flag set are not n...
Definition: MCInstrDesc.h:367
MachineFrameInfo * getFrameInfo()
const MachineInstrBuilder & addFrameIndex(int Idx) const
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
int64_t getObjectSize(int ObjectIdx) const