Currently, TargetLibraryInfoWrapperPass is inserted by PMBuilder.
However, some passes are inserted manually before the PMBuilder
ones - if any of them happens to use TargetLibraryInfoWrapperPass,
it'll get a default-constructed one, with an unknown target triple.
This happens to InstrProfiling in D21736, breaking it.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
459 ↗ | (On Diff #61914) | It is not super clean to duplicated this code. |
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
422 ↗ | (On Diff #75550) | This seems unnecessary? |
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
422 ↗ | (On Diff #75550) | This ensures FPM passes get the right TLI as well - since I'm removing the PMBuilder.LIbraryInfo assignment, they would otherwise get the default-constructed ones. Or should I keep the assignment instead, and only special-case MPM? |
Comment Actions
LGTM. Thanks!
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
422 ↗ | (On Diff #75550) | Oh right, I was looking at the existing code and I missed that you were removing the LibraryInfo initialization. |