LLVM 17.0.0git
|
#include "AArch64GlobalISelUtils.h"
#include "AArch64TargetMachine.h"
#include "llvm/CodeGen/GlobalISel/CSEInfo.h"
#include "llvm/CodeGen/GlobalISel/Combiner.h"
#include "llvm/CodeGen/GlobalISel/CombinerHelper.h"
#include "llvm/CodeGen/GlobalISel/CombinerInfo.h"
#include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"
#include "llvm/CodeGen/GlobalISel/MIPatternMatch.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Support/Debug.h"
#include "AArch64GenPreLegalizeGICombiner.inc"
Go to the source code of this file.
Classes | |
class | AArch64PreLegalizerCombinerHelperState |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | DEBUG_TYPE "aarch64-prelegalizer-combiner" |
#define | AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_DEPS |
#define | AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_H |
#define | AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_CPP |
Variables | |
DEBUG_TYPE | |
Combine AArch64 machine instrs before | legalization |
Combine AArch64 machine instrs before | false |
#define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_CPP |
Definition at line 415 of file AArch64PreLegalizerCombiner.cpp.
#define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_DEPS |
Definition at line 349 of file AArch64PreLegalizerCombiner.cpp.
#define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_H |
Definition at line 354 of file AArch64PreLegalizerCombiner.cpp.
#define DEBUG_TYPE "aarch64-prelegalizer-combiner" |
Definition at line 31 of file AArch64PreLegalizerCombiner.cpp.
|
static |
Change a G_FCONSTANT into a G_CONSTANT.
Definition at line 54 of file AArch64PreLegalizerCombiner.cpp.
References assert(), llvm::APFloat::bitcastToAPInt(), llvm::MachineIRBuilder::buildConstant(), and MI.
|
static |
Definition at line 184 of file AArch64PreLegalizerCombiner.cpp.
References B, llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingInstr(), MI, MRI, llvm::Offset, and llvm::LLT::scalar().
|
static |
Definition at line 94 of file AArch64PreLegalizerCombiner.cpp.
References assert(), Builder, llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingInstr(), MI, and MRI.
INITIALIZE_PASS_BEGIN | ( | AArch64PreLegalizerCombiner | , |
DEBUG_TYPE | , | ||
"Combine AArch64 machine instrs before legalization" | , | ||
false | , | ||
false | |||
) |
|
static |
Return true if a G_FCONSTANT instruction is known to be better-represented as a G_CONSTANT.
Definition at line 38 of file AArch64PreLegalizerCombiner.cpp.
References llvm::all_of(), assert(), MI, and MRI.
|
static |
e.g.
g = G_GLOBAL_VALUE @x -> g = G_GLOBAL_VALUE @x + cst
Definition at line 117 of file AArch64PreLegalizerCombiner.cpp.
References assert(), llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::getIConstantVRegValWithLookThrough(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), MI, llvm::AArch64II::MO_NO_FLAG, and MRI.
|
static |
Try to match a G_ICMP of a G_TRUNC with zero, in which the truncated bits are sign bits.
In this case, we can transform the G_ICMP to directly compare the wide value with a zero.
Definition at line 65 of file AArch64PreLegalizerCombiner.cpp.
References assert(), llvm::GISelKnownBits::computeNumSignBits(), llvm::LLT::getSizeInBits(), llvm::ICmpInst::isEquality(), llvm::LLT::isScalar(), LHS, llvm::MIPatternMatch::m_GTrunc(), llvm::MIPatternMatch::m_Reg(), llvm::MIPatternMatch::m_SpecificICst(), MI, llvm::MIPatternMatch::mi_match(), MRI, and RHS.
|
static |
Definition at line 225 of file AArch64PreLegalizerCombiner.cpp.
References llvm::any_of(), B, llvm::GISelChangeObserver::erasingInstr(), llvm::MachineOperand::getImm(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), llvm::LLT::getScalarSizeInBits(), I, llvm::CmpInst::ICMP_NE, llvm::LLT::isScalar(), llvm::MIPatternMatch::m_GTrunc(), llvm::MIPatternMatch::m_GZExt(), llvm::MIPatternMatch::m_Reg(), llvm::make_early_inc_range(), MI, llvm::MIPatternMatch::mi_match(), MRI, llvm::CombinerHelper::replaceRegWith(), llvm::LLT::scalar(), and llvm::MachineBasicBlock::succ_empty().
DEBUG_TYPE |
Definition at line 483 of file AArch64PreLegalizerCombiner.cpp.
Combine AArch64 machine instrs before false |
Definition at line 484 of file AArch64PreLegalizerCombiner.cpp.
Combine AArch64 machine instrs before legalization |
Definition at line 484 of file AArch64PreLegalizerCombiner.cpp.