[llvm] [RISCV] Use the value type rather than the pointer type of a global when determining if an allocation granule makes sense. (PR #217924)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 11:19:32 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Owen Anderson (resistor)

<details>
<summary>Changes</summary>

Further attempt to fix RISCV stage2 failure introduced by f6ea145aa8e89631ae04f72df32580b20256d40c.


---
Full diff: https://github.com/llvm/llvm-project/pull/217924.diff


1 Files Affected:

- (modified) llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp b/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
index 3896e8eb7efa0..6771e9d7e7fa1 100644
--- a/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
+++ b/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
@@ -1330,7 +1330,7 @@ void RISCVAsmPrinter::emitMachineConstantPoolValue(
 MaybeAlign
 RISCVAsmPrinter::getRequiredGlobalAlignmentGranule(const GlobalVariable &GV) {
   const MCSubtargetInfo &MCSTI = TM.getMCSubtargetInfo();
-  if (!GV.getType()->isSized())
+  if (!GV.getValueType()->isSized())
     return std::nullopt;
 
   uint64_t Size = GV.getGlobalSize(getDataLayout());

``````````

</details>


https://github.com/llvm/llvm-project/pull/217924


More information about the llvm-commits mailing list