[llvm] [CodeGen] add RuntimeLibraryInfoWrapper pass to addPassesToEmitMC (PR #174682)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 7 14:06:23 PST 2026


================
@@ -123,6 +124,12 @@ addPassesToGenerateCode(CodeGenTargetMachineImpl &TM, PassManagerBase &PM,
   PassConfig->setDisableVerify(DisableVerify);
   PM.add(PassConfig);
   PM.add(&MMIWP);
+
+  const TargetOptions &Options = TM.Options;
+  PM.add(new RuntimeLibraryInfoWrapper(
----------------
lhames wrote:

Digging a bit deeper, looks like that `TargetLibraryInfoWrapperPass` is added implicitly due to a requirement from `PreISelIntrinsicLoweringLegacyPass`:

```c++
class PreISelIntrinsicLoweringLegacyPass : public ModulePass {
public:
  /* ... */
  void getAnalysisUsage(AnalysisUsage &AU) const override {
    AU.addRequired<TargetTransformInfoWrapperPass>();
    AU.addRequired<TargetLibraryInfoWrapperPass>();
    AU.addRequired<LibcallLoweringInfoWrapper>();
    AU.addRequired<TargetPassConfig>();
  }
```

The goal is to have ORC's compile pipeline be as close as possible to clangs / llc's. Maybe we should be adding both passes explicitly in `addPassesToEmitMC`?

<apologies -- I failed to hit submit on this last night>

https://github.com/llvm/llvm-project/pull/174682


More information about the llvm-commits mailing list