LLVM
8.0.1
|
#include "LanaiISelLowering.h"
#include "Lanai.h"
#include "LanaiCondCode.h"
#include "LanaiMachineFunctionInfo.h"
#include "LanaiSubtarget.h"
#include "LanaiTargetObjectFile.h"
#include "MCTargetDesc/LanaiBaseInfo.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RuntimeLibcalls.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/TargetCallingConv.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/MachineValueType.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <utility>
#include "LanaiGenCallingConv.inc"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "lanai-lower" |
Functions | |
static bool | CC_Lanai32_VarArg (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State) |
static LPCC::CondCode | IntCondCCodeToICC (SDValue CC, const SDLoc &DL, SDValue &RHS, SelectionDAG &DAG) |
static bool | isZeroOrAllOnes (SDValue N, bool AllOnes) |
static bool | isConditionalZeroOrAllOnes (SDNode *N, bool AllOnes, SDValue &CC, bool &Invert, SDValue &OtherOp, SelectionDAG &DAG) |
static SDValue | combineSelectAndUse (SDNode *N, SDValue Slct, SDValue OtherOp, TargetLowering::DAGCombinerInfo &DCI, bool AllOnes) |
static SDValue | combineSelectAndUseCommutative (SDNode *N, TargetLowering::DAGCombinerInfo &DCI, bool AllOnes) |
static SDValue | PerformSUBCombine (SDNode *N, TargetLowering::DAGCombinerInfo &DCI) |
Variables | |
static cl::opt< int > | LanaiLowerConstantMulThreshold ("lanai-constant-mul-threshold", cl::Hidden, cl::desc("Maximum number of instruction to generate when lowering constant " "multiplication instead of calling library function [default=14]"), cl::init(14)) |
static unsigned | NumFixedArgs |
#define DEBUG_TYPE "lanai-lower" |
Definition at line 56 of file LanaiISelLowering.cpp.
|
static |
Definition at line 369 of file LanaiISelLowering.cpp.
References llvm::ISD::ADD, llvm::MachineRegisterInfo::addLiveIn(), llvm::CCState::addLoc(), llvm::CCValAssign::AExt, llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::CCState::AllocateStack(), llvm::CCState::AnalyzeCallResult(), llvm::CCState::AnalyzeFormalArguments(), llvm::CCState::AnalyzeReturn(), llvm::ISD::ANY_EXTEND, Arg, assert(), llvm::ISD::AssertSext, llvm::ISD::AssertZext, llvm::CallingConv::C, llvm::LanaiISD::CALL, llvm::TargetLowering::CallLoweringInfo::CallConv, Callee, llvm::TargetLowering::CallLoweringInfo::Callee, llvm::TargetLowering::CallLoweringInfo::Chain, llvm::MachineFrameInfo::CreateFixedObject(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::TargetLowering::CallLoweringInfo::DAG, llvm::dbgs(), llvm::TargetLowering::CallLoweringInfo::DL, llvm::dyn_cast(), E, llvm::SmallVectorBase::empty(), llvm::errs(), llvm::CallingConv::Fast, first, llvm::CCValAssign::Full, G, llvm::ISD::ArgFlagsTy::getByValAlign(), llvm::ISD::ArgFlagsTy::getByValSize(), llvm::LanaiRegisterInfo::getCallPreservedMask(), llvm::SelectionDAG::getCALLSEQ_END(), llvm::SelectionDAG::getCALLSEQ_START(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getCopyFromReg(), llvm::SelectionDAG::getCopyToReg(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getEntryNode(), llvm::EVT::getEVTString(), llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::Function::getFunctionType(), llvm::MachineFunction::getInfo(), llvm::SelectionDAG::getIntPtrConstant(), llvm::SelectionDAG::getLoad(), llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocReg(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getMachineFunction(), llvm::CCValAssign::getMem(), llvm::SelectionDAG::getMemcpy(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::FunctionType::getNumParams(), llvm::TargetLoweringBase::getPointerTy(), llvm::TargetLoweringBase::getRegClassFor(), llvm::MachineFunction::getRegInfo(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getRegisterMask(), llvm::EVT::getSimpleVT(), llvm::MVT::getSizeInBits(), llvm::LanaiMachineFunctionInfo::getSRetReturnReg(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTargetExternalSymbol(), llvm::SelectionDAG::getTargetGlobalAddress(), llvm::SDValue::getValue(), llvm::SelectionDAG::getValueType(), llvm::CCValAssign::getValVT(), llvm::SelectionDAG::getVTList(), llvm::MVT::Glue, llvm::Function::hasStructRetAttr(), I, llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i8, llvm::MipsISD::Ins, llvm::TargetLowering::CallLoweringInfo::Ins, llvm::ISD::ArgFlagsTy::isByVal(), llvm::CCValAssign::isMemLoc(), llvm::CCValAssign::isRegLoc(), llvm::ISD::ArgFlagsTy::isSExt(), llvm::TargetLowering::CallLoweringInfo::IsTailCall, llvm::TargetLowering::CallLoweringInfo::IsVarArg, llvm::ISD::ArgFlagsTy::isZExt(), LLVM_DEBUG, llvm_unreachable, llvm::BitmaskEnumDetail::Mask(), llvm::LanaiII::MO_NO_FLAG, llvm::MVT::Other, llvm::TargetLowering::CallLoweringInfo::Outs, llvm::TargetLowering::CallLoweringInfo::OutVals, llvm::SmallVectorTemplateBase< T >::push_back(), Reg, llvm::report_fatal_error(), llvm::LanaiISD::RET_FLAG, second, llvm::LanaiMachineFunctionInfo::setSRetReturnReg(), llvm::LanaiMachineFunctionInfo::setVarArgsFrameIndex(), llvm::CCValAssign::SExt, llvm::ISD::SIGN_EXTEND, llvm::MVT::SimpleTy, Size, llvm::SmallVectorBase::size(), llvm::ISD::TokenFactor, llvm::ISD::TRUNCATE, llvm::ISD::ZERO_EXTEND, and llvm::CCValAssign::ZExt.
|
static |
Definition at line 1418 of file LanaiISelLowering.cpp.
References llvm::TargetLowering::DAGCombinerInfo::DAG, llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getValueType(), isConditionalZeroOrAllOnes(), llvm::ISD::SELECT, and std::swap().
Referenced by combineSelectAndUseCommutative(), and PerformSUBCombine().
|
static |
Definition at line 1443 of file LanaiISelLowering.cpp.
References combineSelectAndUse(), llvm::SDValue::getNode(), llvm::SDNode::getOperand(), and llvm::SDNode::hasOneUse().
Referenced by llvm::LanaiTargetLowering::PerformDAGCombine().
|
static |
Definition at line 801 of file LanaiISelLowering.cpp.
References llvm::SelectionDAG::getConstant(), llvm::SDValue::getValueType(), llvm::LPCC::ICC_EQ, llvm::LPCC::ICC_GE, llvm::LPCC::ICC_GT, llvm::LPCC::ICC_LE, llvm::LPCC::ICC_LT, llvm::LPCC::ICC_MI, llvm::LPCC::ICC_NE, llvm::LPCC::ICC_PL, llvm::LPCC::ICC_UGE, llvm::LPCC::ICC_UGT, llvm::LPCC::ICC_ULE, llvm::LPCC::ICC_ULT, llvm_unreachable, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETO, llvm::ISD::SETOEQ, llvm::ISD::SETOGE, llvm::ISD::SETOGT, llvm::ISD::SETOLE, llvm::ISD::SETOLT, llvm::ISD::SETONE, llvm::ISD::SETUEQ, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, llvm::ISD::SETULT, llvm::ISD::SETUNE, and llvm::ISD::SETUO.
Referenced by llvm::LanaiTargetLowering::LowerBR_CC(), llvm::LanaiTargetLowering::LowerSELECT_CC(), and llvm::LanaiTargetLowering::LowerSETCC().
|
static |
Definition at line 1347 of file LanaiISelLowering.cpp.
References llvm::APInt::getAllOnesValue(), llvm::SelectionDAG::getConstant(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::EVT::getSizeInBits(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::MVT::i1, isZeroOrAllOnes(), llvm::ISD::SELECT, llvm::ISD::SIGN_EXTEND, and llvm::ISD::ZERO_EXTEND.
Referenced by combineSelectAndUse().
Definition at line 1325 of file LanaiISelLowering.cpp.
References llvm::isAllOnesConstant(), and llvm::isNullConstant().
Referenced by isConditionalZeroOrAllOnes().
|
static |
Definition at line 1457 of file LanaiISelLowering.cpp.
References combineSelectAndUse(), llvm::SDValue::getNode(), llvm::SDNode::getOperand(), and llvm::SDNode::hasOneUse().
Referenced by llvm::LanaiTargetLowering::PerformDAGCombine().
|
static |
Referenced by llvm::LanaiTargetLowering::LowerMUL().
|
static |
Definition at line 368 of file LanaiISelLowering.cpp.
Referenced by CallingConvSupported(), and llvm::CallLowering::lowerCall().