diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2020-12-08 22:04:00 +0100 |
---|---|---|
committer | Ilya Leoshkevich <iii@linux.ibm.com> | 2020-12-09 00:59:01 +0100 |
commit | d58f112ce03877f73200591cd3c9b38e41e46afe (patch) | |
tree | bfd8e09a8bc72a4c6de64aead55b8d709549407e /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 5171b7b40e9813e3fbfaf1e1e3372895c9ff6081 (diff) | |
download | llvm-d58f112ce03877f73200591cd3c9b38e41e46afe.zip llvm-d58f112ce03877f73200591cd3c9b38e41e46afe.tar.gz llvm-d58f112ce03877f73200591cd3c9b38e41e46afe.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index fd658cd..900abd2 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -713,6 +713,7 @@ bool MachineInstr::isCandidateForCallSiteEntry(QueryType Type) const { case TargetOpcode::PATCHPOINT: case TargetOpcode::STACKMAP: case TargetOpcode::STATEPOINT: + case TargetOpcode::FENTRY_CALL: return false; } return true; |