[all-commits] [llvm/llvm-project] 3023b1: [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH

Amir Ayupov via All-commits all-commits at lists.llvm.org
Thu Jul 18 20:57:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3023b15fb1ec00dbe6a1cb630236125f500978ef
      https://github.com/llvm/llvm-project/commit/3023b15fb1ec00dbe6a1cb630236125f500978ef
  Author: Amir Ayupov <aaupov at fb.com>
  Date:   2024-07-18 (Thu, 18 Jul 2024)

  Changed paths:
    M bolt/include/bolt/Core/BinaryContext.h
    M bolt/include/bolt/Core/MCPlusBuilder.h
    M bolt/lib/Core/BinaryContext.cpp
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Passes/IndirectCallPromotion.cpp
    M bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
    M bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp
    M bolt/lib/Target/X86/X86MCPlusBuilder.cpp
    M bolt/test/X86/Inputs/jump-table-fixed-ref-pic.s
    M bolt/test/X86/jump-table-fixed-ref-pic.test

  Log Message:
  -----------
  [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH

Detect and support fixed PIC indirect jumps of the following form:
```
movslq  En(%rip), %r1
leaq  PIC_JUMP_TABLE(%rip), %r2
addq  %r2, %r1
jmpq  *%r1
```

with PIC_JUMP_TABLE that looks like following:

```
  JT:  ----------
   E1:| L1 - JT  |
      |----------|
   E2:| L2 - JT  |
      |----------|
      |          |
         ......
   En:| Ln - JT  |
       ----------
```

The code could be produced by compilers, see
https://github.com/llvm/llvm-project/issues/91648.

Test Plan: updated jump-table-fixed-ref-pic.test

Reviewers: maksfb, ayermolo, dcci, rafaelauler

Reviewed By: rafaelauler

Pull Request: https://github.com/llvm/llvm-project/pull/91667



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list