[llvm] r197310 - Turn AMDGPUSubtarget::getDataLayout into a static function.
Rafael Espindola
rafael.espindola at gmail.com
Fri Dec 13 22:13:44 PST 2013
Author: rafael
Date: Sat Dec 14 00:13:44 2013
New Revision: 197310
URL: http://llvm.org/viewvc/llvm-project?rev=197310&view=rev
Log:
Turn AMDGPUSubtarget::getDataLayout into a static function.
No functionality change.
Modified:
llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp
llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h
llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp
Modified: llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp?rev=197310&r1=197309&r2=197310&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp Sat Dec 14 00:13:44 2013
@@ -88,33 +88,6 @@ AMDGPUSubtarget::getDefaultSize(uint32_t
}
std::string
-AMDGPUSubtarget::getDataLayout() const {
- std::string DataLayout = std::string(
- "e"
- "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
- "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128"
- "-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-v2048:2048:2048"
- "-n32:64"
- );
-
- if (hasHWFP64()) {
- DataLayout.append("-f64:64:64");
- }
-
- if (is64bit()) {
- DataLayout.append("-p:64:64:64");
- } else {
- DataLayout.append("-p:32:32:32");
- }
-
- if (Gen >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
- DataLayout.append("-p3:32:32:32");
- }
-
- return DataLayout;
-}
-
-std::string
AMDGPUSubtarget::getDeviceName() const {
return DevName;
}
Modified: llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h?rev=197310&r1=197309&r2=197310&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h Sat Dec 14 00:13:44 2013
@@ -75,7 +75,6 @@ public:
// Helper functions to simplify if statements
bool isTargetELF() const;
- std::string getDataLayout() const;
std::string getDeviceName() const;
virtual size_t getDefaultSize(uint32_t dim) const;
bool dumpCode() const { return DumpCode; }
Modified: llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp?rev=197310&r1=197309&r2=197310&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp Sat Dec 14 00:13:44 2013
@@ -49,6 +49,29 @@ static MachineSchedRegistry
SchedCustomRegistry("r600", "Run R600's custom scheduler",
createR600MachineScheduler);
+static std::string computeDataLayout(const AMDGPUSubtarget &ST) {
+ std::string DataLayout = std::string(
+ "e"
+ "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
+ "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128"
+ "-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-v2048:2048:2048"
+ "-n32:64"
+ );
+
+ if (ST.hasHWFP64())
+ DataLayout.append("-f64:64:64");
+
+ if (ST.is64bit())
+ DataLayout.append("-p:64:64:64");
+ else
+ DataLayout.append("-p:32:32:32");
+
+ if (ST.getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS)
+ DataLayout.append("-p3:32:32:32");
+
+ return DataLayout;
+}
+
AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, StringRef TT,
StringRef CPU, StringRef FS,
TargetOptions Options,
@@ -58,7 +81,7 @@ AMDGPUTargetMachine::AMDGPUTargetMachine
:
LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OptLevel),
Subtarget(TT, CPU, FS),
- Layout(Subtarget.getDataLayout()),
+ Layout(computeDataLayout(Subtarget)),
FrameLowering(TargetFrameLowering::StackGrowsUp,
64 * 16 // Maximum stack alignment (long16)
, 0),
More information about the llvm-commits
mailing list