[all-commits] [llvm/llvm-project] 19941b: [BOLT] Use MCInstPrinter in createRetpolineFunctio...

Amir Ayupov via All-commits all-commits at lists.llvm.org
Mon May 8 18:51:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 19941b0468c746a8d7ea543600fb491fe9808b04
      https://github.com/llvm/llvm-project/commit/19941b0468c746a8d7ea543600fb491fe9808b04
  Author: Amir Ayupov <aaupov at fb.com>
  Date:   2023-05-08 (Mon, 08 May 2023)

  Changed paths:
    M bolt/lib/Passes/RetpolineInsertion.cpp
    M bolt/test/CMakeLists.txt
    M bolt/test/lit.cfg.py
    M bolt/test/runtime/X86/retpoline-synthetic.test

  Log Message:
  -----------
  [BOLT] Use MCInstPrinter in createRetpolineFunctionTag

Make retpoline functions invariant of X86 register numbers.
retpoline-synthetic.test is known to fail NFC testing due to shifting
register numbers. Use canonical register names instead of tablegen
numbers.

Before:
```
__retpoline_r51_
__retpoline_mem_r58+DATAat0x200fe8
__retpoline_mem_r51+0
__retpoline_mem_r132+0+8*53
```

After:
```
__retpoline_%rax_
__retpoline_mem_%rip+DATAat0x200fe8
__retpoline_mem_%rax+0
__retpoline_mem_%r12+0+8*%rbx
```

Test Plan:
- Revert 67bd3c58c0c7389e39c5a2f4d3b1a30459ccf5b7 that touches X86RegisterInfo.td.
- retpoline-synthetic.test passes in NFC mode with this diff, fails without it.

Reviewed By: #bolt, rafauler

Differential Revision: https://reviews.llvm.org/D150138




More information about the All-commits mailing list