[PATCH] CGCall: Factor out the logic mapping call arguments to LLVM IR arguments.

Alexey Samsonov vonosmas at gmail.com
Fri Aug 15 15:05:47 PDT 2014


Hi rnk,

This refactoring introduces CallArgsToIRArgsMapping class, which
encapsulates the information about the order in which function arguments listed
in CGFunctionInfo should be passed to actual LLVM IR function, such as:
1) positions of sret, if there is any
2) position of inalloca argument, if there is any
3) position of helper padding argument for each call argument
4) positions of regular argument (there can be many if it's expanded).
Simplify several related methods (ConstructAttributeList, EmitFunctionProlog
and EmitCall): now they don't have to maintain iterators over the list
of LLVM IR function arguments, dealing with all the sret/inalloca/this complexities,
and just use expected positions of LLVM IR arguments stored in CallArgsToIRArgsMapping.

This may increase the running time of EmitFunctionProlog, as we have to traverse
expandable arguments twice, but in further refactoring we will be able
to speed up EmitCall by passing already calculated CallArgsToIRArgsMapping to
ConstructAttributeList, thus avoiding traversing expandable argument there.

No functionality change.

http://reviews.llvm.org/D4938

Files:
  lib/CodeGen/CGCall.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4938.12574.patch
Type: text/x-patch
Size: 34081 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140815/be0ec40f/attachment.bin>


More information about the cfe-commits mailing list