[all-commits] [llvm/llvm-project] 7800ad: [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (#91667)

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


  Branch: refs/heads/users/aaupov/spr/main.bolt-support-possible_pic_fixed_branch
  Home:   https://github.com/llvm/llvm-project
  Commit: 7800ad4550051ce44d3485edf5b8084ff2eeb774
      https://github.com/llvm/llvm-project/commit/7800ad4550051ce44d3485edf5b8084ff2eeb774
  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 (#91667)

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



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