[PATCH] D115850: [LTO][codegen] Add TargetLibraryInfoWrapperPass initially
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 5 12:07:28 PST 2022
craig.topper added a comment.
In D115850#3223072 <https://reviews.llvm.org/D115850#3223072>, @aeubanks wrote:
> I'd expect most/all the TLI optimizations to have happened before codegen, although some IR passes can be added to the codegen pipeline, and having the right TLI for those does make sense.
> it'd be nice to have an actual test for this in tree, but that might be hard to come up with. can you use --print-after-all to see which pass is doing something different when this patch is applied, just to convince me that this actually works?
Speculating a little. For the sqrt_finite example given previously, it's probably SelectionDAGBuilder that is doing something different. There is code in there to convert `LibFunc_sqrt_finite` to ISD::FSQRT. I guess we don't turn finite calls into intrinsics anywhere before that. TargetLibraryInfo needs the Triple in order to know if sqrt_finite is supported. It's marked unavailable in TargetLibraryInfo.cpp's `initialize` function unless the Triple has a Linux OS and a GNU environment.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115850/new/
https://reviews.llvm.org/D115850
More information about the llvm-commits
mailing list