diff options
author | Fangrui Song <maskray@google.com> | 2020-01-18 21:44:06 -0800 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-01-19 00:09:46 -0800 |
commit | 9a24488cb67a90f889529987275c5e411ce01dda (patch) | |
tree | 99cecdf90b0a646a8d2497ff27019668fb664791 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | a72d15e37c5e066f597f13a8ba60aff214ac992d (diff) | |
download | llvm-9a24488cb67a90f889529987275c5e411ce01dda.zip llvm-9a24488cb67a90f889529987275c5e411ce01dda.tar.gz llvm-9a24488cb67a90f889529987275c5e411ce01dda.tar.bz2 |
[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.
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 41cb511..d08d05d 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -956,6 +956,12 @@ void TargetPassConfig::addMachinePasses() { if (getOptLevel() != CodeGenOpt::None) addBlockPlacement(); + // Insert before XRay Instrumentation. + addPass(&FEntryInserterID, false); + + addPass(&XRayInstrumentationID, false); + addPass(&PatchableFunctionID, false); + addPreEmitPass(); if (TM->Options.EnableIPRA) @@ -968,12 +974,6 @@ void TargetPassConfig::addMachinePasses() { addPass(&StackMapLivenessID, false); addPass(&LiveDebugValuesID, false); - // Insert before XRay Instrumentation. - addPass(&FEntryInserterID, false); - - addPass(&XRayInstrumentationID, false); - addPass(&PatchableFunctionID, false); - if (TM->Options.EnableMachineOutliner && getOptLevel() != CodeGenOpt::None && EnableMachineOutliner != NeverOutline) { bool RunOnAllFunctions = (EnableMachineOutliner == AlwaysOutline); |