<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/RISCV/RISCVTargetObjectFile.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>RISCV: Replace RISCVMCExpr with MCSpecifierExpr</title>
<updated>2025-06-15T23:51:09+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-06-15T23:51:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f11dd116e0aa8cf35bdb82dba0a3a926538c05c2'/>
<id>f11dd116e0aa8cf35bdb82dba0a3a926538c05c2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>RISCV: Replace most Specifier constants with relocation types</title>
<updated>2025-05-17T17:14:33+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-05-17T17:14:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2f05451198e2f222ec66cec4892ada0509519290'/>
<id>2f05451198e2f222ec66cec4892ada0509519290</id>
<content type='text'>
... as they map directly and we don't utilize -Wswitch.
Retained VK_*_LO constants for lowering to LO_I or LO_S.

The Sparc port has eliminated all Specifier constants (commit
003fa7731d81a47c98e9c55f80d509933c9b91f6), and the LoongArch port is
nearly free of them (#138632).

Pull Request: https://github.com/llvm/llvm-project/pull/138644
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... as they map directly and we don't utilize -Wswitch.
Retained VK_*_LO constants for lowering to LO_I or LO_S.

The Sparc port has eliminated all Specifier constants (commit
003fa7731d81a47c98e9c55f80d509933c9b91f6), and the LoongArch port is
nearly free of them (#138632).

Pull Request: https://github.com/llvm/llvm-project/pull/138644
</pre>
</div>
</content>
</entry>
<entry>
<title>[RISCV] Replace @plt/@gotpcrel in data directives with %pltpcrel %gotpcrel</title>
<updated>2025-03-29T18:08:13+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-03-29T18:08:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fe6fb910df9d1b9a9e2e7a6e8228d020668e0129'/>
<id>fe6fb910df9d1b9a9e2e7a6e8228d020668e0129</id>
<content type='text'>
clang -fexperimental-relative-c++-abi-vtables might generate `@plt` and
`@gotpcrel` specifiers in data directives. The syntax is not used in
humand-written assembly code, and is not supported by GNU assembler.
Note: the `@plt` in `.word foo@plt` is different from
the legacy `call func@plt` (where `@plt` is simply ignored).

The `@plt` syntax was selected was simply due to a quirk of AsmParser:
the syntax was supported by all targets until I updated it
to be an opt-in feature in a0671758eb6e52a758bd1b096a9b421eec60204c

RISC-V favors the `%specifier(expr)` syntax following MIPS and Sparc,
and we should follow this convention.

This PR adds support for `.word %pltpcrel(foo+offset)` and
`.word %gotpcrel(foo)`, and drops `@plt` and `@gotpcrel`.

* MCValue::SymA can no longer have a SymbolVariant. Add an assert
  similar to that of AArch64ELFObjectWriter.cpp before
  https://reviews.llvm.org/D81446 (see my analysis at
  https://maskray.me/blog/2025-03-16-relocation-generation-in-assemblers
  if intrigued)
* `jump foo@plt, x31` now has a different diagnostic.

Pull Request: https://github.com/llvm/llvm-project/pull/132569
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clang -fexperimental-relative-c++-abi-vtables might generate `@plt` and
`@gotpcrel` specifiers in data directives. The syntax is not used in
humand-written assembly code, and is not supported by GNU assembler.
Note: the `@plt` in `.word foo@plt` is different from
the legacy `call func@plt` (where `@plt` is simply ignored).

The `@plt` syntax was selected was simply due to a quirk of AsmParser:
the syntax was supported by all targets until I updated it
to be an opt-in feature in a0671758eb6e52a758bd1b096a9b421eec60204c

RISC-V favors the `%specifier(expr)` syntax following MIPS and Sparc,
and we should follow this convention.

This PR adds support for `.word %pltpcrel(foo+offset)` and
`.word %gotpcrel(foo)`, and drops `@plt` and `@gotpcrel`.

* MCValue::SymA can no longer have a SymbolVariant. Add an assert
  similar to that of AArch64ELFObjectWriter.cpp before
  https://reviews.llvm.org/D81446 (see my analysis at
  https://maskray.me/blog/2025-03-16-relocation-generation-in-assemblers
  if intrigued)
* `jump foo@plt, x31` now has a different diagnostic.

Pull Request: https://github.com/llvm/llvm-project/pull/132569
</pre>
</div>
</content>
</entry>
<entry>
<title>[RISCV] Move VK_GOTPCREL and VK_PLT to RISCVMCExpr::Specifier</title>
<updated>2025-03-22T16:24:11+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-03-22T16:24:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ccc18ca1479dee73b0fdafa75d9403c50c17ee28'/>
<id>ccc18ca1479dee73b0fdafa75d9403c50c17ee28</id>
<content type='text'>
to migrate away from the deprecated MCSymbolRefExpr::VariantKind. In the
future, @GOTPCREL and @PLT in data directives should be encoded as part
of RISCVMCExpr instead of MCSymbolRefExpr.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to migrate away from the deprecated MCSymbolRefExpr::VariantKind. In the
future, @GOTPCREL and @PLT in data directives should be encoded as part
of RISCVMCExpr instead of MCSymbolRefExpr.
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Rename PLTRelativeVariantKind. NFC</title>
<updated>2025-03-22T06:02:08+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-03-22T06:02:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4b417992dd95060f5815fdfacb08f1c898f85b41'/>
<id>4b417992dd95060f5815fdfacb08f1c898f85b41</id>
<content type='text'>
Migrate away from the deprecated MCSymbolRefExpr::VariantKind.
The name "Specifier" is utilized in a few *MCExpr.

