[CodeGen] Move fentry-insert, xray-instrumentation and patchable-function before...
authorFangrui Song <maskray@google.com>
Sun, 19 Jan 2020 05:44:06 +0000 (21:44 -0800)
committerFangrui Song <maskray@google.com>
Sun, 19 Jan 2020 08:09:46 +0000 (00:09 -0800)
commit9a24488cb67a90f889529987275c5e411ce01dda
tree99cecdf90b0a646a8d2497ff27019668fb664791
parenta72d15e37c5e066f597f13a8ba60aff214ac992d
[CodeGen] Move fentry-insert, xray-instrumentation and patchable-function before addPreEmitPass()

This intention is to move patchable-function before aarch64-branch-targets
(configured in AArch64PassConfig::addPreEmitPass) so that we emit BTI before NOPs
(see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424).

This also allows addPreEmitPass() passes to know the precise instruction sizes if they want.

Tried x86-64 Debug/Release builds of ccls with -fxray-instrument -fxray-instruction-threshold=1.
No output difference with this commit and the previous commit.
llvm/lib/CodeGen/TargetPassConfig.cpp
llvm/test/CodeGen/AArch64/O0-pipeline.ll
llvm/test/CodeGen/AArch64/O3-pipeline.ll
llvm/test/CodeGen/AArch64/patchable-function-entry-bti.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/O3-pipeline.ll
llvm/test/CodeGen/X86/O0-pipeline.ll
llvm/test/CodeGen/X86/O3-pipeline.ll