[PATCH] D51194: [InstCombine] Fix issue in the simplification of pow() with nested exp{, 2}()

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 13:53:27 PDT 2018


spatel added a comment.

It isn't obvious why this case is different than the other transforms, so some code comments are needed.

1. We can't rely on dead code elimination because libcalls may not be readnone (ie, they may set errno).
2. The calling code in LibCallSimplifier and InstCombine handles erasing the called function itself in all cases.
3. In this transform, we're potentially eliminating the intermediate exp2 call, so we have to manually kill it.

But what happens if the exp2 call has another use besides the pow call? We need a test for that scenario.


Repository:
  rL LLVM

https://reviews.llvm.org/D51194





More information about the llvm-commits mailing list