[llvm] [LoongArch] Insert nops and emit align reloc when handle alignment directive (PR #72962)

Jinyang He via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 18:01:57 PST 2024


================
@@ -0,0 +1,22 @@
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+relax %s \
+# RUN:     | llvm-readobj -r - | FileCheck --check-prefixes=CHECK,RELAX %s
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=-relax %s \
+# RUN:     | llvm-readobj -r - | FileCheck %s
+
+.section ".dummy", "a"
+.L1:
+  la.pcrel $t0, sym
+.p2align 3
+.L2:
----------------
MQ-mengqing wrote:

Not that. Here we need to check the ADDSUB relocation are emitted (see llvm/test/MC/RISCV/align-non-executable.s). Because in AttemptToFoldSymbolOffsetDifference(), the aligment fragments in a section which has instructions cannot be folded. Maybe it can be improved in the future.

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


More information about the llvm-commits mailing list