================
@@ -502,3 +497,27 @@ void NVPTXPassConfig::addMachineSSAOptimization() {
   addPass(&PeepholeOptimizerLegacyID);
   printAndVerify("After codegen peephole optimization pass");
 }
+
+bool NVPTXTargetMachine::isCompatibleDataLayout(
+    const DataLayout &Candidate) const {
+  // XXX: Should we enforce that the Candidate DataLayout has the same address
+  // space for allocas?
+  if (DL == Candidate)
+    return true;
+
+  auto DLStr = DL.getStringRepresentation();
+  if (!StringRef(DLStr).contains("A"))
+    DLStr = DLStr.empty() ? "A" + std::to_string(ADDRESS_SPACE_LOCAL)
+                          : DLStr + "-A" + std::to_string(ADDRESS_SPACE_LOCAL);
+  auto NewDL = DataLayout(DLStr);
+
+  return NewDL == Candidate;
----------------
thetheodor wrote:

Fixed

https://github.com/llvm/llvm-project/pull/154814
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to