D24453 enabled libcalls simplication for ARM PCS. This may cause
caller/callee calling conventions mismatch in some situations such as
LTO. This patch makes instcombine aware that the compatible calling
conventions differences are benign (not emitting undef idom).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM, since we were already doing that in SimplifyLibCalls.
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | ||
---|---|---|
2121–2122 |
I've temporarily reverted this change because it causes a significant compile-time regression, see https://llvm-compile-time-tracker.com/compare.php?from=4b7bad9eaea2233521a94f6b096aaa88dc584e23&to=f4d682d6ce6c5b3a41a0acf297507c82f5c21eef&stat=instructions. I assume that wasn't intentional.
Looking at the code, what stands out to me is that you're now parsing the target triple eagerly, even though it is only needed if AAPCS is actually involved. Passing it into the function as StringRef instead of Triple is probably sufficient. (More generally, it might make sense to store a parsed target triple in the module...)
Thanks for the report. Passing Stringref does put it back to normal.
https://llvm-compile-time-tracker.com/compare.php?from=23b8264b5255efdc7c87c189feab04520a1979d5&to=69359ebeee6e3bd0e786a51ca542762d3aa4e606&stat=instructions
clang-tidy: warning: 'auto Param' can be declared as 'auto *Param' [llvm-qualified-auto]
not useful