[LLVMdev] Changes to TargetLowering::{LowerCallTo,LowerCall}

Justin Holewinski jholewinski at nvidia.com
Fri May 25 09:59:27 PDT 2012


A change has just been committed that changes the interface for TargetLowering::LowerCallTo and TargetLowering::LowerCall.  Instead of passing a mess of parameters to these functions, a new structure has been created that encapsulates these parameters.  The motivation is that additional fields can be added to this structure (with appropriate changes to SelectionDAGBuilder for populating the new fields) without forcing an ABI change on each and every target.  In-tree targets have been updated accordingly, so no change is required.  However, if you have an out-of-tree target that is following trunk, please be aware that this *will* break your build.  Please see any in-tree target for the new interface and how to access the values that used to be available as individual function parameters.



As a quick example, the ARM implementation for LowerCall is now:



SDValue

ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,

                             SmallVectorImpl<SDValue> &InVals) const {

  SelectionDAG &DAG                     = CLI.DAG;

  DebugLoc &dl                          = CLI.DL;

  SmallVector<ISD::OutputArg, 32> &Outs = CLI.Outs;

  SmallVector<SDValue, 32> &OutVals     = CLI.OutVals;

  SmallVector<ISD::InputArg, 32> &Ins   = CLI.Ins;

  SDValue Chain                         = CLI.Chain;

  SDValue Callee                        = CLI.Callee;

  bool &isTailCall                      = CLI.IsTailCall;

  CallingConv::ID CallConv              = CLI.CallConv;

  bool doesNotRet                       = CLI.DoesNotReturn;

  bool isVarArg                         = CLI.IsVarArg;





The CallLoweringInfo struct now contains all parameters that were originally available as parameters.  The InVals vector was left as a parameter since it is the responsibility of the LowerCall implementation to fill it and does not represent input information about the call (unlike IsTailCall which is an in/out parameter, and hence added to the new struct).







-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120525/bf5f1553/attachment.html>


More information about the llvm-dev mailing list