diff options
author | Nuri Amari <nuri.amari99@gmail.com> | 2024-05-23 10:04:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 10:04:55 -0700 |
commit | 8cc8e5d6c6ac9bfc888f3449f7e424678deae8c2 (patch) | |
tree | 3837d9b2c366b691e7b17665ec51f456c5ddf69b /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | 910292c3ac2ebe43cdbc90223c6c9702128316db (diff) | |
download | llvm-8cc8e5d6c6ac9bfc888f3449f7e424678deae8c2.zip llvm-8cc8e5d6c6ac9bfc888f3449f7e424678deae8c2.tar.gz llvm-8cc8e5d6c6ac9bfc888f3449f7e424678deae8c2.tar.bz2 |
Run ObjCContractPass in Default Codegen Pipeline (#92331)
Prior to this patch, when using -fthinlto-index= the ObjCARCContractPass isn't run prior to CodeGen, and instruction selection fails on IR containing arc intrinsics. This patch is motivated by that usecase.
The pass was previously added in various places codegen is performed. This patch adds the pass to the default codegen pipepline, makes sure it bails immediately if no arc intrinsics are found, and removes the adhoc scheduling of the pass.
Co-authored-by: Nuri Amari <nuriamari@fb.com>
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 8832b51..bc868d4 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -46,6 +46,7 @@ #include "llvm/Support/WithColor.h" #include "llvm/Target/CGPassBuilderOption.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Transforms/ObjCARC.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils.h" #include <cassert> @@ -946,6 +947,8 @@ void TargetPassConfig::addCodeGenPrepare() { void TargetPassConfig::addISelPrepare() { addPreISel(); + addPass(createObjCARCContractPass()); + // Force codegen to run according to the callgraph. if (requiresCodeGenSCCOrder()) addPass(new DummyCGSCCPass); |