[all-commits] [llvm/llvm-project] 778a48: [InlineAsm] Steal a bit to denote a register is fo...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Fri Nov 3 09:37:20 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 778a48468b5fce8deafb40be0704cb69b052a50a
      https://github.com/llvm/llvm-project/commit/778a48468b5fce8deafb40be0704cb69b052a50a
  Author: Nick Desaulniers <nickdesaulniers at users.noreply.github.com>
  Date:   2023-11-03 (Fri, 03 Nov 2023)

  Changed paths:
    M llvm/include/llvm/CodeGen/MachineInstr.h
    M llvm/include/llvm/IR/InlineAsm.h
    M llvm/lib/CodeGen/MachineInstr.cpp
    M llvm/lib/CodeGen/TargetInstrInfo.cpp

  Log Message:
  -----------
  [InlineAsm] Steal a bit to denote a register is foldable (#70738)


When using the inline asm constraint string "rm" (or "g"), we generally
would like the compiler to choose "r", but it is permitted to choose "m"
if there's register pressure. This is distinct from "r" in which the
register is not permitted to be spilled to the stack.

The decision of which to use must be made at some point.  Currently, the
instruction selection frameworks (ISELs) make the choice, and the
register allocators had better be able to handle the result.

Steal a bit from Storage when using register operands to disambiguate
between the two cases.  Add helpers/getters/setters, and print in MIR
when such a register is foldable.

The getter will later be used by the register allocation frameworks (and
asserted by the ISELs) while the setters will be used by the instruction
selection frameworks.

Link: https://github.com/llvm/llvm-project/issues/20571




More information about the All-commits mailing list