[llvm] [RISCV] Put Large Code Model Constant Pools in .text (PR #151393)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 30 14:02:00 PDT 2025
================
@@ -0,0 +1,102 @@
+; RUN: llc -mtriple=riscv64 -mattr=+f,+zfh -target-abi=lp64f -code-model=large -verify-machineinstrs < %s \
+; RUN: -filetype=obj -o - | llvm-objdump -htr - \
+; RUN: | FileCheck %s -check-prefix=RV64I
+; RUN: llc -mtriple=riscv64 -mattr=+zfinx,+zhinx -target-abi=lp64 -code-model=large -verify-machineinstrs < %s \
+; RUN: -filetype=obj -o - | llvm-objdump -htr - \
+; RUN: | FileCheck %s -check-prefix=RV64I
+
+
+;; This tests that we are lowering large code model constants into `.text`
+;; constant pools, so that accessing them is close to `.text`, rather than
+;; far away in `.data`. The other choices are `.rodata` and `.data.rel.ro`,
+;; both of which may not be close enough to `.text` to be referenced.
+
+; RV64I-LABEL: Sections:
+; RV64I: .text 000000b4
----------------
topperc wrote:
Are the section sizes the only thing showing where the constant pools are?
https://github.com/llvm/llvm-project/pull/151393
More information about the llvm-commits
mailing list