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
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
459 | It is not super clean to duplicated this code. |
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
422 | This seems unnecessary? |
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
422 | 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? |
LGTM. Thanks!
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
422 | Oh right, I was looking at the existing code and I missed that you were removing the LibraryInfo initialization. |
This seems unnecessary?