Changeset View
Changeset View
Standalone View
Standalone View
lib/Target/NVPTX/NVPTXISelLowering.h
Show First 20 Lines • Show All 453 Lines • ▼ Show 20 Lines | public: | ||||
/// isLegalAddressingMode - Return true if the addressing mode represented | /// isLegalAddressingMode - Return true if the addressing mode represented | ||||
/// by AM is legal for this target, for a load/store of the specified type | /// by AM is legal for this target, for a load/store of the specified type | ||||
/// Used to guide target specific optimizations, like loop strength | /// Used to guide target specific optimizations, like loop strength | ||||
/// reduction (LoopStrengthReduce.cpp) and memory optimization for | /// reduction (LoopStrengthReduce.cpp) and memory optimization for | ||||
/// address mode (CodeGenPrepare.cpp) | /// address mode (CodeGenPrepare.cpp) | ||||
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, | bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, | ||||
unsigned AS) const override; | unsigned AS) const override; | ||||
bool isTruncateFree(Type *SrcTy, Type *DstTy) const override { | |||||
// Truncating 64-bit to 32-bit is free in SASS. | |||||
if (!SrcTy->isIntegerTy() || !DstTy->isIntegerTy()) | |||||
eliben: I'd just && the four conditions in the 'return' statement here, would make it clearer IMHO. But… | |||||
Not Done ReplyInline ActionsI'll keep what it is. It looks clearer to me: the first check as an early return against non-integer cases, and the remaining focuses at bitwidths. It could be that we later want to consider more types of trunc free and OR the bitwdith checks together. jingyue: I'll keep what it is. It looks clearer to me: the first check as an early return against non… | |||||
return false; | |||||
return SrcTy->getPrimitiveSizeInBits() == 64 && | |||||
DstTy->getPrimitiveSizeInBits() == 32; | |||||
} | |||||
/// getFunctionAlignment - Return the Log2 alignment of this function. | /// getFunctionAlignment - Return the Log2 alignment of this function. | ||||
unsigned getFunctionAlignment(const Function *F) const; | unsigned getFunctionAlignment(const Function *F) const; | ||||
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Ctx, | EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Ctx, | ||||
EVT VT) const override { | EVT VT) const override { | ||||
if (VT.isVector()) | if (VT.isVector()) | ||||
return EVT::getVectorVT(Ctx, MVT::i1, VT.getVectorNumElements()); | return EVT::getVectorVT(Ctx, MVT::i1, VT.getVectorNumElements()); | ||||
return MVT::i1; | return MVT::i1; | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |
I'd just && the four conditions in the 'return' statement here, would make it clearer IMHO. But it's just style so up to you