[PATCH] D70126: [PowerPC] Refactor FinishCall

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 07:41:13 PST 2019


sfertile created this revision.
sfertile added reviewers: cebowleratibm, ZarkoCA, Xiangling_L, jasonliu.
Herald added subscribers: shchenz, wuzish, jsji, kbarton, hiraditya, nemanjai.
Herald added a project: LLVM.
sfertile edited the summary of this revision.

Refactor FinishCall to be more easily understandable as a precursor to implementing indirect calls for AIX. The refactor tries to group similar code together at the cost of some code duplication. The high level overview of the refactor:

  
  - Adds a number of helper functions for things like:
    * Determining if a call is indirect.
    * What the Opcode for a call is.
    * Transforming the callee for a direct function call.
    * Extracting the Chain operand from a CallSeqStart node.
    * Building the operands of the call.
  
  - Adds helpers for building the indirect call DAG nodes (excluding the call instruction itself which is created in `FinishCall`).
  - Removes PrepareCall, which has been subsumed by the helpers.
  - rename 'InFlag' to 'Glue'.
  
  - FinishCall has been refactored to:
    1) Set TOC pointer usage on the DAG for the TOC based subtargets.
    2) Calculate if a call is indirect.
    3) Determine the Opcode to use for the call instruction.
    4) Transform the Callee for direct calls, or build the DAG nodes for indirect calls.
    5) Buildup the call operands.
    6) Emit the call instruction.
    7) If needed, emit the callSeqEnd Node and finish lowering by calling `LowerCallResult`

A couple notes:

- Sorry for the size of the patch, but it was difficult to find a more incremental approach that didn't need all the split up patches for the full context anyway.
- I intend at least 1 follow on patch to cleanup up the handful of boolean flags we are passing between LowerCall and LowerCall_<Platform> and FinishCall.
- I don't have clang format setup on my development machine yet. I am going to set that up today and run over the patch to fix any formatting issues.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70126

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/lib/Target/PowerPC/PPCSubtarget.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70126.228892.patch
Type: text/x-patch
Size: 30989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191112/908f08ed/attachment-0001.bin>


More information about the llvm-commits mailing list