[PowerPC] Disable relative lookup table converter pass for AIX

XCOFF hasn't implemented lowerRelativeReference.
So we need to disable new pass introduced by https://reviews.llvm.org/D94355 for
AIX for now.

Reviewed By: gulfem

Differential Revision: https://reviews.llvm.org/D100584
This commit is contained in:
Jinsong Ji 2021-04-19 18:57:18 +00:00
parent a7712091ea
commit d88d8c5b86
3 changed files with 10 additions and 2 deletions

View File

@ -380,7 +380,7 @@ public:
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other); TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
} }
bool shouldBuildRelLookupTables() { bool shouldBuildRelLookupTables() const {
const TargetMachine &TM = getTLI()->getTargetMachine(); const TargetMachine &TM = getTLI()->getTargetMachine();
// If non-PIC mode, do not generate a relative lookup table. // If non-PIC mode, do not generate a relative lookup table.
if (!TM.isPositionIndependent()) if (!TM.isPositionIndependent())

View File

@ -1260,6 +1260,14 @@ bool PPCTTIImpl::isNumRegsMajorCostOfLSR() {
return false; return false;
} }
bool PPCTTIImpl::shouldBuildRelLookupTables() const {
const PPCTargetMachine &TM = ST->getTargetMachine();
// XCOFF hasn't implemented lowerRelativeReference, disable non-ELF for now.
if (!TM.isELFv2ABI())
return false;
return BaseT::shouldBuildRelLookupTables();
}
bool PPCTTIImpl::getTgtMemIntrinsic(IntrinsicInst *Inst, bool PPCTTIImpl::getTgtMemIntrinsic(IntrinsicInst *Inst,
MemIntrinsicInfo &Info) { MemIntrinsicInfo &Info) {
switch (Inst->getIntrinsicID()) { switch (Inst->getIntrinsicID()) {

View File

@ -76,7 +76,7 @@ public:
bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, bool isLSRCostLess(TargetTransformInfo::LSRCost &C1,
TargetTransformInfo::LSRCost &C2); TargetTransformInfo::LSRCost &C2);
bool isNumRegsMajorCostOfLSR(); bool isNumRegsMajorCostOfLSR();
bool shouldBuildRelLookupTables() const;
/// @} /// @}
/// \name Vector TTI Implementations /// \name Vector TTI Implementations