[all-commits] [llvm/llvm-project] d58f11: Prevent FENTRY_CALL reordering

Ilya Leoshkevich via All-commits all-commits at lists.llvm.org
Tue Dec 8 16:01:58 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d58f112ce03877f73200591cd3c9b38e41e46afe
      https://github.com/llvm/llvm-project/commit/d58f112ce03877f73200591cd3c9b38e41e46afe
  Author: Ilya Leoshkevich <iii at linux.ibm.com>
  Date:   2020-12-09 (Wed, 09 Dec 2020)

  Changed paths:
    M llvm/include/llvm/Target/Target.td
    M llvm/lib/CodeGen/MachineInstr.cpp
    A llvm/test/CodeGen/SystemZ/fentry-debug-info.ll
    A llvm/test/CodeGen/SystemZ/fentry-no-reorder.ll

  Log Message:
  -----------
  Prevent FENTRY_CALL reordering

FEntryInserter prepends FENTRY_CALL to the first basic block. In case
there are other instructions, PostRA Machine Instruction Scheduler can
move FENTRY_CALL call around. This actually occurs on SystemZ (see the
testcase). This is bad for the following reasons:

* FENTRY_CALL clobbers registers.
* Linux Kernel depends on whatever FENTRY_CALL expands to to be the very
  first instruction in the function.

Fix by adding isCall attribute to FENTRY_CALL, which prevents reordering
by making it a scheduling boundary for PostRA Machine Instruction
Scheduler.

Reviewed By: niravd

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




More information about the All-commits mailing list