&gt; "Relocation specifier" is clear, aligns with Arm and IBM AIX's documentation, and fits the assembler's role seamlessly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Migrate away from the deprecated MCSymbolRefExpr::VariantKind.
The name "Specifier" is utilized in a few *MCExpr.

&gt; "Relocation specifier" is clear, aligns with Arm and IBM AIX's documentation, and fits the assembler's role seamlessly.
</pre>
</div>
</content>
</entry>
<entry>
<title>[RISCV] Support the large code model. (#70308)</title>
<updated>2024-09-09T01:15:07+00:00</updated>
<author>
<name>Jim Lin</name>
<email>jim@andestech.com</email>
</author>
<published>2024-09-09T01:15:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fef84c56dcd93fc63aa61a1313f0f5465e104291'/>
<id>fef84c56dcd93fc63aa61a1313f0f5465e104291</id>
<content type='text'>
Implement large code model for GlobalAddressSDNode and ExternalSymbolSDNode.

See discussion on
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/388.

---------

Co-authored-by: Kuan-Lin Chen &lt;rufus@andestech.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement large code model for GlobalAddressSDNode and ExternalSymbolSDNode.

See discussion on
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/388.

---------

Co-authored-by: Kuan-Lin Chen &lt;rufus@andestech.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[RISCV] Let -data-sections also work on sbss/sdata sections (#87040)</title>
<updated>2024-08-23T13:06:12+00:00</updated>
<author>
<name>KaiWeng</name>
<email>kaiweng@andestech.com</email>
</author>
<published>2024-08-23T13:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d348f72d3ac4289821f944a99cdb4b6af21aa7b'/>
<id>4d348f72d3ac4289821f944a99cdb4b6af21aa7b</id>
<content type='text'>
Add an unique suffix to .sbss/.sdata if -fdata-sections.
Without assigning an unique .sbss/.sdata section to each symbols, a
linker may not be able to remove unused part when gc-section since all
used and unused symbols are all mixed in the same .sbss/.sdata section.
I believe this also matches the behavior of gcc.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add an unique suffix to .sbss/.sdata if -fdata-sections.
Without assigning an unique .sbss/.sdata section to each symbols, a
linker may not be able to remove unused part when gc-section since all
used and unused symbols are all mixed in the same .sbss/.sdata section.
I believe this also matches the behavior of gcc.</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Don't include Module.h in Analysis.h (NFC) (#97023)</title>
<updated>2024-06-28T12:30:47+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2024-06-28T12:30:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4169338e75cdce73d34063532db598c95ee82ae4'/>
<id>4169338e75cdce73d34063532db598c95ee82ae4</id>
<content type='text'>
Replace it with a forward declaration instead. Analysis.h is pulled in
by all passes, but not all passes need to access the module.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace it with a forward declaration instead. Analysis.h is pulled in
by all passes, but not all passes need to access the module.</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Add getDataLayout() helpers to Function and GlobalValue (#96919)</title>
<updated>2024-06-28T06:36:49+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2024-06-28T06:36:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9df71d7673b5c98e1032d01be83724a45b42fafc'/>
<id>9df71d7673b5c98e1032d01be83724a45b42fafc</id>
<content type='text'>
Similar to https://github.com/llvm/llvm-project/pull/96902, this adds
`getDataLayout()` helpers to Function and GlobalValue, replacing the
current `getParent()-&gt;getDataLayout()` pattern.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similar to https://github.com/llvm/llvm-project/pull/96902, this adds
`getDataLayout()` helpers to Function and GlobalValue, replacing the
current `getParent()-&gt;getDataLayout()` pattern.</pre>
</div>
</content>
</entry>
<entry>
<title>[RISCV] Place mergeable small read only data into srodata section (#82214)</title>
<updated>2024-03-11T05:57:06+00:00</updated>
<author>
<name>Kito Cheng</name>
<email>kito.cheng@sifive.com</email>
</author>
<published>2024-03-11T05:57:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b7f97d3661814c4ae11b8772f8a27c029d01648b'/>
<id>b7f97d3661814c4ae11b8772f8a27c029d01648b</id>
<content type='text'>
Small mergeable read only data was place on the sdata before, but it
also means it lose the mergeable property, which means lose some code
size optimization opportunity during link time.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Small mergeable read only data was place on the sdata before, but it
also means it lose the mergeable property, which means lose some code
size optimization opportunity during link time.</pre>
</div>
</content>
</entry>
</feed>
