LLVM 24.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#include <vector>
29
30namespace llvm {
31
32class AnalysisUsage;
35class MachineFunction;
36class MachineInstr;
38class MachineOperand;
43class MCInstrDesc;
45class TargetInstrInfo;
46class TargetLowering;
48class MCRegisterClass;
50class ConstantFP;
51class APFloat;
52
53// Convenience macros for dealing with vector reduction opcodes.
54#define GISEL_VECREDUCE_CASES_ALL \
55 case TargetOpcode::G_VECREDUCE_SEQ_FADD: \
56 case TargetOpcode::G_VECREDUCE_SEQ_FMUL: \
57 case TargetOpcode::G_VECREDUCE_FADD: \
58 case TargetOpcode::G_VECREDUCE_FMUL: \
59 case TargetOpcode::G_VECREDUCE_FMAX: \
60 case TargetOpcode::G_VECREDUCE_FMIN: \
61 case TargetOpcode::G_VECREDUCE_FMAXIMUM: \
62 case TargetOpcode::G_VECREDUCE_FMINIMUM: \
63 case TargetOpcode::G_VECREDUCE_FMAXIMUMNUM: \
64 case TargetOpcode::G_VECREDUCE_FMINIMUMNUM: \
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_FMAXIMUMNUM: \
83 case TargetOpcode::G_VECREDUCE_FMINIMUMNUM: \
84 case TargetOpcode::G_VECREDUCE_ADD: \
85 case TargetOpcode::G_VECREDUCE_MUL: \
86 case TargetOpcode::G_VECREDUCE_AND: \
87 case TargetOpcode::G_VECREDUCE_OR: \
88 case TargetOpcode::G_VECREDUCE_XOR: \
89 case TargetOpcode::G_VECREDUCE_SMAX: \
90 case TargetOpcode::G_VECREDUCE_SMIN: \
91 case TargetOpcode::G_VECREDUCE_UMAX: \
92 case TargetOpcode::G_VECREDUCE_UMIN:
93
94/// Try to constrain Reg to the specified register class. If this fails,
95/// create a new virtual register in the correct class.
96///
97/// \return The virtual register constrained to the right register class.
98LLVM_ABI Register constrainRegToClass(MachineRegisterInfo &MRI,
99 const TargetInstrInfo &TII,
100 const RegisterBankInfo &RBI, Register Reg,
101 const TargetRegisterClass &RegClass);
102
103/// Constrain the Register operand OpIdx, so that it is now constrained to the
104/// TargetRegisterClass passed as an argument (RegClass).
105/// If this fails, create a new virtual register in the correct class and insert
106/// a COPY before \p InsertPt if it is a use or after if it is a definition.
107/// In both cases, the function also updates the register of RegMo. The debug
108/// location of \p InsertPt is used for the new copy.
109///
110/// \return The virtual register constrained to the right register class.
112 const MachineFunction &MF, const TargetRegisterInfo &TRI,
113 MachineRegisterInfo &MRI, const TargetInstrInfo &TII,
114 const RegisterBankInfo &RBI, MachineInstr &InsertPt,
115 const TargetRegisterClass &RegClass, MachineOperand &RegMO);
116
117/// Try to constrain Reg so that it is usable by argument OpIdx of the provided
118/// MCInstrDesc \p II. If this fails, create a new virtual register in the
119/// correct class and insert a COPY before \p InsertPt if it is a use or after
120/// if it is a definition. In both cases, the function also updates the register
121/// of RegMo.
122/// This is equivalent to constrainOperandRegClass(..., RegClass, ...)
123/// with RegClass obtained from the MCInstrDesc. The debug location of \p
124/// InsertPt is used for the new copy.
125///
126/// \return The virtual register constrained to the right register class.
128 const MachineFunction &MF, const TargetRegisterInfo &TRI,
129 MachineRegisterInfo &MRI, const TargetInstrInfo &TII,
130 const RegisterBankInfo &RBI, MachineInstr &InsertPt, const MCInstrDesc &II,
131 MachineOperand &RegMO, unsigned OpIdx);
132
133/// Mutate the newly-selected instruction \p I to constrain its (possibly
134/// generic) virtual register operands to the instruction's register class.
135/// This could involve inserting COPYs before (for uses) or after (for defs).
136/// This requires the number of operands to match the instruction description.
137// FIXME: Not all instructions have the same number of operands. We should
138// probably expose a constrain helper per operand and let the target selector
139// constrain individual registers, like fast-isel.
141 const TargetInstrInfo &TII,
142 const TargetRegisterInfo &TRI,
143 const RegisterBankInfo &RBI);
144
145/// Check if DstReg can be replaced with SrcReg depending on the register
146/// constraints.
147LLVM_ABI bool canReplaceReg(Register DstReg, Register SrcReg,
148 MachineRegisterInfo &MRI);
149
150/// Check whether an instruction \p MI is dead: it only defines dead virtual
151/// registers, and doesn't have other side effects.
152LLVM_ABI bool isTriviallyDead(const MachineInstr &MI,
153 const MachineRegisterInfo &MRI);
154
155/// Report an ISel error as a missed optimization remark to the LLVMContext's
156/// diagnostic stream. Set the FailedISel MachineFunction property.
158 MachineOptimizationRemarkEmitter &MORE,
159 MachineOptimizationRemarkMissed &R);
160
162 MachineOptimizationRemarkEmitter &MORE,
163 const char *PassName, StringRef Msg,
164 const MachineInstr &MI);
165
166/// Report an ISel warning as a missed optimization remark to the LLVMContext's
167/// diagnostic stream.
169 MachineOptimizationRemarkEmitter &MORE,
170 MachineOptimizationRemarkMissed &R);
171
172/// Returns the inverse opcode of \p MinMaxOpc, which is a generic min/max
173/// opcode like G_SMIN.
174LLVM_ABI unsigned getInverseGMinMaxOpcode(unsigned MinMaxOpc);
175
176/// If \p VReg is defined by a G_CONSTANT, return the corresponding value.
177LLVM_ABI std::optional<APInt>
178getIConstantVRegVal(Register VReg, const MachineRegisterInfo &MRI);
179
180/// If \p VReg is defined by a G_CONSTANT fits in int64_t returns it.
181LLVM_ABI std::optional<int64_t>
182getIConstantVRegSExtVal(Register VReg, const MachineRegisterInfo &MRI);
183
184/// \p VReg is defined by a G_CONSTANT, return the corresponding value.
185LLVM_ABI const APInt &getIConstantFromReg(Register VReg,
186 const MachineRegisterInfo &MRI);
187
188/// Simple struct used to hold a constant integer value and a virtual
189/// register.
194
195/// If \p VReg is defined by a statically evaluable chain of instructions rooted
196/// on a G_CONSTANT returns its APInt value and def register.
197LLVM_ABI std::optional<ValueAndVReg>
200 bool LookThroughInstrs = true);
201
202/// If \p VReg is defined by a statically evaluable chain of instructions rooted
203/// on a G_CONSTANT or G_FCONSTANT returns its value as APInt and def register.
204LLVM_ABI std::optional<ValueAndVReg> getAnyConstantVRegValWithLookThrough(
205 Register VReg, const MachineRegisterInfo &MRI,
206 bool LookThroughInstrs = true, bool LookThroughAnyExt = false);
207
209 std::tuple<Register, Register, uint64_t, Align, bool, std::vector<LLT>>;
210
211/// Matcher for memcpy-like instructions. For non-zero lengths, \p MemOps
212/// contains the load/store types to emit.
215 unsigned MaxLen, Register &Dst,
216 Register &Src, uint64_t &KnownLen,
217 Align &Alignment, bool &DstAlignCanChange,
218 std::vector<LLT> &MemOps);
219
224
225/// If \p VReg is defined by a statically evaluable chain of instructions rooted
226/// on a G_FCONSTANT returns its APFloat value and def register. The value uses
227/// \p VReg's FP semantics when it has a known FP type, otherwise the
228/// G_FCONSTANT's unless the chain changed the bit width.
229LLVM_ABI std::optional<FPValueAndVReg>
232 bool LookThroughInstrs = true);
233
235 const MachineRegisterInfo &MRI);
236
237/// See if Reg is defined by an single def instruction that is
238/// Opcode. Also try to do trivial folding if it's a COPY with
239/// same types. Returns null otherwise.
241 const MachineRegisterInfo &MRI);
242
243/// Simple struct used to hold a Register value and the instruction which
244/// defines it.
249
250/// Find the def instruction for \p Reg, and underlying value Register folding
251/// away any copies.
252///
253/// Also walks through hints such as G_ASSERT_ZEXT.
254LLVM_ABI std::optional<DefinitionAndSourceRegister>
256
257/// Find the def instruction for \p Reg, folding away any trivial copies. May
258/// return nullptr if \p Reg is not a generic virtual register.
259///
260/// Also walks through hints such as G_ASSERT_ZEXT.
262 const MachineRegisterInfo &MRI);
263
264/// Find the source register for \p Reg, folding away any trivial copies. It
265/// will be an output register of the instruction that getDefIgnoringCopies
266/// returns. May return an invalid register if \p Reg is not a generic virtual
267/// register.
268///
269/// Also walks through hints such as G_ASSERT_ZEXT.
271 const MachineRegisterInfo &MRI);
272
273/// Helper function to split a wide generic register into bitwise blocks with
274/// the given Type (which implies the number of blocks needed). The generic
275/// registers created are appended to Ops, starting at bit 0 of Reg.
278 MachineIRBuilder &MIRBuilder,
280
281/// Version which handles irregular splits.
282LLVM_ABI bool extractParts(Register Reg, LLT RegTy, LLT MainTy, LLT &LeftoverTy,
284 SmallVectorImpl<Register> &LeftoverVRegs,
285 MachineIRBuilder &MIRBuilder,
287
288/// Version which handles irregular sub-vector splits.
289LLVM_ABI void extractVectorParts(Register Reg, unsigned NumElts,
291 MachineIRBuilder &MIRBuilder,
293
294// Templated variant of getOpcodeDef returning a MachineInstr derived T.
295/// See if Reg is defined by an single def instruction of type T
296/// Also try to do trivial folding if it's a COPY with
297/// same types. Returns null otherwise.
298template <class T>
303
304/// Modify analysis usage so it preserves passes required for the SelectionDAG
305/// fallback.
306LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU);
307
308LLVM_ABI std::optional<APInt> ConstantFoldBinOp(unsigned Opcode,
309 const Register Op1,
310 const Register Op2,
311 const MachineRegisterInfo &MRI);
312LLVM_ABI std::optional<APFloat>
313ConstantFoldFPBinOp(unsigned Opcode, const Register Op1, const Register Op2,
314 const MachineRegisterInfo &MRI);
315
316/// Tries to constant fold a vector binop with sources \p Op1 and \p Op2.
317/// Returns an empty vector on failure.
319ConstantFoldVectorBinop(unsigned Opcode, const Register Op1, const Register Op2,
320 const MachineRegisterInfo &MRI);
321
322/// Tries to constant fold a vector floating-point binop with sources \p Op1 and
323/// \p Op2. Returns an empty vector on failure.
324LLVM_ABI SmallVector<APFloat>
325ConstantFoldVectorFPBinop(unsigned Opcode, const Register Op1,
326 const Register Op2, const MachineRegisterInfo &MRI);
327
328LLVM_ABI std::optional<APInt>
329ConstantFoldCastOp(unsigned Opcode, LLT DstTy, const Register Op0,
330 const MachineRegisterInfo &MRI);
331
332LLVM_ABI std::optional<APInt> ConstantFoldExtOp(unsigned Opcode,
333 const Register Op1,
335 const MachineRegisterInfo &MRI);
336
337LLVM_ABI std::optional<APFloat>
338ConstantFoldIntToFloat(unsigned Opcode, LLT DstTy, Register Src,
339 const MachineRegisterInfo &MRI);
340
341/// Tries to constant fold a unary integer operation (G_CTLZ, G_CTTZ, G_CTPOP
342/// and their _ZERO_POISON variants, G_ABS, G_BSWAP, G_BITREVERSE) on \p Src.
343/// If \p Src is a vector then it tries to do an element-wise constant fold.
345ConstantFoldUnaryIntOp(unsigned Opcode, LLT DstTy, Register Src,
346 const MachineRegisterInfo &MRI);
347
348/// Tries to constant fold a unary floating-point operation on \p Src.
349/// If \p Src is a vector then it tries to do an element-wise constant fold.
350LLVM_ABI SmallVector<APFloat>
351ConstantFoldUnaryFPOp(unsigned Opcode, LLT DstTy, Register Src,
352 const MachineRegisterInfo &MRI);
353
354LLVM_ABI std::optional<SmallVector<APInt>>
355ConstantFoldICmp(unsigned Pred, const Register Op1, const Register Op2,
356 unsigned DstScalarSizeInBits, unsigned ExtOp,
357 const MachineRegisterInfo &MRI);
358
359/// Test if the given value is known to have exactly one bit set. This differs
360/// from computeKnownBits in that it doesn't necessarily determine which bit is
361/// set. When \p OrNegative is true, the value is also considered a power of two
362/// if its negation is a power of two (i.e. its absolute value is a power of
363/// two). When \p OrZero is true, the value is also considered a power of two if
364/// it may be zero (i.e. it is known to be either zero or a power of two).
365LLVM_ABI bool
366isKnownToBeAPowerOfTwo(Register Val, const MachineRegisterInfo &MRI,
367 GISelValueTracking *ValueTracking = nullptr,
368 bool OrNegative = false, bool OrZero = false);
369
371 const MachinePointerInfo &MPO);
372
373/// Return a virtual register corresponding to the incoming argument register \p
374/// PhysReg. This register is expected to have class \p RC, and optional type \p
375/// RegTy. This assumes all references to the register will use the same type.
376///
377/// If there is an existing live-in argument register, it will be returned.
378/// This will also ensure there is a valid copy
380 MachineFunction &MF, const TargetInstrInfo &TII, MCRegister PhysReg,
381 const TargetRegisterClass &RC, const DebugLoc &DL, LLT RegTy = LLT());
382
383/// Return the least common multiple type of \p OrigTy and \p TargetTy, by
384/// changing the number of vector elements or scalar bitwidth. The intent is a
385/// G_MERGE_VALUES, G_BUILD_VECTOR, or G_CONCAT_VECTORS can be constructed from
386/// \p OrigTy elements, and unmerged into \p TargetTy. It is an error to call
387/// this function where one argument is a fixed vector and the other is a
388/// scalable vector, since it is illegal to build a G_{MERGE|UNMERGE}_VALUES
389/// between fixed and scalable vectors.
390LLVM_ABI LLVM_READNONE LLT getLCMType(LLT OrigTy, LLT TargetTy);
391
393 /// Return smallest type that covers both \p OrigTy and \p TargetTy and is
394 /// multiple of TargetTy.
395 LLT
396 getCoverTy(LLT OrigTy, LLT TargetTy);
397
398/// Return a type where the total size is the greatest common divisor of \p
399/// OrigTy and \p TargetTy. This will try to either change the number of vector
400/// elements, or bitwidth of scalars. The intent is the result type can be used
401/// as the result of a G_UNMERGE_VALUES from \p OrigTy, and then some
402/// combination of G_MERGE_VALUES, G_BUILD_VECTOR and G_CONCAT_VECTORS (possibly
403/// with intermediate casts) can re-form \p TargetTy.
404///
405/// If these are vectors with different element types, this will try to produce
406/// a vector with a compatible total size, but the element type of \p OrigTy. If
407/// this can't be satisfied, this will produce a scalar smaller than the
408/// original vector elements. It is an error to call this function where
409/// one argument is a fixed vector and the other is a scalable vector, since it
410/// is illegal to build a G_{MERGE|UNMERGE}_VALUES between fixed and scalable
411/// vectors.
412///
413/// In the worst case, this returns LLT::scalar(1)
414LLVM_ABI LLVM_READNONE LLT getGCDType(LLT OrigTy, LLT TargetTy);
415
416/// \returns The splat index of a G_SHUFFLE_VECTOR \p MI when \p MI is a splat.
417/// If \p MI is not a splat, returns std::nullopt.
418LLVM_ABI std::optional<int> getSplatIndex(MachineInstr &MI);
419
420/// \returns the scalar integral splat value of \p Reg if possible.
421LLVM_ABI std::optional<APInt>
422getIConstantSplatVal(const Register Reg, const MachineRegisterInfo &MRI);
423
424/// \returns the scalar integral splat value defined by \p MI if possible.
425LLVM_ABI std::optional<APInt>
426getIConstantSplatVal(const MachineInstr &MI, const MachineRegisterInfo &MRI);
427
428/// \returns the scalar sign extended integral splat value of \p Reg if
429/// possible.
430LLVM_ABI std::optional<int64_t>
431getIConstantSplatSExtVal(const Register Reg, const MachineRegisterInfo &MRI);
432
433/// \returns the scalar sign extended integral splat value defined by \p MI if
434/// possible.
435LLVM_ABI std::optional<int64_t>
436getIConstantSplatSExtVal(const MachineInstr &MI,
437 const MachineRegisterInfo &MRI);
438
439/// Returns a floating point scalar constant of a build vector splat if it
440/// exists. When \p AllowUndef == true some elements can be undef but not all.
441LLVM_ABI std::optional<FPValueAndVReg>
442getFConstantSplat(Register VReg, const MachineRegisterInfo &MRI,
443 bool AllowUndef = true);
444
445/// Return true if the specified register is defined by G_BUILD_VECTOR or
446/// G_BUILD_VECTOR_TRUNC where all of the elements are \p SplatValue or undef.
448 const MachineRegisterInfo &MRI,
449 int64_t SplatValue, bool AllowUndef);
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 const APInt &SplatValue,
456 bool AllowUndef);
457
458/// Return true if the specified instruction is a G_BUILD_VECTOR or
459/// G_BUILD_VECTOR_TRUNC where all of the elements are \p SplatValue or undef.
460LLVM_ABI bool isBuildVectorConstantSplat(const MachineInstr &MI,
461 const MachineRegisterInfo &MRI,
462 int64_t SplatValue, 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 const APInt &SplatValue,
469 bool AllowUndef);
470
471/// Return true if the specified instruction is a G_BUILD_VECTOR or
472/// G_BUILD_VECTOR_TRUNC where all of the elements are 0 or undef.
473LLVM_ABI bool isBuildVectorAllZeros(const MachineInstr &MI,
474 const MachineRegisterInfo &MRI,
475 bool AllowUndef = false);
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 isBuildVectorAllOnes(const MachineInstr &MI,
480 const MachineRegisterInfo &MRI,
481 bool AllowUndef = false);
482
483/// Return true if the specified instruction is known to be a constant, or a
484/// vector of constants.
485///
486/// If \p AllowFP is true, this will consider G_FCONSTANT in addition to
487/// G_CONSTANT. If \p AllowOpaqueConstants is true, constant-like instructions
488/// such as G_GLOBAL_VALUE will also be considered.
489LLVM_ABI bool isConstantOrConstantVector(const MachineInstr &MI,
490 const MachineRegisterInfo &MRI,
491 bool AllowFP = true,
492 bool AllowOpaqueConstants = true);
493
494/// Return true if the value is a constant 0 integer or a splatted vector of a
495/// constant 0 integer (with no undefs if \p AllowUndefs is false). This will
496/// handle G_BUILD_VECTOR and G_BUILD_VECTOR_TRUNC as truncation is not an issue
497/// for null values.
498LLVM_ABI bool isNullOrNullSplat(const MachineInstr &MI,
499 const MachineRegisterInfo &MRI,
500 bool AllowUndefs = false);
501
502/// Return true if the value is a constant -1 integer or a splatted vector of a
503/// constant -1 integer (with no undefs if \p AllowUndefs is false).
504LLVM_ABI bool isAllOnesOrAllOnesSplat(const MachineInstr &MI,
505 const MachineRegisterInfo &MRI,
506 bool AllowUndefs = false);
507
508/// \returns a value when \p MI is a vector splat.
509LLVM_ABI std::optional<Register> getVectorSplat(const MachineInstr &MI,
510 const MachineRegisterInfo &MRI);
511
512/// Determines if \p MI defines a constant integer or a build vector of
513/// constant integers. Treats undef values as constants.
514LLVM_ABI bool isConstantOrConstantVector(MachineInstr &MI,
515 const MachineRegisterInfo &MRI);
516
517/// Determines if \p Def defines a constant integer or a splat vector of
518/// constant integers.
519/// \returns the scalar constant or std::nullopt.
520LLVM_ABI std::optional<APInt>
521isConstantOrConstantSplatVector(Register Def, const MachineRegisterInfo &MRI);
522
523/// Determines if \p Def defines a float constant integer or a splat vector of
524/// float constant integers.
525/// \returns the float constant or std::nullopt.
526LLVM_ABI std::optional<APFloat>
527isConstantOrConstantSplatVectorFP(Register Def, const MachineRegisterInfo &MRI);
528
529/// Attempt to match a unary predicate against a scalar/splat constant or every
530/// element of a constant G_BUILD_VECTOR. If \p ConstVal is null, the source
531/// value was undef.
532LLVM_ABI bool
533matchUnaryPredicate(const MachineRegisterInfo &MRI, Register Reg,
534 llvm::function_ref<bool(const Constant *ConstVal)> Match,
535 bool AllowUndefs = false);
536
537/// Returns true if given the TargetLowering's boolean contents information,
538/// the value \p Val contains a true value.
539LLVM_ABI bool isConstTrueVal(const TargetLowering &TLI, int64_t Val,
540 bool IsVector);
541/// \returns true if given the TargetLowering's boolean contents information,
542/// the value \p Val contains a false value.
543LLVM_ABI bool isConstFalseVal(const TargetLowering &TLI, int64_t Val,
544 bool IsVector);
545
546/// Returns an integer representing true, as defined by the
547/// TargetBooleanContents.
548LLVM_ABI int64_t getICmpTrueVal(const TargetLowering &TLI, bool IsVector);
549
552 LostDebugLocObserver *LocObserver,
553 SmallInstListTy &DeadInstChain);
556 LostDebugLocObserver *LocObserver = nullptr);
558 LostDebugLocObserver *LocObserver = nullptr);
559
560/// Assuming the instruction \p MI is going to be deleted, attempt to salvage
561/// debug users of \p MI by writing the effect of \p MI in a DIExpression.
564
565/// Returns whether opcode \p Opc is a pre-isel generic floating-point opcode,
566/// having only floating-point operands.
568
569/// Returns true if \p Reg can create undef or poison from non-undef &
570/// non-poison operands. \p ConsiderFlagsAndMetadata controls whether poison
571/// producing flags and metadata on the instruction are considered. This can be
572/// used to see if the instruction could still introduce undef or poison even
573/// without poison generating flags and metadata which might be on the
574/// instruction.
577 bool ConsiderFlagsAndMetadata = true);
578
579/// Returns true if \p Reg can create poison from non-poison operands.
581 bool ConsiderFlagsAndMetadata = true);
582
583/// Returns true if \p Reg cannot be poison and undef.
586 unsigned Depth = 0);
587
588/// Returns true if \p Reg cannot be poison, but may be undef.
591 unsigned Depth = 0);
592
593/// Returns true if \p Reg cannot be undef, but may be poison.
596 unsigned Depth = 0);
597
598/// Get the type back from LLT. It won't be 100 percent accurate but returns an
599/// estimate of the type.
601
602/// Returns true if the instruction \p MI is one of the assert
603/// instructions.
605
606/// An integer-like constant.
607///
608/// It abstracts over scalar, fixed-length vectors, and scalable vectors.
609/// In the common case, it provides a common API and feels like an APInt,
610/// while still providing low-level access.
611/// It can be used for constant-folding.
612///
613/// bool isZero()
614/// abstracts over the kind.
615///
616/// switch(const.getKind())
617/// {
618/// }
619/// provides low-level access.
621public:
623
624private:
625 GIConstantKind Kind;
627 APInt Value;
628
629public:
631 : Kind(GIConstantKind::FixedVector), Values(Values) {};
632 GIConstant(const APInt &Value, GIConstantKind Kind)
633 : Kind(Kind), Value(Value) {};
634
635 /// Returns the kind of of this constant, e.g, Scalar.
636 GIConstantKind getKind() const { return Kind; }
637
638 /// Returns the value, if this constant is a scalar.
640
641 LLVM_ABI static std::optional<GIConstant>
643};
644
645/// An floating-point-like constant.
646///
647/// It abstracts over scalar, fixed-length vectors, and scalable vectors.
648/// In the common case, it provides a common API and feels like an APFloat,
649/// while still providing low-level access.
650/// It can be used for constant-folding.
651///
652/// bool isZero()
653/// abstracts over the kind.
654///
655/// switch(const.getKind())
656/// {
657/// }
658/// provides low-level access.
660 using VecTy = SmallVector<APFloat>;
661 using const_iterator = VecTy::const_iterator;
662
663public:
665
666private:
667 GFConstantKind Kind;
669
670public:
672 : Kind(GFConstantKind::FixedVector), Values(Values) {};
673 GFConstant(const APFloat &Value, GFConstantKind Kind) : Kind(Kind) {
674 Values.push_back(Value);
675 }
676
677 /// Returns the kind of of this constant, e.g, Scalar.
678 GFConstantKind getKind() const { return Kind; }
679
680 const_iterator begin() const {
682 "Expected fixed vector or scalar constant");
683 return Values.begin();
684 }
685
686 const_iterator end() const {
688 "Expected fixed vector or scalar constant");
689 return Values.end();
690 }
691
692 size_t size() const {
693 assert(Kind == GFConstantKind::FixedVector && "Expected fixed vector");
694 return Values.size();
695 }
696
697 /// Returns the value, if this constant is a scalar.
699
700 LLVM_ABI static std::optional<GFConstant>
702};
703
704} // End namespace llvm.
705#endif
MachineInstrBuilder MachineInstrBuilder & DefMI
unsigned NumParts
const TargetLowering & TLI
SDValue Pred
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
const AArch64InstrInfo MachineBasicBlock::iterator InsertPt
const AArch64InstrInfo & TII
uint64_t uint64_t
uint64_t Imm
This file declares a class to represent arbitrary precision floating point values and provide a varie...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define LLVM_READNONE
Definition Compiler.h:327
#define LLVM_ABI
Definition Compiler.h:211
IRTranslator LLVM IR MI
unsigned Opc
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
uint64_t IntrinsicInst * II
MachineRegisterInfo & MRI
const char * Msg
static const char PassName[]
Class for arbitrary precision integers.
Definition APInt.h:78
Represent the analysis usage information of a pass.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
ConstantFP - Floating Point Values [float, double].
Definition Constants.h:420
const_iterator begin() const
Definition Utils.h:680
static LLVM_ABI std::optional< GFConstant > getConstant(Register Const, const MachineRegisterInfo &MRI)
Definition Utils.cpp:2203
GFConstant(const APFloat &Value, GFConstantKind Kind)
Definition Utils.h:673
GFConstant(ArrayRef< APFloat > Values)
Definition Utils.h:671
GFConstantKind getKind() const
Returns the kind of of this constant, e.g, Scalar.
Definition Utils.h:678
LLVM_ABI APFloat getScalarValue() const
Returns the value, if this constant is a scalar.
Definition Utils.cpp:2196
const_iterator end() const
Definition Utils.h:686
size_t size() const
Definition Utils.h:692
LLVM_ABI APInt getScalarValue() const
Returns the value, if this constant is a scalar.
Definition Utils.cpp:2156
GIConstant(const APInt &Value, GIConstantKind Kind)
Definition Utils.h:632
static LLVM_ABI std::optional< GIConstant > getConstant(Register Const, const MachineRegisterInfo &MRI)
Definition Utils.cpp:2163
GIConstantKind getKind() const
Returns the kind of of this constant, e.g, Scalar.
Definition Utils.h:636
GIConstant(ArrayRef< APInt > Values)
Definition Utils.h:630
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
Describe properties that are true of each instruction in the target description file.
MCRegisterClass - Base class of TargetRegisterClass.
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,...
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...
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:46
LLVM Value Representation.
Definition Value.h:75
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
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:896
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:1113
LLVM_ABI std::optional< APInt > isConstantOrConstantSplatVector(Register Def, const MachineRegisterInfo &MRI)
Determines if Def defines a constant integer or a splat vector of constant integers.
Definition Utils.cpp:1678
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:1594
LLVM_ABI Type * getTypeForLLT(LLT Ty, LLVMContext &C)
Get the type back from LLT.
Definition Utils.cpp:2138
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:64
LLVM_ABI bool isKnownToBeAPowerOfTwo(const Value *V, bool OrZero, const SimplifyQuery &Q, unsigned Depth=0)
Return true if the given value is known to have exactly one bit set when defined.
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:679
LLVM_ABI std::optional< APFloat > isConstantOrConstantSplatVectorFP(Register Def, const MachineRegisterInfo &MRI)
Determines if Def defines a float constant integer or a splat vector of float constant integers.
Definition Utils.cpp:1690
LLVM_ABI const ConstantFP * getConstantFPVRegVal(Register VReg, const MachineRegisterInfo &MRI)
Definition Utils.cpp:487
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:301
RelativeUniformCounterPtr Values
Definition InstrProf.h:91
LLVM_ABI std::optional< APFloat > ConstantFoldIntToFloat(unsigned Opcode, LLT DstTy, Register Src, const MachineRegisterInfo &MRI)
Definition Utils.cpp:970
LLVM_ABI std::optional< APInt > getIConstantSplatVal(const Register Reg, const MachineRegisterInfo &MRI)
Definition Utils.cpp:1554
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:1716
LLVM_ABI std::optional< APFloat > ConstantFoldFPBinOp(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
Definition Utils.cpp:754
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:1833
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:163
LLVM_ABI bool matchUnaryPredicate(const MachineRegisterInfo &MRI, Register Reg, llvm::function_ref< 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:1729
LLVM_ABI std::optional< APInt > ConstantFoldExtOp(unsigned Opcode, const Register Op1, uint64_t Imm, const MachineRegisterInfo &MRI)
Definition Utils.cpp:929
GISelWorkList< 4 > SmallInstListTy
Definition Utils.h:550
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:1700
LLVM_ABI MachineInstr * getDefIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the def instruction for Reg, folding away any trivial copies.
Definition Utils.cpp:520
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:259
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 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:1301
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:321
LLVM_ABI std::optional< APInt > ConstantFoldBinOp(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
Definition Utils.cpp:685
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:312
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:1658
LLVM_ABI bool isConstFalseVal(const TargetLowering &TLI, int64_t Val, bool IsVector)
Definition Utils.cpp:1775
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:207
LLVM_ABI bool isConstTrueVal(const TargetLowering &TLI, int64_t Val, bool IsVector)
Returns true if given the TargetLowering's boolean contents information, the value Val contains a tru...
Definition Utils.cpp:1762
LLVM_ABI void saveUsesAndErase(MachineInstr &MI, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver, SmallInstListTy &DeadInstChain)
Definition Utils.cpp:1798
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:265
std::tuple< Register, Register, uint64_t, Align, bool, std::vector< LLT > > MemCpyFamilyLoweringInfo
Definition Utils.h:208
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:446
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:1600
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:832
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:1587
LLVM_ABI std::optional< APInt > ConstantFoldCastOp(unsigned Opcode, LLT DstTy, const Register Op0, const MachineRegisterInfo &MRI)
Definition Utils.cpp:946
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:534
LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
Definition Utils.cpp:1297
LLVM_ABI bool canLowerMemCpyFamily(const MachineInstr &MI, const MachineRegisterInfo &MRI, unsigned MaxLen, Register &Dst, Register &Src, uint64_t &KnownLen, Align &Alignment, bool &DstAlignCanChange, std::vector< LLT > &MemOps)
Matcher for memcpy-like instructions.
Definition Utils.cpp:2305
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:1368
LLVM_ABI SmallVector< APFloat > ConstantFoldUnaryFPOp(unsigned Opcode, LLT DstTy, Register Src, const MachineRegisterInfo &MRI)
Tries to constant fold a unary floating-point operation on Src.
Definition Utils.cpp:1031
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:286
LLVM_ABI SmallVector< APFloat > ConstantFoldVectorFPBinop(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
Tries to constant fold a vector floating-point binop with sources Op1 and Op2.
Definition Utils.cpp:855
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:454
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:1513
LLVM_ABI void eraseInstr(MachineInstr &MI, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver=nullptr)
Definition Utils.cpp:1828
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:54
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:440
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:1858
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:495
LLVM_ABI SmallVector< APInt > ConstantFoldUnaryIntOp(unsigned Opcode, LLT DstTy, Register Src, const MachineRegisterInfo &MRI)
Tries to constant fold a unary integer operation (G_CTLZ, G_CTTZ, G_CTPOP and their _ZERO_POISON vari...
Definition Utils.cpp:983
LLVM_ABI std::optional< Register > getVectorSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI)
Definition Utils.cpp:1606
LLVM_ABI void eraseInstrs(ArrayRef< MachineInstr * > DeadInstrs, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver=nullptr)
Definition Utils.cpp:1813
LLVM_ABI int64_t getICmpTrueVal(const TargetLowering &TLI, bool IsVector)
Returns an integer representing true, as defined by the TargetBooleanContents.
Definition Utils.cpp:1787
LLVM_ABI Register getSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the source register for Reg, folding away any trivial copies.
Definition Utils.cpp:527
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:1389
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:1572
LLVM_ABI bool isAssertMI(const MachineInstr &MI)
Returns true if the instruction MI is one of the assert instructions.
Definition Utils.cpp:2145
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:637
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:228
MCRegisterClass TargetRegisterClass
Definition FastISel.h:58
LLVM_ABI Align inferAlignFromPtrInfo(MachineFunction &MF, const MachinePointerInfo &MPO)
Definition Utils.cpp:879
#define MORE()
Definition regcomp.c:247
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
Simple struct used to hold a Register value and the instruction which defines it.
Definition Utils.h:245
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:190
Register VReg
Definition Utils.h:192