aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/AutoUpgrade.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/AutoUpgrade.cpp')
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 2c480fb..634b2dd 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -5341,10 +5341,11 @@ MDNode *llvm::upgradeInstructionLoopAttachment(MDNode &N) {
std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
Triple T(TT);
- // The only data layout upgrades needed for pre-GCN are setting the address
- // space of globals to 1.
- if (T.isAMDGPU() && !T.isAMDGCN() && !DL.contains("-G") &&
- !DL.starts_with("G")) {
+ // The only data layout upgrades needed for pre-GCN, SPIR or SPIRV are setting
+ // the address space of globals to 1. This does not apply to SPIRV Logical.
+ if (((T.isAMDGPU() && !T.isAMDGCN()) ||
+ (T.isSPIR() || (T.isSPIRV() && !T.isSPIRVLogical()))) &&
+ !DL.contains("-G") && !DL.starts_with("G")) {
return DL.empty() ? std::string("G1") : (DL + "-G1").str();
}