[llvm-dev] Unexpected dag combine in arm64

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 5 13:47:30 PDT 2017


On 9/5/2017 1:21 PM, Jon Chesterfield via llvm-dev wrote:
>
>     If you want to materialize a floating-point constant using an
>     integer-to-floating-point conversion, I would suggest using a
>     target-specific node rather than a target-independent one.
>     -Eli
>
>
> Thanks Eli. The objective is to customise the type legalisation phase 
> of SelectionDAG for a few nodes. Instead of converting directly 
> between floating point and integer (which generates a library call) 
> I'd like to lower via an intermediate sized integer which there is 
> some hardware support for. This is partly motivated by the relevant 
> library call not existing yet.
>
> The only customisation hook I have found for type legalisation in the 
> SelectionDAG is the target override performDAGCombine. I'd be very 
> interested in an alternative mechanism for influencing type 
> legalisation from within target specific code.

"setOperationAction(ISD::UINT_TO_FP   , MVT::i32  , Promote);" to 
automatically use a larger integer type.  Or 
"setOperationAction(ISD::UINT_TO_FP   , MVT::i32  , Custom);", then 
write your custom code in LowerOperation.  If you want examples, x86 
uses both of these.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170905/3768e9bf/attachment.html>


More information about the llvm-dev mailing list