[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-04 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor edited 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

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-04 Thread Theodoros Theodoridis via cfe-commits
@@ -1444,15 +1444,16 @@ void clang::emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's // DataLayout. - if (AsmHelper.TM) { -std::string DLDesc = M->getDataLayout().getStringReprese

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
thetheodor wrote: Strange. I had to rebase my local branch on top of main to trigger the same failure. Does this mean that the test bots rebase before building and testing? https://github.com/llvm/llvm-project/pull/154814 ___ cfe-commits mailing list

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
thetheodor wrote: > If you didn't dig it out of the logs already, you can see the test output > here: https://github.com/llvm/llvm-project/actions/runs/17434074847?pr=154814 > > (no idea why it's failing, just a drive by tip) Thanks. It's failing because `llc` on the test bot emits different P

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
@@ -2253,22 +2253,31 @@ def trapexitinst : NVPTXInst<(outs), (ins), "trap; exit;", [(trap)]>, Requires<[ // brkpt instruction def debugtrapinst : BasicNVPTXInst<(outs), (ins), "brkpt", [(debugtrap)]>; -def SDTDynAllocaOp : - SDTypeProfile<1, 2, [SDTCisSameAs<0, 1>, SDTCisInt

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
thetheodor wrote: ``` TEST 'LLVM :: CodeGen/NVPTX/local-stack-frame.ll' FAILED ``` is failing but I can't reproduce this locally, I'm trying to figure out how my config is different than the test bot's. https://github.com/llvm/llvm-project/pull/154814

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
@@ -2253,22 +2253,31 @@ def trapexitinst : NVPTXInst<(outs), (ins), "trap; exit;", [(trap)]>, Requires<[ // brkpt instruction def debugtrapinst : BasicNVPTXInst<(outs), (ins), "brkpt", [(debugtrap)]>; -def SDTDynAllocaOp : - SDTypeProfile<1, 2, [SDTCisSameAs<0, 1>, SDTCisInt

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor edited 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

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
@@ -1444,15 +1444,16 @@ void clang::emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's // DataLayout. - if (AsmHelper.TM) { -std::string DLDesc = M->getDataLayout().getStringReprese

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
@@ -1444,15 +1444,16 @@ void clang::emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's // DataLayout. - if (AsmHelper.TM) { -std::string DLDesc = M->getDataLayout().getStringReprese

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor edited 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

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-03 Thread Theodoros Theodoridis via cfe-commits
@@ -502,3 +497,27 @@ void NVPTXPassConfig::addMachineSSAOptimization() { addPass(&PeepholeOptimizerLegacyID); printAndVerify("After codegen peephole optimization pass"); } + +bool NVPTXTargetMachine::isCompatibleDataLayout( +const DataLayout &Candidate) const { + // XX

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-02 Thread Theodoros Theodoridis via cfe-commits
@@ -502,3 +497,27 @@ void NVPTXPassConfig::addMachineSSAOptimization() { addPass(&PeepholeOptimizerLegacyID); printAndVerify("After codegen peephole optimization pass"); } + +bool NVPTXTargetMachine::isCompatibleDataLayout( +const DataLayout &Candidate) const { + // XX

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-02 Thread Theodoros Theodoridis via cfe-commits
@@ -1444,15 +1444,16 @@ void clang::emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's // DataLayout. - if (AsmHelper.TM) { -std::string DLDesc = M->getDataLayout().getStringReprese

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-02 Thread Theodoros Theodoridis via cfe-commits
@@ -1444,15 +1444,16 @@ void clang::emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's // DataLayout. - if (AsmHelper.TM) { -std::string DLDesc = M->getDataLayout().getStringReprese

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-02 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor deleted 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

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-02 Thread Theodoros Theodoridis via cfe-commits
@@ -1444,15 +1444,16 @@ void clang::emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's // DataLayout. - if (AsmHelper.TM) { -std::string DLDesc = M->getDataLayout().getStringReprese

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-09-01 Thread Theodoros Theodoridis via cfe-commits
@@ -1444,15 +1444,16 @@ void clang::emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's // DataLayout. - if (AsmHelper.TM) { -std::string DLDesc = M->getDataLayout().getStringReprese

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-28 Thread Theodoros Theodoridis via cfe-commits
@@ -1484,7 +1484,8 @@ void NVPTXAsmPrinter::setAndEmitFunctionVirtualRegisters( if (NumBytes) { O << "\t.local .align " << MFI.getMaxAlign().value() << " .b8 \t" << DEPOTNAME << getFunctionNumber() << "[" << NumBytes << "];\n"; -if (static_cast(MF.getTarget()).i

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-28 Thread Theodoros Theodoridis via cfe-commits
@@ -139,21 +134,20 @@ define void @foo4() { ; PTX32-EMPTY: ; PTX32-NEXT: // %bb.0: ; PTX32-NEXT:mov.b32 %SPL, __local_depot3; -; PTX32-NEXT:cvta.local.u32 %SP, %SPL; -; PTX32-NEXT:add.u32 %r1, %SP, 0; -; PTX32-NEXT:add.u32 %r2, %SPL, 0; -; PTX32-NEXT:add.u3

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-27 Thread Theodoros Theodoridis via cfe-commits
@@ -1803,10 +1803,7 @@ SDValue NVPTXTargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op, {Chain, DAG.getZExtOrTrunc(Size, DL, LocalVT), DAG.getTargetConstant(Align, DL, MVT::i32)}); - SDValue ASC = DAG.getAddrSpaceCast( - DL, Op.getVa

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-27 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor updated https://github.com/llvm/llvm-project/pull/154814 >From 095073e292e212b938ae3e72c403faab09940a9c Mon Sep 17 00:00:00 2001 From: Theodoros Theodoridis Date: Tue, 12 Aug 2025 15:22:24 + Subject: [PATCH 01/10] [NVPTX] Change the alloca address space in NVP

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-26 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor edited 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

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor updated https://github.com/llvm/llvm-project/pull/154814 >From 095073e292e212b938ae3e72c403faab09940a9c Mon Sep 17 00:00:00 2001 From: Theodoros Theodoridis Date: Tue, 12 Aug 2025 15:22:24 + Subject: [PATCH 1/9] [NVPTX] Change the alloca address space in NVPTX

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
@@ -22,7 +22,7 @@ ; CHECK: DEBUG_VALUE: foo:i <- 3 ; CHECK: DEBUG_VALUE: foo:i <- 7 ; CHECK: DEBUG_VALUE: foo:i <- % -; CHECK: DEBUG_VALUE: foo:i <- [DW_OP_deref] $vrdepot +; CHECK: DEBUG_VALUE: foo:i <- [DW_OP_deref] % thetheodor wrote: Ah, here's the problem

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor deleted 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

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
@@ -22,7 +22,7 @@ ; CHECK: DEBUG_VALUE: foo:i <- 3 ; CHECK: DEBUG_VALUE: foo:i <- 7 ; CHECK: DEBUG_VALUE: foo:i <- % -; CHECK: DEBUG_VALUE: foo:i <- [DW_OP_deref] $vrdepot +; CHECK: DEBUG_VALUE: foo:i <- [DW_OP_deref] % thetheodor wrote: hmmm, in main it looks

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor edited 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

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
@@ -22,7 +22,7 @@ ; CHECK: DEBUG_VALUE: foo:i <- 3 ; CHECK: DEBUG_VALUE: foo:i <- 7 ; CHECK: DEBUG_VALUE: foo:i <- % -; CHECK: DEBUG_VALUE: foo:i <- [DW_OP_deref] $vrdepot +; CHECK: DEBUG_VALUE: foo:i <- [DW_OP_deref] % thetheodor wrote: I'm not an expert eith

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor edited 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

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
@@ -216,24 +214,23 @@ define dso_local ptx_kernel void @escape_ptr_store(ptr nocapture noundef writeon ; ; PTX-LABEL: escape_ptr_store( ; PTX: { -; PTX-NEXT:.local .align 4 .b8 __local_depot4[8]; +; PTX-NEXT:.local .align 8 .b8 __local_depot4[8];

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-25 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor updated https://github.com/llvm/llvm-project/pull/154814 >From 095073e292e212b938ae3e72c403faab09940a9c Mon Sep 17 00:00:00 2001 From: Theodoros Theodoridis Date: Tue, 12 Aug 2025 15:22:24 + Subject: [PATCH 1/8] [NVPTX] Change the alloca address space in NVPTX

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-22 Thread Theodoros Theodoridis via cfe-commits
@@ -216,24 +214,23 @@ define dso_local ptx_kernel void @escape_ptr_store(ptr nocapture noundef writeon ; ; PTX-LABEL: escape_ptr_store( ; PTX: { -; PTX-NEXT:.local .align 4 .b8 __local_depot4[8]; +; PTX-NEXT:.local .align 8 .b8 __local_depot4[8];

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-22 Thread Theodoros Theodoridis via cfe-commits
@@ -139,21 +134,20 @@ define void @foo4() { ; PTX32-EMPTY: ; PTX32-NEXT: // %bb.0: ; PTX32-NEXT:mov.b32 %SPL, __local_depot3; -; PTX32-NEXT:cvta.local.u32 %SP, %SPL; -; PTX32-NEXT:add.u32 %r1, %SP, 0; -; PTX32-NEXT:add.u32 %r2, %SPL, 0; -; PTX32-NEXT:add.u3

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-22 Thread Theodoros Theodoridis via cfe-commits
@@ -1444,15 +1444,16 @@ void clang::emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's // DataLayout. - if (AsmHelper.TM) { -std::string DLDesc = M->getDataLayout().getStringReprese

[clang] [llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

2025-08-22 Thread Theodoros Theodoridis via cfe-commits
https://github.com/thetheodor updated https://github.com/llvm/llvm-project/pull/154814 >From 095073e292e212b938ae3e72c403faab09940a9c Mon Sep 17 00:00:00 2001 From: Theodoros Theodoridis Date: Tue, 12 Aug 2025 15:22:24 + Subject: [PATCH 1/7] [NVPTX] Change the alloca address space in NVPTX