[llvm] 0602c20 - [AMDGPU] Make use of divideCeil. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 26 09:11:52 PDT 2020
Author: Jay Foad
Date: 2020-03-26T16:11:35Z
New Revision: 0602c20b1bbd129911bd5bb4d6a5de9ba5b3b161
URL: https://github.com/llvm/llvm-project/commit/0602c20b1bbd129911bd5bb4d6a5de9ba5b3b161
DIFF: https://github.com/llvm/llvm-project/commit/0602c20b1bbd129911bd5bb4d6a5de9ba5b3b161.diff
LOG: [AMDGPU] Make use of divideCeil. NFC.
Added:
Modified:
llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.h
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp b/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp
index 660893af92a0..8124df68f688 100644
--- a/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp
+++ b/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp
@@ -159,8 +159,7 @@ unsigned CFStack::getSubEntrySize(CFStack::StackItem Item) {
}
void CFStack::updateMaxStackSize() {
- unsigned CurrentStackSize =
- CurrentEntries + (alignTo(CurrentSubEntries, 4) / 4);
+ unsigned CurrentStackSize = CurrentEntries + divideCeil(CurrentSubEntries, 4);
MaxStackSize = std::max(CurrentStackSize, MaxStackSize);
}
diff --git a/llvm/lib/Target/AMDGPU/SIRegisterInfo.h b/llvm/lib/Target/AMDGPU/SIRegisterInfo.h
index a13f6dc4c0e7..eff0b382fef2 100644
--- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.h
@@ -274,7 +274,7 @@ class SIRegisterInfo final : public AMDGPUGenRegisterInfo {
// \returns a DWORD offset of a \p SubReg
unsigned getChannelFromSubReg(unsigned SubReg) const {
- return SubReg ? alignTo(getSubRegIdxOffset(SubReg), 32) / 32 : 0;
+ return SubReg ? divideCeil(getSubRegIdxOffset(SubReg), 32) : 0;
}
// \returns a DWORD size of a \p SubReg
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 1f0cbfb6adbe..1ae25adf1334 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -301,8 +301,7 @@ unsigned getMaxWavesPerEU(const MCSubtargetInfo *STI) {
unsigned getMaxWavesPerEU(const MCSubtargetInfo *STI,
unsigned FlatWorkGroupSize) {
- return alignTo(getMaxWavesPerCU(STI, FlatWorkGroupSize),
- getEUsPerCU(STI)) / getEUsPerCU(STI);
+ return divideCeil(getMaxWavesPerCU(STI, FlatWorkGroupSize), getEUsPerCU(STI));
}
unsigned getMinFlatWorkGroupSize(const MCSubtargetInfo *STI) {
@@ -316,8 +315,7 @@ unsigned getMaxFlatWorkGroupSize(const MCSubtargetInfo *STI) {
unsigned getWavesPerWorkGroup(const MCSubtargetInfo *STI,
unsigned FlatWorkGroupSize) {
- return alignTo(FlatWorkGroupSize, getWavefrontSize(STI)) /
- getWavefrontSize(STI);
+ return divideCeil(FlatWorkGroupSize, getWavefrontSize(STI));
}
unsigned getSGPRAllocGranule(const MCSubtargetInfo *STI) {
More information about the llvm-commits
mailing list