summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2019-09-06 15:03:49 +0000
committerGuillaume Chatelet <gchatelet@google.com>2019-09-06 15:03:49 +0000
commitad1cea0ddafe7494e9726623bd08d1814c8cf19e (patch)
treeffcac94041cfd47c05512d793a1fcb94a0efa188 /llvm
parent4f8d005831a0b6cedd4935579dda2ac97518e4d9 (diff)
downloadbcm5719-llvm-ad1cea0ddafe7494e9726623bd08d1814c8cf19e.tar.gz
bcm5719-llvm-ad1cea0ddafe7494e9726623bd08d1814c8cf19e.zip
[Alignment][NFC] Use Align with TargetLowering::setPrefFunctionAlignment
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: nemanjai, javed.absar, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, s.egerton, pzheng, ychen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67267 llvm-svn: 371212
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/TargetLowering.h7
-rw-r--r--llvm/lib/Target/AArch64/AArch64ISelLowering.cpp3
-rw-r--r--llvm/lib/Target/BPF/BPFISelLowering.cpp4
-rw-r--r--llvm/lib/Target/Hexagon/HexagonISelLowering.cpp2
-rw-r--r--llvm/lib/Target/Lanai/LanaiISelLowering.cpp4
-rw-r--r--llvm/lib/Target/MSP430/MSP430ISelLowering.cpp2
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp4
-rw-r--r--llvm/lib/Target/RISCV/RISCVISelLowering.cpp4
-rw-r--r--llvm/lib/Target/SystemZ/SystemZISelLowering.cpp2
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp2
-rw-r--r--llvm/lib/Target/XCore/XCoreISelLowering.cpp2
11 files changed, 18 insertions, 18 deletions
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 0c675e4d291..47edbe04a59 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -2110,10 +2110,9 @@ protected:
}
/// Set the target's preferred function alignment. This should be set if
- /// there is a performance benefit to higher-than-minimum alignment (in
- /// log2(bytes))
- void setPrefFunctionLogAlignment(unsigned LogAlign) {
- PrefFunctionAlignment = llvm::Align(1ULL << LogAlign);
+ /// there is a performance benefit to higher-than-minimum alignment
+ void setPrefFunctionAlignment(llvm::Align Align) {
+ PrefFunctionAlignment = Align;
}
/// Set the target's preferred loop alignment. Default alignment is one, it
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index a78f37f4278..ef535beaa6c 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -642,8 +642,9 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
// Set required alignment.
setMinFunctionAlignment(llvm::Align(4));
// Set preferred alignments.
- setPrefFunctionLogAlignment(STI.getPrefFunctionLogAlignment());
setPrefLoopAlignment(llvm::Align(1ULL << STI.getPrefLoopLogAlignment()));
+ setPrefFunctionAlignment(
+ llvm::Align(1ULL << STI.getPrefFunctionLogAlignment()));
// Only change the limit for entries in a jump table if specified by
// the sub target, but not at the command line.
diff --git a/llvm/lib/Target/BPF/BPFISelLowering.cpp b/llvm/lib/Target/BPF/BPFISelLowering.cpp
index 70e0acfa8b5..72fe18b9ed0 100644
--- a/llvm/lib/Target/BPF/BPFISelLowering.cpp
+++ b/llvm/lib/Target/BPF/BPFISelLowering.cpp
@@ -132,9 +132,9 @@ BPFTargetLowering::BPFTargetLowering(const TargetMachine &TM,
setBooleanContents(ZeroOrOneBooleanContent);
- // Function alignments (log2)
+ // Function alignments
setMinFunctionAlignment(llvm::Align(8));
- setPrefFunctionLogAlignment(3);
+ setPrefFunctionAlignment(llvm::Align(8));
if (BPFExpandMemcpyInOrder) {
// LLVM generic code will try to expand memcpy into load/store pairs at this
diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
index cea1986f396..26a178c5378 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
@@ -1236,8 +1236,8 @@ HexagonTargetLowering::HexagonTargetLowering(const TargetMachine &TM,
auto &HRI = *Subtarget.getRegisterInfo();
setPrefLoopAlignment(llvm::Align(16));
- setPrefFunctionLogAlignment(4);
setMinFunctionAlignment(llvm::Align(4));
+ setPrefFunctionAlignment(llvm::Align(16));
setStackPointerRegisterToSaveRestore(HRI.getStackRegister());
setBooleanContents(TargetLoweringBase::UndefinedBooleanContent);
setBooleanVectorContents(TargetLoweringBase::UndefinedBooleanContent);
diff --git a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp
index 4b968531069..5cd72da0daa 100644
--- a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp
+++ b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp
@@ -144,9 +144,9 @@ LanaiTargetLowering::LanaiTargetLowering(const TargetMachine &TM,
setTargetDAGCombine(ISD::OR);
setTargetDAGCombine(ISD::XOR);
- // Function alignments (log2)
+ // Function alignments
setMinFunctionAlignment(llvm::Align(4));
- setPrefFunctionLogAlignment(2);
+ setPrefFunctionAlignment(llvm::Align(4));
setJumpIsExpensive(true);
diff --git a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
index 2d0c6197d9f..8faa3da6ec3 100644
--- a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
+++ b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
@@ -328,7 +328,7 @@ MSP430TargetLowering::MSP430TargetLowering(const TargetMachine &TM,
// TODO: __mspabi_srall, __mspabi_srlll, __mspabi_sllll
setMinFunctionAlignment(llvm::Align(2));
- setPrefFunctionLogAlignment(1);
+ setPrefFunctionAlignment(llvm::Align(2));
}
SDValue MSP430TargetLowering::LowerOperation(SDValue Op,
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 1ed32000432..c297b29d7da 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -1182,7 +1182,7 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
setMinFunctionAlignment(llvm::Align(4));
if (Subtarget.isDarwin())
- setPrefFunctionLogAlignment(4);
+ setPrefFunctionAlignment(llvm::Align(16));
switch (Subtarget.getDarwinDirective()) {
default: break;
@@ -1199,8 +1199,8 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
case PPC::DIR_PWR7:
case PPC::DIR_PWR8:
case PPC::DIR_PWR9:
- setPrefFunctionLogAlignment(4);
setPrefLoopAlignment(llvm::Align(16));
+ setPrefFunctionAlignment(llvm::Align(16));
break;
}
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index ceb931dcf46..371e19c2ee0 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -197,10 +197,10 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
setBooleanContents(ZeroOrOneBooleanContent);
- // Function alignments (log2).
+ // Function alignments.
const llvm::Align FunctionAlignment(Subtarget.hasStdExtC() ? 2 : 4);
setMinFunctionAlignment(FunctionAlignment);
- setPrefFunctionLogAlignment(Log2(FunctionAlignment));
+ setPrefFunctionAlignment(FunctionAlignment);
// Effectively disable jump table generation.
setMinimumJumpTableEntries(INT_MAX);
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index d4d0905545c..ce1582157e9 100644
--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -122,7 +122,7 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM,
// Instructions are strings of 2-byte aligned 2-byte values.
setMinFunctionAlignment(llvm::Align(2));
// For performance reasons we prefer 16-byte alignment.
- setPrefFunctionLogAlignment(4);
+ setPrefFunctionAlignment(llvm::Align(16));
// Handle operations that are handled in a similar way for all types.
for (unsigned I = MVT::FIRST_INTEGER_VALUETYPE;
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 9e249caea4b..5160a314074 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -1899,7 +1899,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
// but a conditional move could be stalled by an expensive earlier operation.
PredictableSelectIsExpensive = Subtarget.getSchedModel().isOutOfOrder();
EnableExtLdPromotion = true;
- setPrefFunctionLogAlignment(4); // 2^4 bytes.
+ setPrefFunctionAlignment(llvm::Align(16));
verifyIntrinsicTables();
}
diff --git a/llvm/lib/Target/XCore/XCoreISelLowering.cpp b/llvm/lib/Target/XCore/XCoreISelLowering.cpp
index 88cf9f7d69c..fc6fd40c82e 100644
--- a/llvm/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/llvm/lib/Target/XCore/XCoreISelLowering.cpp
@@ -172,7 +172,7 @@ XCoreTargetLowering::XCoreTargetLowering(const TargetMachine &TM,
setTargetDAGCombine(ISD::INTRINSIC_W_CHAIN);
setMinFunctionAlignment(llvm::Align(2));
- setPrefFunctionLogAlignment(2);
+ setPrefFunctionAlignment(llvm::Align(4));
}
bool XCoreTargetLowering::isZExtFree(SDValue Val, EVT VT2) const {
OpenPOWER on IntegriCloud