22#define DEBUG_TYPE "mask"
33 return "Hexagon replace const ext tfri with mask";
43char HexagonMask::ID = 0;
45void HexagonMask::replaceConstExtTransferImmWithMask(
MachineFunction &MF) {
46 for (
auto &
MBB : MF) {
48 if (
MI.getOpcode() != Hexagon::A2_tfrsi)
51 const MachineOperand &Op0 =
MI.getOperand(0);
52 const MachineOperand &Op1 =
MI.getOperand(1);
74bool HexagonMask::runOnMachineFunction(MachineFunction &MF) {
76 HII = HST.getInstrInfo();
88 replaceConstExtTransferImmWithMask(MF);
97INITIALIZE_PASS(HexagonMask,
"hexagon-mask",
"Hexagon mask",
false,
false)
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
FunctionPass class - This class is used to implement most global optimizations.
LLVM_ABI instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
Register getReg() const
getReg - Returns the register number.
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
constexpr bool isShiftedMask_32(uint32_t Value)
Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit ver...
FunctionPass * createHexagonMask()
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.