LLVM 22.0.0git
RISCVInstrInfo.h
Go to the documentation of this file.
1//===-- RISCVInstrInfo.h - RISC-V Instruction Information -------*- 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 contains the RISC-V implementation of the TargetInstrInfo class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_RISCV_RISCVINSTRINFO_H
14#define LLVM_LIB_TARGET_RISCV_RISCVINSTRINFO_H
15
16#include "RISCV.h"
17#include "RISCVRegisterInfo.h"
20
21#define GET_INSTRINFO_HEADER
22#define GET_INSTRINFO_OPERAND_ENUM
23#include "RISCVGenInstrInfo.inc"
24#include "RISCVGenRegisterInfo.inc"
25
26namespace llvm {
27
28// If Value is of the form C1<<C2, where C1 = 3, 5 or 9,
29// returns log2(C1 - 1) and assigns Shift = C2.
30// Otherwise, returns 0.
31template <typename T> int isShifted359(T Value, int &Shift) {
32 if (Value == 0)
33 return 0;
34 Shift = llvm::countr_zero(Value);
35 switch (Value >> Shift) {
36 case 3:
37 return 1;
38 case 5:
39 return 2;
40 case 9:
41 return 3;
42 default:
43 return 0;
44 }
45}
46
47class RISCVSubtarget;
48
53
54namespace RISCVCC {
55
65
66CondCode getInverseBranchCondition(CondCode);
67unsigned getBrCond(CondCode CC, unsigned SelectOpc = 0);
68
69} // end of namespace RISCVCC
70
71// RISCV MachineCombiner patterns
80
82
83public:
84 explicit RISCVInstrInfo(const RISCVSubtarget &STI);
85
86 MCInst getNop() const override;
87
89 int &FrameIndex) const override;
90 Register isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex,
91 TypeSize &MemBytes) const override;
93 int &FrameIndex) const override;
94 Register isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex,
95 TypeSize &MemBytes) const override;
96
97 bool isReMaterializableImpl(const MachineInstr &MI) const override;
98
100 return MI.getOpcode() == RISCV::ADDI && MI.getOperand(1).isReg() &&
101 MI.getOperand(1).getReg() == RISCV::X0;
102 }
103
106 MCRegister DstReg, MCRegister SrcReg, bool KillSrc,
107 const TargetRegisterClass *RegClass) const;
109 const DebugLoc &DL, Register DstReg, Register SrcReg,
110 bool KillSrc, bool RenamableDest = false,
111 bool RenamableSrc = false) const override;
112
115 bool IsKill, int FrameIndex, const TargetRegisterClass *RC,
116 const TargetRegisterInfo *TRI, Register VReg,
117 MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;
118
121 int FrameIndex, const TargetRegisterClass *RC,
122 const TargetRegisterInfo *TRI, Register VReg,
123 MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;
124
129 int FrameIndex,
130 LiveIntervals *LIS = nullptr,
131 VirtRegMap *VRM = nullptr) const override;
132
133 // Materializes the given integer Val into DstReg.
135 const DebugLoc &DL, Register DstReg, uint64_t Val,
137 bool DstRenamable = false, bool DstIsDead = false) const;
138
139 unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
140
142 MachineBasicBlock *&FBB,
144 bool AllowModify) const override;
145
148 const DebugLoc &dl,
149 int *BytesAdded = nullptr) const override;
150
152 MachineBasicBlock &NewDestBB,
153 MachineBasicBlock &RestoreBB, const DebugLoc &DL,
154 int64_t BrOffset, RegScavenger *RS) const override;
155
157 int *BytesRemoved = nullptr) const override;
158
159 bool
161
162 bool optimizeCondBranch(MachineInstr &MI) const override;
163
164 MachineBasicBlock *getBranchDestBlock(const MachineInstr &MI) const override;
165
166 bool isBranchOffsetInRange(unsigned BranchOpc,
167 int64_t BrOffset) const override;
168
169 bool analyzeSelect(const MachineInstr &MI,
170 SmallVectorImpl<MachineOperand> &Cond, unsigned &TrueOp,
171 unsigned &FalseOp, bool &Optimizable) const override;
172
175 bool) const override;
176
177 bool isAsCheapAsAMove(const MachineInstr &MI) const override;
178
179 std::optional<DestSourcePair>
180 isCopyInstrImpl(const MachineInstr &MI) const override;
181
183 StringRef &ErrInfo) const override;
184
186 const MachineInstr &AddrI,
187 ExtAddrMode &AM) const override;
188
190 const ExtAddrMode &AM) const override;
191
194 int64_t &Offset, bool &OffsetIsScalable, LocationSize &Width,
195 const TargetRegisterInfo *TRI) const override;
196
198 int64_t Offset1, bool OffsetIsScalable1,
200 int64_t Offset2, bool OffsetIsScalable2,
201 unsigned ClusterSize,
202 unsigned NumBytes) const override;
203
205 const MachineOperand *&BaseOp,
206 int64_t &Offset, LocationSize &Width,
207 const TargetRegisterInfo *TRI) const;
208
210 const MachineInstr &MIb) const override;
211
212
213 std::pair<unsigned, unsigned>
214 decomposeMachineOperandsTargetFlags(unsigned TF) const override;
215
218
219 // Return true if the function can safely be outlined from.
221 bool OutlineFromLinkOnceODRs) const override;
222
223 // Return true if MBB is safe to outline from, and return any target-specific
224 // information in Flags.
226 unsigned &Flags) const override;
227
229
230 // Calculate target-specific information for a set of outlining candidates.
231 std::optional<std::unique_ptr<outliner::OutlinedFunction>>
233 const MachineModuleInfo &MMI,
234 std::vector<outliner::Candidate> &RepeatedSequenceLocs,
235 unsigned MinRepeats) const override;
236
237 // Return if/how a given MachineInstr should be outlined.
240 unsigned Flags) const override;
241
242 // Insert a custom frame for outlined functions.
244 const outliner::OutlinedFunction &OF) const override;
245
246 // Insert a call to an outlined function into a given basic block.
250 outliner::Candidate &C) const override;
251
252 std::optional<RegImmPair> isAddImmediate(const MachineInstr &MI,
253 Register Reg) const override;
254
255 bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx1,
256 unsigned &SrcOpIdx2) const override;
258 unsigned OpIdx1,
259 unsigned OpIdx2) const override;
260
261 bool simplifyInstruction(MachineInstr &MI) const override;
262
264 LiveIntervals *LIS) const override;
265
266 // MIR printer helper function to annotate Operands with a comment.
267 std::string
269 unsigned OpIdx,
270 const TargetRegisterInfo *TRI) const override;
271
272 /// Generate code to multiply the value in DestReg by Amt - handles all
273 /// the common optimizations for this idiom, and supports fallback for
274 /// subtargets which don't support multiply instructions.
277 Register DestReg, uint32_t Amt, MachineInstr::MIFlag Flag) const;
278
279 bool useMachineCombiner() const override { return true; }
280
282
283 CombinerObjective getCombinerObjective(unsigned Pattern) const override;
284
287 bool DoRegPressureReduce) const override;
288
289 void
290 finalizeInsInstrs(MachineInstr &Root, unsigned &Pattern,
291 SmallVectorImpl<MachineInstr *> &InsInstrs) const override;
292
294 MachineInstr &Root, unsigned Pattern,
297 DenseMap<Register, unsigned> &InstrIdxForVirtReg) const override;
298
299 bool hasReassociableOperands(const MachineInstr &Inst,
300 const MachineBasicBlock *MBB) const override;
301
302 bool hasReassociableSibling(const MachineInstr &Inst,
303 bool &Commuted) const override;
304
306 bool Invert) const override;
307
308 std::optional<unsigned> getInverseOpcode(unsigned Opcode) const override;
309
311 const MachineInstr &Root, unsigned Pattern,
312 std::array<unsigned, 5> &OperandIndices) const override;
313
316
317 unsigned getTailDuplicateSize(CodeGenOptLevel OptLevel) const override;
318
319 std::unique_ptr<TargetInstrInfo::PipelinerLoopInfo>
320 analyzeLoopForPipelining(MachineBasicBlock *LoopBB) const override;
321
322 bool isHighLatencyDef(int Opc) const override;
323
324 /// Return true if pairing the given load or store may be paired with another.
325 static bool isPairableLdStInstOpc(unsigned Opc);
326
327 static bool isLdStSafeToPair(const MachineInstr &LdSt,
328 const TargetRegisterInfo *TRI);
329#define GET_INSTRINFO_HELPER_DECLS
330#include "RISCVGenInstrInfo.inc"
331
333
334 /// Return the result of the evaluation of C0 CC C1, where CC is a
335 /// RISCVCC::CondCode.
336 static bool evaluateCondBranch(RISCVCC::CondCode CC, int64_t C0, int64_t C1);
337
338 /// Return true if the operand is a load immediate instruction and
339 /// sets Imm to the immediate value.
340 static bool isFromLoadImm(const MachineRegisterInfo &MRI,
341 const MachineOperand &Op, int64_t &Imm);
342
343protected:
345
346private:
347 unsigned getInstBundleLength(const MachineInstr &MI) const;
348
349 bool isVectorAssociativeAndCommutative(const MachineInstr &MI,
350 bool Invert = false) const;
351 bool areRVVInstsReassociable(const MachineInstr &MI1,
352 const MachineInstr &MI2) const;
353 bool hasReassociableVectorSibling(const MachineInstr &Inst,
354 bool &Commuted) const;
355};
356
357namespace RISCV {
358
359// Returns true if the given MI is an RVV instruction opcode for which we may
360// expect to see a FrameIndex operand.
361bool isRVVSpill(const MachineInstr &MI);
362
363std::optional<std::pair<unsigned, unsigned>>
364isRVVSpillForZvlsseg(unsigned Opcode);
365
366// Return true if both input instructions have equal rounding mode. If at least
367// one of the instructions does not have rounding mode, false will be returned.
368bool hasEqualFRM(const MachineInstr &MI1, const MachineInstr &MI2);
369
370// If \p Opcode is a .vx vector instruction, returns the lower number of bits
371// that are used from the scalar .x operand for a given \p Log2SEW. Otherwise
372// returns null.
373std::optional<unsigned> getVectorLowDemandedScalarBits(unsigned Opcode,
374 unsigned Log2SEW);
375
376// Returns the MC opcode of RVV pseudo instruction.
377unsigned getRVVMCOpcode(unsigned RVVPseudoOpcode);
378
379// For a (non-pseudo) RVV instruction \p Desc and the given \p Log2SEW, returns
380// the log2 EEW of the destination operand.
381unsigned getDestLog2EEW(const MCInstrDesc &Desc, unsigned Log2SEW);
382
383// Special immediate for AVL operand of V pseudo instructions to indicate VLMax.
384static constexpr int64_t VLMaxSentinel = -1LL;
385
386/// Given two VL operands, do we know that LHS <= RHS?
387bool isVLKnownLE(const MachineOperand &LHS, const MachineOperand &RHS);
388
389// Mask assignments for floating-point
390static constexpr unsigned FPMASK_Negative_Infinity = 0x001;
391static constexpr unsigned FPMASK_Negative_Normal = 0x002;
392static constexpr unsigned FPMASK_Negative_Subnormal = 0x004;
393static constexpr unsigned FPMASK_Negative_Zero = 0x008;
394static constexpr unsigned FPMASK_Positive_Zero = 0x010;
395static constexpr unsigned FPMASK_Positive_Subnormal = 0x020;
396static constexpr unsigned FPMASK_Positive_Normal = 0x040;
397static constexpr unsigned FPMASK_Positive_Infinity = 0x080;
398static constexpr unsigned FPMASK_Signaling_NaN = 0x100;
399static constexpr unsigned FPMASK_Quiet_NaN = 0x200;
400} // namespace RISCV
401
402namespace RISCVVPseudosTable {
403
408
409#define GET_RISCVVPseudosTable_DECL
410#include "RISCVGenSearchableTables.inc"
411
412} // end namespace RISCVVPseudosTable
413
414namespace RISCV {
415
421#define GET_RISCVMaskedPseudosTable_DECL
422#include "RISCVGenSearchableTables.inc"
423} // end namespace RISCV
424
425} // end namespace llvm
426#endif
unsigned const MachineRegisterInfo * MRI
SmallVector< int16_t, MAX_SRC_OPERANDS_NUM > OperandIndices
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
IRTranslator LLVM IR MI
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
Register Reg
Register const TargetRegisterInfo * TRI
#define T
MachineInstr unsigned OpIdx
uint64_t IntrinsicInst * II
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
Value * RHS
Value * LHS
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
A debug info location.
Definition DebugLoc.h:124
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
Describe properties that are true of each instruction in the target description file.
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:33
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
Flags
Flags values. These may be or'd together.
This class contains meta information specific to a module.
MachineOperand class - Representation of each machine instruction operand.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
MachineInstr * convertToThreeAddress(MachineInstr &MI, LiveVariables *LV, LiveIntervals *LIS) const override
Register isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
std::optional< std::unique_ptr< outliner::OutlinedFunction > > getOutliningCandidateInfo(const MachineModuleInfo &MMI, std::vector< outliner::Candidate > &RepeatedSequenceLocs, unsigned MinRepeats) const override
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
void genAlternativeCodeSequence(MachineInstr &Root, unsigned Pattern, SmallVectorImpl< MachineInstr * > &InsInstrs, SmallVectorImpl< MachineInstr * > &DelInstrs, DenseMap< Register, unsigned > &InstrIdxForVirtReg) const override
void movImm(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, Register DstReg, uint64_t Val, MachineInstr::MIFlag Flag=MachineInstr::NoFlags, bool DstRenamable=false, bool DstIsDead=false) const
MachineInstr * emitLdStWithAddr(MachineInstr &MemI, const ExtAddrMode &AM) const override
void mulImm(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator II, const DebugLoc &DL, Register DestReg, uint32_t Amt, MachineInstr::MIFlag Flag) const
Generate code to multiply the value in DestReg by Amt - handles all the common optimizations for this...
static bool isPairableLdStInstOpc(unsigned Opc)
Return true if pairing the given load or store may be paired with another.
RISCVInstrInfo(const RISCVSubtarget &STI)
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool IsKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
bool isFunctionSafeToOutlineFrom(MachineFunction &MF, bool OutlineFromLinkOnceODRs) const override
std::unique_ptr< TargetInstrInfo::PipelinerLoopInfo > analyzeLoopForPipelining(MachineBasicBlock *LoopBB) const override
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &dl, int *BytesAdded=nullptr) const override
bool hasReassociableSibling(const MachineInstr &Inst, bool &Commuted) const override
static bool isLdStSafeToPair(const MachineInstr &LdSt, const TargetRegisterInfo *TRI)
void copyPhysRegVector(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, MCRegister DstReg, MCRegister SrcReg, bool KillSrc, const TargetRegisterClass *RegClass) const
bool isReMaterializableImpl(const MachineInstr &MI) const override
MachineInstr * optimizeSelect(MachineInstr &MI, SmallPtrSetImpl< MachineInstr * > &SeenMIs, bool) const override
bool canFoldIntoAddrMode(const MachineInstr &MemI, Register Reg, const MachineInstr &AddrI, ExtAddrMode &AM) const override
void insertIndirectBranch(MachineBasicBlock &MBB, MachineBasicBlock &NewDestBB, MachineBasicBlock &RestoreBB, const DebugLoc &DL, int64_t BrOffset, RegScavenger *RS) const override
bool isAsCheapAsAMove(const MachineInstr &MI) const override
bool verifyInstruction(const MachineInstr &MI, StringRef &ErrInfo) const override
bool getMemOperandWithOffsetWidth(const MachineInstr &LdSt, const MachineOperand *&BaseOp, int64_t &Offset, LocationSize &Width, const TargetRegisterInfo *TRI) const
unsigned getTailDuplicateSize(CodeGenOptLevel OptLevel) const override
void getReassociateOperandIndices(const MachineInstr &Root, unsigned Pattern, std::array< unsigned, 5 > &OperandIndices) const override
const RISCVSubtarget & STI
bool useMachineCombiner() const override
Register isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
std::optional< unsigned > getInverseOpcode(unsigned Opcode) const override
bool simplifyInstruction(MachineInstr &MI) const override
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
outliner::InstrType getOutliningTypeImpl(const MachineModuleInfo &MMI, MachineBasicBlock::iterator &MBBI, unsigned Flags) const override
MachineTraceStrategy getMachineCombinerTraceStrategy() const override
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
std::optional< RegImmPair > isAddImmediate(const MachineInstr &MI, Register Reg) const override
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
ArrayRef< std::pair< MachineMemOperand::Flags, const char * > > getSerializableMachineMemOperandTargetFlags() const override
MCInst getNop() const override
MachineInstr * foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS=nullptr, VirtRegMap *VRM=nullptr) const override
bool isMBBSafeToOutlineFrom(MachineBasicBlock &MBB, unsigned &Flags) const override
bool getMemOperandsWithOffsetWidth(const MachineInstr &MI, SmallVectorImpl< const MachineOperand * > &BaseOps, int64_t &Offset, bool &OffsetIsScalable, LocationSize &Width, const TargetRegisterInfo *TRI) const override
void buildOutlinedFrame(MachineBasicBlock &MBB, MachineFunction &MF, const outliner::OutlinedFunction &OF) const override
void finalizeInsInstrs(MachineInstr &Root, unsigned &Pattern, SmallVectorImpl< MachineInstr * > &InsInstrs) const override
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
MachineInstr * commuteInstructionImpl(MachineInstr &MI, bool NewMI, unsigned OpIdx1, unsigned OpIdx2) const override
bool shouldBreakCriticalEdgeToSink(MachineInstr &MI) const override
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DstReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
bool hasReassociableOperands(const MachineInstr &Inst, const MachineBasicBlock *MBB) const override
MachineBasicBlock * getBranchDestBlock(const MachineInstr &MI) const override
std::string createMIROperandComment(const MachineInstr &MI, const MachineOperand &Op, unsigned OpIdx, const TargetRegisterInfo *TRI) const override
bool shouldOutlineFromFunctionByDefault(MachineFunction &MF) const override
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, Register DstReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx1, unsigned &SrcOpIdx2) const override
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
MachineBasicBlock::iterator insertOutlinedCall(Module &M, MachineBasicBlock &MBB, MachineBasicBlock::iterator &It, MachineFunction &MF, outliner::Candidate &C) const override
bool isBranchOffsetInRange(unsigned BranchOpc, int64_t BrOffset) const override
static RISCVCC::CondCode getCondFromBranchOpc(unsigned Opc)
bool isAssociativeAndCommutative(const MachineInstr &Inst, bool Invert) const override
CombinerObjective getCombinerObjective(unsigned Pattern) const override
bool isHighLatencyDef(int Opc) const override
static bool evaluateCondBranch(RISCVCC::CondCode CC, int64_t C0, int64_t C1)
Return the result of the evaluation of C0 CC C1, where CC is a RISCVCC::CondCode.
bool getMachineCombinerPatterns(MachineInstr &Root, SmallVectorImpl< unsigned > &Patterns, bool DoRegPressureReduce) const override
bool optimizeCondBranch(MachineInstr &MI) const override
std::optional< DestSourcePair > isCopyInstrImpl(const MachineInstr &MI) const override
bool analyzeSelect(const MachineInstr &MI, SmallVectorImpl< MachineOperand > &Cond, unsigned &TrueOp, unsigned &FalseOp, bool &Optimizable) const override
static bool isFromLoadImm(const MachineRegisterInfo &MRI, const MachineOperand &Op, int64_t &Imm)
Return true if the operand is a load immediate instruction and sets Imm to the immediate value.
bool shouldClusterMemOps(ArrayRef< const MachineOperand * > BaseOps1, int64_t Offset1, bool OffsetIsScalable1, ArrayRef< const MachineOperand * > BaseOps2, int64_t Offset2, bool OffsetIsScalable2, unsigned ClusterSize, unsigned NumBytes) const override
bool areMemAccessesTriviallyDisjoint(const MachineInstr &MIa, const MachineInstr &MIb) const override
Wrapper class representing virtual and physical registers.
Definition Register.h:19
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
virtual MachineInstr * foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS=nullptr, VirtRegMap *VRM=nullptr) const
Target-dependent implementation for foldMemoryOperand.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
LLVM Value Representation.
Definition Value.h:75
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34
CondCode getInverseBranchCondition(CondCode)
unsigned getBrCond(CondCode CC, unsigned SelectOpc=0)
static constexpr unsigned FPMASK_Negative_Zero
static constexpr unsigned FPMASK_Positive_Subnormal
bool hasEqualFRM(const MachineInstr &MI1, const MachineInstr &MI2)
static constexpr unsigned FPMASK_Positive_Normal
static constexpr unsigned FPMASK_Negative_Subnormal
static constexpr unsigned FPMASK_Negative_Normal
bool isVLKnownLE(const MachineOperand &LHS, const MachineOperand &RHS)
Given two VL operands, do we know that LHS <= RHS?
static constexpr unsigned FPMASK_Positive_Infinity
static constexpr unsigned FPMASK_Negative_Infinity
static constexpr unsigned FPMASK_Quiet_NaN
unsigned getRVVMCOpcode(unsigned RVVPseudoOpcode)
unsigned getDestLog2EEW(const MCInstrDesc &Desc, unsigned Log2SEW)
std::optional< unsigned > getVectorLowDemandedScalarBits(unsigned Opcode, unsigned Log2SEW)
std::optional< std::pair< unsigned, unsigned > > isRVVSpillForZvlsseg(unsigned Opcode)
static constexpr unsigned FPMASK_Signaling_NaN
static constexpr unsigned FPMASK_Positive_Zero
bool isRVVSpill(const MachineInstr &MI)
static constexpr int64_t VLMaxSentinel
InstrType
Represents how an instruction should be mapped by the outliner.
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:477
RISCVMachineCombinerPattern
@ SHXADD_ADD_SLLI_OP2
@ SHXADD_ADD_SLLI_OP1
MachineTraceStrategy
Strategies for selecting traces.
static const MachineMemOperand::Flags MONontemporalBit1
static const MachineMemOperand::Flags MONontemporalBit0
Op::Description Desc
int countr_zero(T Val)
Count number of 0's from the least significant bit to the most stopping at the first 1.
Definition bit.h:186
CombinerObjective
The combiner's goal may differ based on which pattern it is attempting to optimize.
CodeGenOptLevel
Code generation optimization level.
Definition CodeGen.h:82
int isShifted359(T Value, int &Shift)
DWARFExpression::Operation Op
Used to describe addressing mode similar to ExtAddrMode in CodeGenPrepare.
An individual sequence of instructions to be replaced with a call to an outlined function.
The information necessary to create an outlined function for some class of candidate.