On platforms which use -fmath-errno, math libcalls without any uses require some extra checks to figure out if they are actually dead.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Analysis/ConstantFolding.cpp | ||
---|---|---|
1971 ↗ | (On Diff #75798) | There are lots of duplicated logic here with LibcallShinkWrap pass. I think the right way to do is let the later passes to clean up the dead calls. This can be done by pushing libcall shrinkwrap later in the pipeline. |
lib/Analysis/ConstantFolding.cpp | ||
---|---|---|
1971 ↗ | (On Diff #75798) | The case which I originally ran into involves pow(), and LibCallsShrinkWrap can't really deal with that effectively, as far as I can tell. It's probably possible to refactor the logic for some of the other libcalls... but we want to perform the check in isInstructionTriviallyDead to get rid of dead calls as soon as possible, so they don't block other optimizations. |
lib/Analysis/ConstantFolding.cpp | ||
---|---|---|
1971 ↗ | (On Diff #75798) | Refactoring is ideal, but it may not be easy to do. Please add a comment here to point to the refactoring opportunity in the future. |