#include "SystemZTargetMachine.h"
#include "SystemZISelLowering.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;
#define DEBUG_TYPE …
#define PASS_NAME …
namespace {
struct SystemZAddressingMode { … };
static uint64_t allOnes(unsigned int Count) { … }
struct RxSBGOperands { … };
class SystemZDAGToDAGISel : public SelectionDAGISel { … };
class SystemZDAGToDAGISelLegacy : public SelectionDAGISelLegacy { … };
}
char SystemZDAGToDAGISelLegacy::ID = …;
INITIALIZE_PASS(…)
FunctionPass *llvm::createSystemZISelDag(SystemZTargetMachine &TM,
CodeGenOptLevel OptLevel) { … }
static bool selectDisp(SystemZAddressingMode::DispRange DR, int64_t Val) { … }
static void changeComponent(SystemZAddressingMode &AM, bool IsBase,
SDValue Value) { … }
static bool expandAdjDynAlloc(SystemZAddressingMode &AM, bool IsBase,
SDValue Value) { … }
static bool expandIndex(SystemZAddressingMode &AM, SDValue Base,
SDValue Index) { … }
static bool expandDisp(SystemZAddressingMode &AM, bool IsBase,
SDValue Op0, uint64_t Op1) { … }
bool SystemZDAGToDAGISel::expandAddress(SystemZAddressingMode &AM,
bool IsBase) const { … }
static bool isValidDisp(SystemZAddressingMode::DispRange DR, int64_t Val) { … }
static bool shouldUseLA(SDNode *Base, int64_t Disp, SDNode *Index) { … }
bool SystemZDAGToDAGISel::selectAddress(SDValue Addr,
SystemZAddressingMode &AM) const { … }
static void insertDAGNode(SelectionDAG *DAG, SDNode *Pos, SDValue N) { … }
void SystemZDAGToDAGISel::getAddressOperands(const SystemZAddressingMode &AM,
EVT VT, SDValue &Base,
SDValue &Disp) const { … }
void SystemZDAGToDAGISel::getAddressOperands(const SystemZAddressingMode &AM,
EVT VT, SDValue &Base,
SDValue &Disp,
SDValue &Index) const { … }
bool SystemZDAGToDAGISel::selectBDAddr(SystemZAddressingMode::DispRange DR,
SDValue Addr, SDValue &Base,
SDValue &Disp) const { … }
bool SystemZDAGToDAGISel::selectMVIAddr(SystemZAddressingMode::DispRange DR,
SDValue Addr, SDValue &Base,
SDValue &Disp) const { … }
bool SystemZDAGToDAGISel::selectBDXAddr(SystemZAddressingMode::AddrForm Form,
SystemZAddressingMode::DispRange DR,
SDValue Addr, SDValue &Base,
SDValue &Disp, SDValue &Index) const { … }
bool SystemZDAGToDAGISel::selectBDVAddr12Only(SDValue Addr, SDValue Elem,
SDValue &Base,
SDValue &Disp,
SDValue &Index) const { … }
bool SystemZDAGToDAGISel::detectOrAndInsertion(SDValue &Op,
uint64_t InsertMask) const { … }
bool SystemZDAGToDAGISel::refineRxSBGMask(RxSBGOperands &RxSBG,
uint64_t Mask) const { … }
static bool maskMatters(RxSBGOperands &RxSBG, uint64_t Mask) { … }
bool SystemZDAGToDAGISel::expandRxSBG(RxSBGOperands &RxSBG) const { … }
SDValue SystemZDAGToDAGISel::getUNDEF(const SDLoc &DL, EVT VT) const { … }
SDValue SystemZDAGToDAGISel::convertTo(const SDLoc &DL, EVT VT,
SDValue N) const { … }
bool SystemZDAGToDAGISel::tryRISBGZero(SDNode *N) { … }
bool SystemZDAGToDAGISel::tryRxSBG(SDNode *N, unsigned Opcode) { … }
void SystemZDAGToDAGISel::splitLargeImmediate(unsigned Opcode, SDNode *Node,
SDValue Op0, uint64_t UpperVal,
uint64_t LowerVal) { … }
void SystemZDAGToDAGISel::loadVectorConstant(
const SystemZVectorConstantInfo &VCI, SDNode *Node) { … }
SDNode *SystemZDAGToDAGISel::loadPoolVectorConstant(APInt Val, EVT VT, SDLoc DL) { … }
bool SystemZDAGToDAGISel::tryGather(SDNode *N, unsigned Opcode) { … }
bool SystemZDAGToDAGISel::tryScatter(StoreSDNode *Store, unsigned Opcode) { … }
static bool isFusableLoadOpStorePattern(StoreSDNode *StoreNode,
SDValue StoredVal, SelectionDAG *CurDAG,
LoadSDNode *&LoadNode,
SDValue &InputChain) { … }
bool SystemZDAGToDAGISel::tryFoldLoadStoreIntoMemOperand(SDNode *Node) { … }
bool SystemZDAGToDAGISel::canUseBlockOperation(StoreSDNode *Store,
LoadSDNode *Load) const { … }
bool SystemZDAGToDAGISel::storeLoadCanUseMVC(SDNode *N) const { … }
bool SystemZDAGToDAGISel::storeLoadCanUseBlockBinary(SDNode *N,
unsigned I) const { … }
bool SystemZDAGToDAGISel::storeLoadIsAligned(SDNode *N) const { … }
ISD::LoadExtType SystemZDAGToDAGISel::getLoadExtType(SDNode *N) const { … }
void SystemZDAGToDAGISel::Select(SDNode *Node) { … }
bool SystemZDAGToDAGISel::SelectInlineAsmMemoryOperand(
const SDValue &Op, InlineAsm::ConstraintCode ConstraintID,
std::vector<SDValue> &OutOps) { … }
bool
SystemZDAGToDAGISel::IsProfitableToFold(SDValue N, SDNode *U,
SDNode *Root) const { … }
namespace {
struct IPMConversion { … };
}
static IPMConversion getIPMConversion(unsigned CCValid, unsigned CCMask) { … }
SDValue SystemZDAGToDAGISel::expandSelectBoolean(SDNode *Node) { … }
bool SystemZDAGToDAGISel::shouldSelectForReassoc(SDNode *N) const { … }
void SystemZDAGToDAGISel::PreprocessISelDAG() { … }