[llvm-commits] [llvm] r108639 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Chris Lattner
clattner at apple.com
Sun Jul 18 12:52:34 PDT 2010
On Jul 18, 2010, at 12:44 PM, Owen Anderson wrote:
>
> On Jul 18, 2010, at 12:04 PM, Chris Lattner wrote:
>> I agree that the xform is correct. Why not do it on IR though?
>
> For the reasons I laid out in the earlier email, namely that it would require adding a sqrt() -> intrinsic transform at the IR level, which SelectionDAG is already doing, so it seemed like extraneous effort on the optimizer's part. If you really want, I can re-implement it as a SimplifyLibCalls+InstCombine xform, though.
I would prefer for this to happen in InstCombiner::visitFPTrunc. Both because we already have the infrastructure to do this there, but also because your code only handles the -fno-math-errno case. Normal calls to libm sqrt should be transformed, not just llvm.sqrt.
-Chris
More information about the llvm-commits
mailing list