]> granicus.if.org Git - llvm/commit
[TargetLowering] Correctly track NumFixedArgs field of CallLoweringInfo
authorAlex Bradbury <asb@lowrisc.org>
Wed, 11 Oct 2017 13:48:45 +0000 (13:48 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Wed, 11 Oct 2017 13:48:45 +0000 (13:48 +0000)
commita951eff6275ed7f66448d265de5abcc1ca669e29
treeccd242f9f4d93ed70d45d7b988b46d24e780e468
parentd486e90488cc0e9351069d292b6a016a7b3c2cc9
[TargetLowering] Correctly track NumFixedArgs field of CallLoweringInfo

The NumFixedArgs field of CallLoweringInfo is used by
TargetLowering::LowerCallTo to determine whether a given argument is passed
using the vararg calling convention or not (specifically, to set IsFixed for
each ISD::OutputArg).

Firstly, CallLoweringInfo::setLibCallee and CallLoweringInfo::setCallee both
incorrectly set NumFixedArgs based on the _previous_ args list. Secondly,
TargetLowering::LowerCallTo failed to increment NumFixedArgs when modifying
the argument list so a pointer is passed for the return value.

If your backend uses the IsFixed property or directly accesses NumFixedArgs,
it is _possible_ this change could result in codegen changes (although the
previous behaviour would have been incorrect). No such cases have been
identified during code review for any in-tree architecture.

Differential Revision: https://reviews.llvm.org/D37898

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315457 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp