LLVM 23.0.0git
Utils.h
Go to the documentation of this file.
1//==-- llvm/CodeGen/GlobalISel/Utils.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/// \file This file declares the API of helper functions used throughout the
10/// GlobalISel pipeline.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CODEGEN_GLOBALISEL_UTILS_H
15#define LLVM_CODEGEN_GLOBALISEL_UTILS_H
16
17#include "GISelWorkList.h"
18#include "llvm/ADT/APFloat.h"
19#include "llvm/ADT/StringRef.h"
22#include "llvm/IR/DebugLoc.h"
26
27#include <cstdint>
28
29namespace llvm {
30
31class AnalysisUsage;
36class MachineFunction;
37class MachineInstr;
39class MachineOperand;
44class MCInstrDesc;
47class TargetInstrInfo;
48class TargetLowering;
52class ConstantFP;
53class APFloat;
54
55// Convenience macros for dealing with vector reduction opcodes.
56#define GISEL_VECREDUCE_CASES_ALL \
57 case TargetOpcode::G_VECREDUCE_SEQ_FADD: \
58 case TargetOpcode::G_VECREDUCE_SEQ_FMUL: \
59 case TargetOpcode::G_VECREDUCE_FADD: \
60 case TargetOpcode::G_VECREDUCE_FMUL: \
61 case TargetOpcode::G_VECREDUCE_FMAX: \
62 case TargetOpcode::G_VECREDUCE_FMIN: \
63 case TargetOpcode::G_VECREDUCE_FMAXIMUM: \
64 case TargetOpcode::G_VECREDUCE_FMINIMUM: \
65 case TargetOpcode::G_VECREDUCE_ADD: \
66 case TargetOpcode::G_VECREDUCE_MUL: \
67 case TargetOpcode::G_VECREDUCE_AND: \
68 case TargetOpcode::G_VECREDUCE_OR: \
69 case TargetOpcode::G_VECREDUCE_XOR: \
70 case TargetOpcode::G_VECREDUCE_SMAX: \
71 case TargetOpcode::G_VECREDUCE_SMIN: \
72 case TargetOpcode::G_VECREDUCE_UMAX: \
73 case TargetOpcode::G_VECREDUCE_UMIN:
74
75#define GISEL_VECREDUCE_CASES_NONSEQ \
76 case TargetOpcode::G_VECREDUCE_FADD: \
77 case TargetOpcode::G_VECREDUCE_FMUL: \
78 case TargetOpcode::G_VECREDUCE_FMAX: \
79 case TargetOpcode::G_VECREDUCE_FMIN: \
80 case TargetOpcode::G_VECREDUCE_FMAXIMUM: \
81 case TargetOpcode::G_VECREDUCE_FMINIMUM: \
82 case TargetOpcode::G_VECREDUCE_ADD: \
83 case TargetOpcode::G_VECREDUCE_MUL: \
84 case TargetOpcode::G_VECREDUCE_AND: \
85 case TargetOpcode::G_VECREDUCE_OR: \
86 case TargetOpcode::G_VECREDUCE_XOR: \
87 case TargetOpcode::G_VECREDUCE_SMAX: \
88 case TargetOpcode::G_VECREDUCE_SMIN: \
89 case TargetOpcode::G_VECREDUCE_UMAX: \
90 case TargetOpcode::G_VECREDUCE_UMIN:
91
92/// Try to constrain Reg to the specified register class. If this fails,
93/// create a new virtual register in the correct class.
94///
95/// \return The virtual register constrained to the right register class.
96LLVM_ABI Register constrainRegToClass(MachineRegisterInfo &MRI,
97 const TargetInstrInfo &TII,
98 const RegisterBankInfo &RBI, Register Reg,
99 const TargetRegisterClass &RegClass);
100
101/// Constrain the Register operand OpIdx, so that it is now constrained to the
102/// TargetRegisterClass passed as an argument (RegClass).
103/// If this fails, create a new virtual register in the correct class and insert
104/// a COPY before \p InsertPt if it is a use or after if it is a definition.
105/// In both cases, the function also updates the register of RegMo. The debug
106/// location of \p InsertPt is used for the new copy.
107///
108/// \return The virtual register constrained to the right register class.
110 const MachineFunction &MF, const TargetRegisterInfo &TRI,
111 MachineRegisterInfo &MRI, const TargetInstrInfo &TII,
112 const RegisterBankInfo &RBI, MachineInstr &InsertPt,
113 const TargetRegisterClass &RegClass, MachineOperand &RegMO);
114
115/// Try to constrain Reg so that it is usable by argument OpIdx of the provided
116/// MCInstrDesc \p II. If this fails, create a new virtual register in the
117/// correct class and insert a COPY before \p InsertPt if it is a use or after
118/// if it is a definition. In both cases, the function also updates the register
119/// of RegMo.
120/// This is equivalent to constrainOperandRegClass(..., RegClass, ...)
121/// with RegClass obtained from the MCInstrDesc. The debug location of \p
122/// InsertPt is used for the new copy.
123///
124/// \return The virtual register constrained to the right register class.
126 const MachineFunction &MF, const TargetRegisterInfo &TRI,
127 MachineRegisterInfo &MRI, const TargetInstrInfo &TII,
128 const RegisterBankInfo &RBI, MachineInstr &InsertPt, const MCInstrDesc &II,
129 MachineOperand &RegMO, unsigned OpIdx);
130
131/// Mutate the newly-selected instruction \p I to constrain its (possibly
132/// generic) virtual register operands to the instruction's register class.
133/// This could involve inserting COPYs before (for uses) or after (for defs).
134/// This requires the number of operands to match the instruction description.
135// FIXME: Not all instructions have the same number of operands. We should
136// probably expose a constrain helper per operand and let the target selector
137// constrain individual registers, like fast-isel.
139 const TargetInstrInfo &TII,
140 const TargetRegisterInfo &TRI,
141 const RegisterBankInfo &RBI);
142
143/// Check if DstReg can be replaced with SrcReg depending on the register
144/// constraints.
145LLVM_ABI bool canReplaceReg(Register DstReg, Register SrcReg,
146 MachineRegisterInfo &MRI);
147
148/// Check whether an instruction \p MI is dead: it only defines dead virtual
149/// registers, and doesn't have other side effects.
150LLVM_ABI bool isTriviallyDead(const MachineInstr &MI,
151 const MachineRegisterInfo &MRI);
152
153/// Report an ISel error as a missed optimization remark to the LLVMContext's
154/// diagnostic stream. Set the FailedISel MachineFunction property.
155LLVM_ABI void reportGISelFailure(MachineFunction &MF,
156 MachineOptimizationRemarkEmitter &MORE,
157 MachineOptimizationRemarkMissed &R);
158
159LLVM_ABI void reportGISelFailure(MachineFunction &MF,
160 MachineOptimizationRemarkEmitter &MORE,
161 const char *PassName, StringRef Msg,
162 const MachineInstr &MI);
163
164/// Report an ISel warning as a missed optimization remark to the LLVMContext's
165/// diagnostic stream.
166LLVM_ABI void reportGISelWarning(MachineFunction &MF,
167 MachineOptimizationRemarkEmitter &MORE,
168 MachineOptimizationRemarkMissed &R);
169
170/// Returns the inverse opcode of \p MinMaxOpc, which is a generic min/max
171/// opcode like G_SMIN.
172LLVM_ABI unsigned getInverseGMinMaxOpcode(unsigned MinMaxOpc);
173
174/// If \p VReg is defined by a G_CONSTANT, return the corresponding value.
175LLVM_ABI std::optional<APInt>
176getIConstantVRegVal(Register VReg, const MachineRegisterInfo &MRI);
177
178/// If \p VReg is defined by a G_CONSTANT fits in int64_t returns it.
179LLVM_ABI std::optional<int64_t>
180getIConstantVRegSExtVal(Register VReg, const MachineRegisterInfo &MRI);
181
182/// \p VReg is defined by a G_CONSTANT, return the corresponding value.
183LLVM_ABI const APInt &getIConstantFromReg(Register VReg,
184 const MachineRegisterInfo &MRI);
185
186/// Simple struct used to hold a constant integer value and a virtual
187/// register.
192
193/// If \p VReg is defined by a statically evaluable chain of instructions rooted
194/// on a G_CONSTANT returns its APInt value and def register.
195LLVM_ABI std::optional<ValueAndVReg>
198 bool LookThroughInstrs = true);
199
200/// If \p VReg is defined by a statically evaluable chain of instructions rooted
201/// on a G_CONSTANT or G_FCONSTANT returns its value as APInt and def register.
202LLVM_ABI std::optional<ValueAndVReg> getAnyConstantVRegValWithLookThrough(
203 Register VReg, const MachineRegisterInfo &MRI,
204 bool LookThroughInstrs = true, bool LookThroughAnyExt = false);
205
210
211/// If \p VReg is defined by a statically evaluable chain of instructions rooted
212/// on a G_FCONSTANT returns its APFloat value and def register.
213LLVM_ABI std::optional<FPValueAndVReg>
216 bool LookThroughInstrs = true);
217
219 const MachineRegisterInfo &MRI);
220
221/// See if Reg is defined by an single def instruction that is
222/// Opcode. Also try to do trivial folding if it's a COPY with
223/// same types. Returns null otherwise.
225 const MachineRegisterInfo &MRI);
226
227/// Simple struct used to hold a Register value and the instruction which
228/// defines it.
233
234/// Find the def instruction for \p Reg, and underlying value Register folding
235/// away any copies.
236///
237/// Also walks through hints such as G_ASSERT_ZEXT.
238LLVM_ABI std::optional<DefinitionAndSourceRegister>
240
241/// Find the def instruction for \p Reg, folding away any trivial copies. May
242/// return nullptr if \p Reg is not a generic virtual register.
243///
244/// Also walks through hints such as G_ASSERT_ZEXT.
246 const MachineRegisterInfo &MRI);
247
248/// Find the source register for \p Reg, folding away any trivial copies. It
249/// will be an output register of the instruction that getDefIgnoringCopies
250/// returns. May return an invalid register if \p Reg is not a generic virtual
251/// register.
252///
253/// Also walks through hints such as G_ASSERT_ZEXT.
255 const MachineRegisterInfo &MRI);
256
257/// Helper function to split a wide generic register into bitwise blocks with
258/// the given Type (which implies the number of blocks needed). The generic
259/// registers created are appended to Ops, starting at bit 0 of Reg.
260LLVM_ABI void extractParts(Register Reg, LLT Ty, int NumParts,
262 MachineIRBuilder &MIRBuilder,
264
265/// Version which handles irregular splits.
266LLVM_ABI bool extractParts(Register Reg, LLT RegTy, LLT MainTy, LLT &LeftoverTy,
268 SmallVectorImpl<Register> &LeftoverVRegs,
269 MachineIRBuilder &MIRBuilder,
271
272/// Version which handles irregular sub-vector splits.
273LLVM_ABI void extractVectorParts(Register Reg, unsigned NumElts,
275 MachineIRBuilder &MIRBuilder,
277
278// Templated variant of getOpcodeDef returning a MachineInstr derived T.
279/// See if Reg is defined by an single def instruction of type T
280/// Also try to do trivial folding if it's a COPY with
281/// same types. Returns null otherwise.
282template <class T>
287
288/// Returns an APFloat from Val converted to the appropriate size.
289LLVM_ABI APFloat getAPFloatFromSize(double Val, unsigned Size);
290
291/// Modify analysis usage so it preserves passes required for the SelectionDAG
292/// fallback.
293LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU);
294
295LLVM_ABI std::optional<APInt> ConstantFoldBinOp(unsigned Opcode,
296 const Register Op1,
297 const Register Op2,
298 const MachineRegisterInfo &MRI);
299LLVM_ABI std::optional<APFloat>
300ConstantFoldFPBinOp(unsigned Opcode, const Register Op1, const Register Op2,
301 const MachineRegisterInfo &MRI);
302
303/// Tries to constant fold a vector binop with sources \p Op1 and \p Op2.
304/// Returns an empty vector on failure.
306ConstantFoldVectorBinop(unsigned Opcode, const Register Op1, const Register Op2,
307 const MachineRegisterInfo &MRI);
308
309LLVM_ABI std::optional<APInt>
310ConstantFoldCastOp(unsigned Opcode, LLT DstTy, const Register Op0,
311 const MachineRegisterInfo &MRI);
312
313LLVM_ABI std::optional<APInt> ConstantFoldExtOp(unsigned Opcode,
314 const Register Op1,
315 uint64_t Imm,
316 const MachineRegisterInfo &MRI);
317
318LLVM_ABI std::optional<APFloat>
319ConstantFoldIntToFloat(unsigned Opcode, LLT DstTy, Register Src,
320 const MachineRegisterInfo &MRI);
321
322/// Tries to constant fold a counting-zero operation (G_CTLZ or G_CTTZ) on \p
323/// Src. If \p Src is a vector then it tries to do an element-wise constant
324/// fold.
325LLVM_ABI std::optional<SmallVector<unsigned>>
326ConstantFoldCountZeros(Register Src, const MachineRegisterInfo &MRI,
327 std::function<unsigned(APInt)> CB);
328
329LLVM_ABI std::optional<SmallVector<APInt>>
330ConstantFoldICmp(unsigned Pred, const Register Op1, const Register Op2,
331 unsigned DstScalarSizeInBits, unsigned ExtOp,
332 const MachineRegisterInfo &MRI);
333
334/// Test if the given value is known to have exactly one bit set. This differs
335/// from computeKnownBits in that it doesn't necessarily determine which bit is
336/// set.
337LLVM_ABI bool
338isKnownToBeAPowerOfTwo(Register Val, const MachineRegisterInfo &MRI,
339 GISelValueTracking *ValueTracking = nullptr);
340
341/// Returns true if \p Val can be assumed to never be a NaN. If \p SNaN is true,
342/// this returns if \p Val can be assumed to never be a signaling NaN.
343LLVM_ABI bool isKnownNeverNaN(Register Val, const MachineRegisterInfo &MRI,
344 bool SNaN = false);
345
346/// Returns true if \p Val can be assumed to never be a signaling NaN.
348 return isKnownNeverNaN(Val, MRI, true);
349}
350
351LLVM_ABI Align inferAlignFromPtrInfo(MachineFunction &MF,
352 const MachinePointerInfo &MPO);
353
354/// Return a virtual register corresponding to the incoming argument register \p
355/// PhysReg. This register is expected to have class \p RC, and optional type \p
356/// RegTy. This assumes all references to the register will use the same type.
357///
358/// If there is an existing live-in argument register, it will be returned.
359/// This will also ensure there is a valid copy
361 MachineFunction &MF, const TargetInstrInfo &TII, MCRegister PhysReg,
362 const TargetRegisterClass &RC, const DebugLoc &DL, LLT RegTy = LLT());
363
364/// Return the least common multiple type of \p OrigTy and \p TargetTy, by
365/// changing the number of vector elements or scalar bitwidth. The intent is a
366/// G_MERGE_VALUES, G_BUILD_VECTOR, or G_CONCAT_VECTORS can be constructed from
367/// \p OrigTy elements, and unmerged into \p TargetTy. It is an error to call
368/// this function where one argument is a fixed vector and the other is a
369/// scalable vector, since it is illegal to build a G_{MERGE|UNMERGE}_VALUES
370/// between fixed and scalable vectors.
371LLVM_ABI LLVM_READNONE LLT getLCMType(LLT OrigTy, LLT TargetTy);
372
374 /// Return smallest type that covers both \p OrigTy and \p TargetTy and is
375 /// multiple of TargetTy.
376 LLT
377 getCoverTy(LLT OrigTy, LLT TargetTy);
378
379/// Return a type where the total size is the greatest common divisor of \p
380/// OrigTy and \p TargetTy. This will try to either change the number of vector
381/// elements, or bitwidth of scalars. The intent is the result type can be used
382/// as the result of a G_UNMERGE_VALUES from \p OrigTy, and then some
383/// combination of G_MERGE_VALUES, G_BUILD_VECTOR and G_CONCAT_VECTORS (possibly
384/// with intermediate casts) can re-form \p TargetTy.
385///
386/// If these are vectors with different element types, this will try to produce
387/// a vector with a compatible total size, but the element type of \p OrigTy. If
388/// this can't be satisfied, this will produce a scalar smaller than the
389/// original vector elements. It is an error to call this function where
390/// one argument is a fixed vector and the other is a scalable vector, since it
391/// is illegal to build a G_{MERGE|UNMERGE}_VALUES between fixed and scalable
392/// vectors.
393///
394/// In the worst case, this returns LLT::scalar(1)
395LLVM_ABI LLVM_READNONE LLT getGCDType(LLT OrigTy, LLT TargetTy);
396
397/// Represents a value which can be a Register or a constant.
398///
399/// This is useful in situations where an instruction may have an interesting
400/// register operand or interesting constant operand. For a concrete example,
401/// \see getVectorSplat.
403 int64_t Cst;
404 Register Reg;
405 bool IsReg;
406
407public:
408 explicit RegOrConstant(Register Reg) : Reg(Reg), IsReg(true) {}
409 explicit RegOrConstant(int64_t Cst) : Cst(Cst), IsReg(false) {}
410 bool isReg() const { return IsReg; }
411 bool isCst() const { return !IsReg; }
412 Register getReg() const {
413 assert(isReg() && "Expected a register!");
414 return Reg;
415 }
416 int64_t getCst() const {
417 assert(isCst() && "Expected a constant!");
418 return Cst;
419 }
420};
421
422/// \returns The splat index of a G_SHUFFLE_VECTOR \p MI when \p MI is a splat.
423/// If \p MI is not a splat, returns std::nullopt.
424LLVM_ABI std::optional<int> getSplatIndex(MachineInstr &MI);
425
426/// \returns the scalar integral splat value of \p Reg if possible.
427LLVM_ABI std::optional<APInt>
428getIConstantSplatVal(const Register Reg, const MachineRegisterInfo &MRI);
429
430/// \returns the scalar integral splat value defined by \p MI if possible.
431LLVM_ABI std::optional<APInt>
432getIConstantSplatVal(const MachineInstr &MI, const MachineRegisterInfo &MRI);
433
434/// \returns the scalar sign extended integral splat value of \p Reg if
435/// possible.
436LLVM_ABI std::optional<int64_t>
437getIConstantSplatSExtVal(const Register Reg, const MachineRegisterInfo &MRI);
438
439/// \returns the scalar sign extended integral splat value defined by \p MI if
440/// possible.
441LLVM_ABI std::optional<int64_t>
442getIConstantSplatSExtVal(const MachineInstr &MI,
443 const MachineRegisterInfo &MRI);
444
445/// Returns a floating point scalar constant of a build vector splat if it
446/// exists. When \p AllowUndef == true some elements can be undef but not all.
447LLVM_ABI std::optional<FPValueAndVReg>
448getFConstantSplat(Register VReg, const MachineRegisterInfo &MRI,
449 bool AllowUndef = true);
450
451/// Return true if the specified register is defined by G_BUILD_VECTOR or
452/// G_BUILD_VECTOR_TRUNC where all of the elements are \p SplatValue or undef.
454 const MachineRegisterInfo &MRI,
455 int64_t SplatValue, bool AllowUndef);
456
457/// Return true if the specified register is defined by G_BUILD_VECTOR or
458/// G_BUILD_VECTOR_TRUNC where all of the elements are \p SplatValue or undef.
460 const MachineRegisterInfo &MRI,
461 const APInt &SplatValue,
462 bool AllowUndef);
463
464/// Return true if the specified instruction is a G_BUILD_VECTOR or
465/// G_BUILD_VECTOR_TRUNC where all of the elements are \p SplatValue or undef.
466LLVM_ABI bool isBuildVectorConstantSplat(const MachineInstr &MI,
467 const MachineRegisterInfo &MRI,
468 int64_t SplatValue, bool AllowUndef);
469
470/// Return true if the specified instruction is a G_BUILD_VECTOR or
471/// G_BUILD_VECTOR_TRUNC where all of the elements are \p SplatValue or undef.
472LLVM_ABI bool isBuildVectorConstantSplat(const MachineInstr &MI,
473 const MachineRegisterInfo &MRI,
474 const APInt &SplatValue,
475 bool AllowUndef);
476
477/// Return true if the specified instruction is a G_BUILD_VECTOR or
478/// G_BUILD_VECTOR_TRUNC where all of the elements are 0 or undef.
479LLVM_ABI bool isBuildVectorAllZeros(const MachineInstr &MI,
480 const MachineRegisterInfo &MRI,
481 bool AllowUndef = false);
482
483/// Return true if the specified instruction is a G_BUILD_VECTOR or
484/// G_BUILD_VECTOR_TRUNC where all of the elements are ~0 or undef.
485LLVM_ABI bool isBuildVectorAllOnes(const MachineInstr &MI,
486 const MachineRegisterInfo &MRI,
487 bool AllowUndef = false);
488
489/// Return true if the specified instruction is known to be a constant, or a
490/// vector of constants.
491///
492/// If \p AllowFP is true, this will consider G_FCONSTANT in addition to
493/// G_CONSTANT. If \p AllowOpaqueConstants is true, constant-like instructions
494/// such as G_GLOBAL_VALUE will also be considered.
495LLVM_ABI bool isConstantOrConstantVector(const MachineInstr &MI,
496 const MachineRegisterInfo &MRI,
497 bool AllowFP = true,
498 bool AllowOpaqueConstants = true);
499
500/// Return true if the value is a constant 0 integer or a splatted vector of a
501/// constant 0 integer (with no undefs if \p AllowUndefs is false). This will
502/// handle G_BUILD_VECTOR and G_BUILD_VECTOR_TRUNC as truncation is not an issue
503/// for null values.
504LLVM_ABI bool isNullOrNullSplat(const MachineInstr &MI,
505 const MachineRegisterInfo &MRI,
506 bool AllowUndefs = false);
507
508/// Return true if the value is a constant -1 integer or a splatted vector of a
509/// constant -1 integer (with no undefs if \p AllowUndefs is false).
510LLVM_ABI bool isAllOnesOrAllOnesSplat(const MachineInstr &MI,
511 const MachineRegisterInfo &MRI,
512 bool AllowUndefs = false);
513
514/// \returns a value when \p MI is a vector splat. The splat can be either a
515/// Register or a constant.
516///
517/// Examples:
518///
519/// \code
520/// %reg = COPY $physreg
521/// %reg_splat = G_BUILD_VECTOR %reg, %reg, ..., %reg
522/// \endcode
523///
524/// If called on the G_BUILD_VECTOR above, this will return a RegOrConstant
525/// containing %reg.
526///
527/// \code
528/// %cst = G_CONSTANT iN 4
529/// %constant_splat = G_BUILD_VECTOR %cst, %cst, ..., %cst
530/// \endcode
531///
532/// In the above case, this will return a RegOrConstant containing 4.
533LLVM_ABI std::optional<RegOrConstant>
534getVectorSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI);
535
536/// Determines if \p MI defines a constant integer or a build vector of
537/// constant integers. Treats undef values as constants.
538LLVM_ABI bool isConstantOrConstantVector(MachineInstr &MI,
539 const MachineRegisterInfo &MRI);
540
541/// Determines if \p MI defines a constant integer or a splat vector of
542/// constant integers.
543/// \returns the scalar constant or std::nullopt.
544LLVM_ABI std::optional<APInt>
546 const MachineRegisterInfo &MRI);
547
548/// Determines if \p MI defines a float constant integer or a splat vector of
549/// float constant integers.
550/// \returns the float constant or std::nullopt.
551LLVM_ABI std::optional<APFloat>
553 const MachineRegisterInfo &MRI);
554
555/// Attempt to match a unary predicate against a scalar/splat constant or every
556/// element of a constant G_BUILD_VECTOR. If \p ConstVal is null, the source
557/// value was undef.
558LLVM_ABI bool
559matchUnaryPredicate(const MachineRegisterInfo &MRI, Register Reg,
560 std::function<bool(const Constant *ConstVal)> Match,
561 bool AllowUndefs = false);
562
563/// Returns true if given the TargetLowering's boolean contents information,
564/// the value \p Val contains a true value.
565LLVM_ABI bool isConstTrueVal(const TargetLowering &TLI, int64_t Val,
566 bool IsVector, bool IsFP);
567/// \returns true if given the TargetLowering's boolean contents information,
568/// the value \p Val contains a false value.
569LLVM_ABI bool isConstFalseVal(const TargetLowering &TLI, int64_t Val,
570 bool IsVector, bool IsFP);
571
572/// Returns an integer representing true, as defined by the
573/// TargetBooleanContents.
574LLVM_ABI int64_t getICmpTrueVal(const TargetLowering &TLI, bool IsVector,
575 bool IsFP);
576
579 LostDebugLocObserver *LocObserver,
580 SmallInstListTy &DeadInstChain);
583 LostDebugLocObserver *LocObserver = nullptr);
585 LostDebugLocObserver *LocObserver = nullptr);
586
587/// Assuming the instruction \p MI is going to be deleted, attempt to salvage
588/// debug users of \p MI by writing the effect of \p MI in a DIExpression.
591
592/// Returns whether opcode \p Opc is a pre-isel generic floating-point opcode,
593/// having only floating-point operands.
595
596/// Returns true if \p Reg can create undef or poison from non-undef &
597/// non-poison operands. \p ConsiderFlagsAndMetadata controls whether poison
598/// producing flags and metadata on the instruction are considered. This can be
599/// used to see if the instruction could still introduce undef or poison even
600/// without poison generating flags and metadata which might be on the
601/// instruction.
604 bool ConsiderFlagsAndMetadata = true);
605
606/// Returns true if \p Reg can create poison from non-poison operands.
608 bool ConsiderFlagsAndMetadata = true);
609
610/// Returns true if \p Reg cannot be poison and undef.
613 unsigned Depth = 0);
614
615/// Returns true if \p Reg cannot be poison, but may be undef.
618 unsigned Depth = 0);
619
620/// Returns true if \p Reg cannot be undef, but may be poison.
623 unsigned Depth = 0);
624
625/// Get the type back from LLT. It won't be 100 percent accurate but returns an
626/// estimate of the type.
628
629/// Returns true if the instruction \p MI is one of the assert
630/// instructions.
632
633/// An integer-like constant.
634///
635/// It abstracts over scalar, fixed-length vectors, and scalable vectors.
636/// In the common case, it provides a common API and feels like an APInt,
637/// while still providing low-level access.
638/// It can be used for constant-folding.
639///
640/// bool isZero()
641/// abstracts over the kind.
642///
643/// switch(const.getKind())
644/// {
645/// }
646/// provides low-level access.
648public:
650
651private:
652 GIConstantKind Kind;
653 SmallVector<APInt> Values;
654 APInt Value;
655
656public:
658 : Kind(GIConstantKind::FixedVector), Values(Values) {};
659 GIConstant(const APInt &Value, GIConstantKind Kind)
660 : Kind(Kind), Value(Value) {};
661
662 /// Returns the kind of of this constant, e.g, Scalar.
663 GIConstantKind getKind() const { return Kind; }
664
665 /// Returns the value, if this constant is a scalar.
667
668 LLVM_ABI static std::optional<GIConstant>
670};
671
672/// An floating-point-like constant.
673///
674/// It abstracts over scalar, fixed-length vectors, and scalable vectors.
675/// In the common case, it provides a common API and feels like an APFloat,
676/// while still providing low-level access.
677/// It can be used for constant-folding.
678///
679/// bool isZero()
680/// abstracts over the kind.
681///
682/// switch(const.getKind())
683/// {
684/// }
685/// provides low-level access.
687 using VecTy = SmallVector<APFloat>;
688 using const_iterator = VecTy::const_iterator;
689
690public:
692
693private:
694 GFConstantKind Kind;
696
697public:
699 : Kind(GFConstantKind::FixedVector), Values(Values) {};
700 GFConstant(const APFloat &Value, GFConstantKind Kind) : Kind(Kind) {
701 Values.push_back(Value);
702 }
703
704 /// Returns the kind of of this constant, e.g, Scalar.
705 GFConstantKind getKind() const { return Kind; }
706
707 const_iterator begin() const {
709 "Expected fixed vector or scalar constant");
710 return Values.begin();
711 }
712
713 const_iterator end() const {
715 "Expected fixed vector or scalar constant");
716 return Values.end();
717 }
718
719 size_t size() const {
720 assert(Kind == GFConstantKind::FixedVector && "Expected fixed vector");
721 return Values.size();
722 }
723
724 /// Returns the value, if this constant is a scalar.
726
727 LLVM_ABI static std::optional<GFConstant>
729};
730
731} // End namespace llvm.
732#endif
unsigned const MachineRegisterInfo * MRI
MachineInstrBuilder MachineInstrBuilder & DefMI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares a class to represent arbitrary precision floating point values and provide a varie...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define LLVM_READNONE
Definition Compiler.h:315
#define LLVM_ABI
Definition Compiler.h:213
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
Implement a low-level type suitable for MachineInstr level instruction selection.
#define I(x, y, z)
Definition MD5.cpp:57
Register Reg
Register const TargetRegisterInfo * TRI
Promote Memory to Register
Definition Mem2Reg.cpp:110
#define T
MachineInstr unsigned OpIdx
uint64_t IntrinsicInst * II
static const char PassName[]
Class for arbitrary precision integers.
Definition APInt.h:78
Represent the analysis usage information of a pass.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
ConstantFP - Floating Point Values [float, double].
Definition Constants.h:282
const_iterator begin() const
Definition Utils.h:707
static LLVM_ABI std::optional< GFConstant > getConstant(Register Const, const MachineRegisterInfo &MRI)
Definition Utils.cpp:2106
GFConstant(const APFloat &Value, GFConstantKind Kind)
Definition Utils.h:700
GFConstant(ArrayRef< APFloat > Values)
Definition Utils.h:698
GFConstantKind getKind() const
Returns the kind of of this constant, e.g, Scalar.
Definition Utils.h:705
LLVM_ABI APFloat getScalarValue() const
Returns the value, if this constant is a scalar.
Definition Utils.cpp:2099
const_iterator end() const
Definition Utils.h:713
size_t size() const
Definition Utils.h:719
LLVM_ABI APInt getScalarValue() const
Returns the value, if this constant is a scalar.
Definition Utils.cpp:2059
GIConstant(const APInt &Value, GIConstantKind Kind)
Definition Utils.h:659
static LLVM_ABI std::optional< GIConstant > getConstant(Register Const, const MachineRegisterInfo &MRI)
Definition Utils.cpp:2066
GIConstantKind getKind() const
Returns the kind of of this constant, e.g, Scalar.
Definition Utils.h:663
GIConstant(ArrayRef< APInt > Values)
Definition Utils.h:657
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:68
Describe properties that are true of each instruction in the target description file.
Helper class to build MachineInstr.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
Diagnostic information for missed-optimization remarks.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Analysis providing profile information.
RegOrConstant(Register Reg)
Definition Utils.h:408
Register getReg() const
Definition Utils.h:412
bool isCst() const
Definition Utils.h:411
int64_t getCst() const
Definition Utils.h:416
RegOrConstant(int64_t Cst)
Definition Utils.h:409
bool isReg() const
Definition Utils.h:410
Holds all the information related to register banks.
Wrapper class representing virtual and physical registers.
Definition Register.h:20
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TargetInstrInfo - Interface to description of machine instruction set.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Target-Independent Code Generator Pass Configuration Options.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
LLVM Value Representation.
Definition Value.h:75
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26
LLVM_ABI Register getFunctionLiveInPhysReg(MachineFunction &MF, const TargetInstrInfo &TII, MCRegister PhysReg, const TargetRegisterClass &RC, const DebugLoc &DL, LLT RegTy=LLT())
Return a virtual register corresponding to the incoming argument register PhysReg.
Definition Utils.cpp:921
LLVM_ABI std::optional< SmallVector< APInt > > ConstantFoldICmp(unsigned Pred, const Register Op1, const Register Op2, unsigned DstScalarSizeInBits, unsigned ExtOp, const MachineRegisterInfo &MRI)
Definition Utils.cpp:1040
LLVM_ABI bool isBuildVectorAllZeros(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndef=false)
Return true if the specified instruction is a G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC where all of the...
Definition Utils.cpp:1487
LLVM_ABI Type * getTypeForLLT(LLT Ty, LLVMContext &C)
Get the type back from LLT.
Definition Utils.cpp:2041
LLVM_ABI Register constrainOperandRegClass(const MachineFunction &MF, const TargetRegisterInfo &TRI, MachineRegisterInfo &MRI, const TargetInstrInfo &TII, const RegisterBankInfo &RBI, MachineInstr &InsertPt, const TargetRegisterClass &RegClass, MachineOperand &RegMO)
Constrain the Register operand OpIdx, so that it is now constrained to the TargetRegisterClass passed...
Definition Utils.cpp:56
LLVM_ABI MachineInstr * getOpcodeDef(unsigned Opcode, Register Reg, const MachineRegisterInfo &MRI)
See if Reg is defined by an single def instruction that is Opcode.
Definition Utils.cpp:653
LLVM_ABI const ConstantFP * getConstantFPVRegVal(Register VReg, const MachineRegisterInfo &MRI)
Definition Utils.cpp:461
LLVM_ABI bool canCreatePoison(const Operator *Op, bool ConsiderFlagsAndMetadata=true)
LLVM_ABI std::optional< APInt > getIConstantVRegVal(Register VReg, const MachineRegisterInfo &MRI)
If VReg is defined by a G_CONSTANT, return the corresponding value.
Definition Utils.cpp:294
LLVM_ABI std::optional< APFloat > ConstantFoldIntToFloat(unsigned Opcode, LLT DstTy, Register Src, const MachineRegisterInfo &MRI)
Definition Utils.cpp:995
LLVM_ABI std::optional< APInt > getIConstantSplatVal(const Register Reg, const MachineRegisterInfo &MRI)
Definition Utils.cpp:1447
LLVM_ABI bool isAllOnesOrAllOnesSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndefs=false)
Return true if the value is a constant -1 integer or a splatted vector of a constant -1 integer (with...
Definition Utils.cpp:1612
LLVM_ABI std::optional< APFloat > ConstantFoldFPBinOp(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
Definition Utils.cpp:741
LLVM_ABI void salvageDebugInfo(const MachineRegisterInfo &MRI, MachineInstr &MI)
Assuming the instruction MI is going to be deleted, attempt to salvage debug users of MI by writing t...
Definition Utils.cpp:1730
LLVM_ABI void constrainSelectedInstRegOperands(MachineInstr &I, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
Mutate the newly-selected instruction I to constrain its (possibly generic) virtual register operands...
Definition Utils.cpp:155
LLVM_ABI std::optional< SmallVector< unsigned > > ConstantFoldCountZeros(Register Src, const MachineRegisterInfo &MRI, std::function< unsigned(APInt)> CB)
Tries to constant fold a counting-zero operation (G_CTLZ or G_CTTZ) on Src.
Definition Utils.cpp:1008
LLVM_ABI std::optional< APInt > ConstantFoldExtOp(unsigned Opcode, const Register Op1, uint64_t Imm, const MachineRegisterInfo &MRI)
Definition Utils.cpp:954
LLVM_ABI std::optional< RegOrConstant > getVectorSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI)
Definition Utils.cpp:1500
GISelWorkList< 4 > SmallInstListTy
Definition Utils.h:577
LLVM_ABI std::optional< APInt > isConstantOrConstantSplatVector(MachineInstr &MI, const MachineRegisterInfo &MRI)
Determines if MI defines a constant integer or a splat vector of constant integers.
Definition Utils.cpp:1570
LLVM_ABI bool isNullOrNullSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndefs=false)
Return true if the value is a constant 0 integer or a splatted vector of a constant 0 integer (with n...
Definition Utils.cpp:1594
LLVM_ABI MachineInstr * getDefIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the def instruction for Reg, folding away any trivial copies.
Definition Utils.cpp:494
LLVM_ABI bool matchUnaryPredicate(const MachineRegisterInfo &MRI, Register Reg, std::function< bool(const Constant *ConstVal)> Match, bool AllowUndefs=false)
Attempt to match a unary predicate against a scalar/splat constant or every element of a constant G_B...
Definition Utils.cpp:1627
LLVM_ABI void reportGISelWarning(MachineFunction &MF, MachineOptimizationRemarkEmitter &MORE, MachineOptimizationRemarkMissed &R)
Report an ISel warning as a missed optimization remark to the LLVMContext's diagnostic stream.
Definition Utils.cpp:252
LLVM_ABI bool isGuaranteedNotToBeUndef(const Value *V, AssumptionCache *AC=nullptr, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, unsigned Depth=0)
Returns true if V cannot be undef, but may be poison.
LLVM_ABI bool isConstTrueVal(const TargetLowering &TLI, int64_t Val, bool IsVector, bool IsFP)
Returns true if given the TargetLowering's boolean contents information, the value Val contains a tru...
Definition Utils.cpp:1659
LLVM_ABI LLVM_READNONE LLT getLCMType(LLT OrigTy, LLT TargetTy)
Return the least common multiple type of OrigTy and TargetTy, by changing the number of vector elemen...
Definition Utils.cpp:1194
LLVM_ABI std::optional< int64_t > getIConstantVRegSExtVal(Register VReg, const MachineRegisterInfo &MRI)
If VReg is defined by a G_CONSTANT fits in int64_t returns it.
Definition Utils.cpp:314
LLVM_ABI std::optional< APInt > ConstantFoldBinOp(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
Definition Utils.cpp:672
auto dyn_cast_or_null(const Y &Val)
Definition Casting.h:753
LLVM_ABI const APInt & getIConstantFromReg(Register VReg, const MachineRegisterInfo &MRI)
VReg is defined by a G_CONSTANT, return the corresponding value.
Definition Utils.cpp:305
LLVM_ABI bool isConstantOrConstantVector(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowFP=true, bool AllowOpaqueConstants=true)
Return true if the specified instruction is known to be a constant, or a vector of constants.
Definition Utils.cpp:1550
LLVM_ABI bool canReplaceReg(Register DstReg, Register SrcReg, MachineRegisterInfo &MRI)
Check if DstReg can be replaced with SrcReg depending on the register constraints.
Definition Utils.cpp:200
LLVM_ABI void saveUsesAndErase(MachineInstr &MI, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver, SmallInstListTy &DeadInstChain)
Definition Utils.cpp:1696
LLVM_ABI void reportGISelFailure(MachineFunction &MF, MachineOptimizationRemarkEmitter &MORE, MachineOptimizationRemarkMissed &R)
Report an ISel error as a missed optimization remark to the LLVMContext's diagnostic stream.
Definition Utils.cpp:258
LLVM_ABI std::optional< ValueAndVReg > getAnyConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true, bool LookThroughAnyExt=false)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_CONSTANT or G_FCONST...
Definition Utils.cpp:439
LLVM_ABI bool isBuildVectorAllOnes(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndef=false)
Return true if the specified instruction is a G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC where all of the...
Definition Utils.cpp:1493
LLVM_ABI bool canCreateUndefOrPoison(const Operator *Op, bool ConsiderFlagsAndMetadata=true)
canCreateUndefOrPoison returns true if Op can create undef or poison from non-undef & non-poison oper...
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
LLVM_ABI SmallVector< APInt > ConstantFoldVectorBinop(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
Tries to constant fold a vector binop with sources Op1 and Op2.
Definition Utils.cpp:799
LLVM_ABI std::optional< FPValueAndVReg > getFConstantSplat(Register VReg, const MachineRegisterInfo &MRI, bool AllowUndef=true)
Returns a floating point scalar constant of a build vector splat if it exists.
Definition Utils.cpp:1480
LLVM_ABI std::optional< APInt > ConstantFoldCastOp(unsigned Opcode, LLT DstTy, const Register Op0, const MachineRegisterInfo &MRI)
Definition Utils.cpp:971
LLVM_ABI void extractParts(Register Reg, LLT Ty, int NumParts, SmallVectorImpl< Register > &VRegs, MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
Helper function to split a wide generic register into bitwise blocks with the given Type (which impli...
Definition Utils.cpp:508
LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
Definition Utils.cpp:1190
LLVM_ABI LLVM_READNONE LLT getCoverTy(LLT OrigTy, LLT TargetTy)
Return smallest type that covers both OrigTy and TargetTy and is multiple of TargetTy.
Definition Utils.cpp:1261
LLVM_ABI unsigned getInverseGMinMaxOpcode(unsigned MinMaxOpc)
Returns the inverse opcode of MinMaxOpc, which is a generic min/max opcode like G_SMIN.
Definition Utils.cpp:279
LLVM_ABI bool isGuaranteedNotToBeUndefOrPoison(const Value *V, AssumptionCache *AC=nullptr, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, unsigned Depth=0)
Return true if this function can prove that V does not have undef bits and is never poison.
LLVM_ABI std::optional< FPValueAndVReg > getFConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_FCONSTANT returns it...
Definition Utils.cpp:447
LLVM_ABI bool isConstFalseVal(const TargetLowering &TLI, int64_t Val, bool IsVector, bool IsFP)
Definition Utils.cpp:1672
LLVM_ABI std::optional< APFloat > isConstantOrConstantSplatVectorFP(MachineInstr &MI, const MachineRegisterInfo &MRI)
Determines if MI defines a float constant integer or a splat vector of float constant integers.
Definition Utils.cpp:1583
LLVM_ABI APFloat getAPFloatFromSize(double Val, unsigned Size)
Returns an APFloat from Val converted to the appropriate size.
Definition Utils.cpp:659
LLVM_ABI bool isBuildVectorConstantSplat(const Register Reg, const MachineRegisterInfo &MRI, int64_t SplatValue, bool AllowUndef)
Return true if the specified register is defined by G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC where all ...
Definition Utils.cpp:1406
LLVM_ABI void eraseInstr(MachineInstr &MI, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver=nullptr)
Definition Utils.cpp:1725
LLVM_ABI Register constrainRegToClass(MachineRegisterInfo &MRI, const TargetInstrInfo &TII, const RegisterBankInfo &RBI, Register Reg, const TargetRegisterClass &RegClass)
Try to constrain Reg to the specified register class.
Definition Utils.cpp:46
LLVM_ABI int64_t getICmpTrueVal(const TargetLowering &TLI, bool IsVector, bool IsFP)
Returns an integer representing true, as defined by the TargetBooleanContents.
Definition Utils.cpp:1684
LLVM_ABI bool isKnownNeverNaN(const Value *V, const SimplifyQuery &SQ, unsigned Depth=0)
Return true if the floating-point scalar value is not a NaN or if the floating-point vector value has...
LLVM_ABI std::optional< ValueAndVReg > getIConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_CONSTANT returns its...
Definition Utils.cpp:433
LLVM_ABI bool isPreISelGenericFloatingPointOpcode(unsigned Opc)
Returns whether opcode Opc is a pre-isel generic floating-point opcode, having only floating-point op...
Definition Utils.cpp:1749
bool isKnownNeverSNaN(Register Val, const MachineRegisterInfo &MRI)
Returns true if Val can be assumed to never be a signaling NaN.
Definition Utils.h:347
LLVM_ABI std::optional< DefinitionAndSourceRegister > getDefSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the def instruction for Reg, and underlying value Register folding away any copies.
Definition Utils.cpp:469
LLVM_ABI void eraseInstrs(ArrayRef< MachineInstr * > DeadInstrs, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver=nullptr)
Definition Utils.cpp:1710
LLVM_ABI bool isKnownToBeAPowerOfTwo(const Value *V, const DataLayout &DL, bool OrZero=false, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr, bool UseInstrInfo=true, unsigned Depth=0)
Return true if the given value is known to have exactly one bit set when defined.
LLVM_ABI Register getSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the source register for Reg, folding away any trivial copies.
Definition Utils.cpp:501
LLVM_ABI LLVM_READNONE LLT getGCDType(LLT OrigTy, LLT TargetTy)
Return a type where the total size is the greatest common divisor of OrigTy and TargetTy.
Definition Utils.cpp:1282
LLVM_ABI bool isGuaranteedNotToBePoison(const Value *V, AssumptionCache *AC=nullptr, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, unsigned Depth=0)
Returns true if V cannot be poison, but may be undef.
LLVM_ABI std::optional< int64_t > getIConstantSplatSExtVal(const Register Reg, const MachineRegisterInfo &MRI)
Definition Utils.cpp:1465
LLVM_ABI bool isAssertMI(const MachineInstr &MI)
Returns true if the instruction MI is one of the assert instructions.
Definition Utils.cpp:2048
LLVM_ABI void extractVectorParts(Register Reg, unsigned NumElts, SmallVectorImpl< Register > &VRegs, MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
Version which handles irregular sub-vector splits.
Definition Utils.cpp:611
LLVM_ABI int getSplatIndex(ArrayRef< int > Mask)
If all non-negative Mask elements are the same value, return that value.
LLVM_ABI bool isTriviallyDead(const MachineInstr &MI, const MachineRegisterInfo &MRI)
Check whether an instruction MI is dead: it only defines dead virtual registers, and doesn't have oth...
Definition Utils.cpp:221
LLVM_ABI Align inferAlignFromPtrInfo(MachineFunction &MF, const MachinePointerInfo &MPO)
Definition Utils.cpp:904
#define MORE()
Definition regcomp.c:246
Simple struct used to hold a Register value and the instruction which defines it.
Definition Utils.h:229
This class contains a discriminated union of information about pointers in memory operands,...
Simple struct used to hold a constant integer value and a virtual register.
Definition Utils.h:188
Register VReg
Definition Utils.h:190