[llvm] d88d8c5 - [PowerPC] Disable relative lookup table converter pass for AIX
Jinsong Ji via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 19 12:28:17 PDT 2021
Author: Jinsong Ji
Date: 2021-04-19T19:28:11Z
New Revision: d88d8c5b8607bff56d0ccd6a500157487c5819e7
URL: https://github.com/llvm/llvm-project/commit/d88d8c5b8607bff56d0ccd6a500157487c5819e7
DIFF: https://github.com/llvm/llvm-project/commit/d88d8c5b8607bff56d0ccd6a500157487c5819e7.diff
LOG: [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
Added:
Modified:
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index d28e36da17cf..adf1fb83ead0 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -380,7 +380,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
}
- bool shouldBuildRelLookupTables() {
+ bool shouldBuildRelLookupTables() const {
const TargetMachine &TM = getTLI()->getTargetMachine();
// If non-PIC mode, do not generate a relative lookup table.
if (!TM.isPositionIndependent())
diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
index 70552e97836a..0b43452b6454 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
@@ -1260,6 +1260,14 @@ bool PPCTTIImpl::isNumRegsMajorCostOfLSR() {
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,
MemIntrinsicInfo &Info) {
switch (Inst->getIntrinsicID()) {
diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
index 300debe6ec35..1794ab880d12 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
+++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
@@ -76,7 +76,7 @@ class PPCTTIImpl : public BasicTTIImplBase<PPCTTIImpl> {
bool isLSRCostLess(TargetTransformInfo::LSRCost &C1,
TargetTransformInfo::LSRCost &C2);
bool isNumRegsMajorCostOfLSR();
-
+ bool shouldBuildRelLookupTables() const;
/// @}
/// \name Vector TTI Implementations
More information about the llvm-commits
mailing list