From c78726fae0edf28e0556a03b7b44df3c4ec3c94e Mon Sep 17 00:00:00 2001 From: Sean Fertile Date: Mon, 9 Dec 2019 12:26:16 -0500 Subject: [PowerPC] Refactor FinishCall. [NFC] 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` Differential Revision: https://reviews.llvm.org/D70126 --- llvm/lib/Target/PowerPC/PPCSubtarget.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Target/PowerPC/PPCSubtarget.h') diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.h b/llvm/lib/Target/PowerPC/PPCSubtarget.h index 7266d82a08b..fdda92f0b34 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.h +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.h @@ -351,6 +351,13 @@ public: /// True if the GV will be accessed via an indirect symbol. bool isGVIndirectSymbol(const GlobalValue *GV) const; + /// True if the ABI is descriptor based. + bool usesFunctionDescriptors() const { + // Both 32-bit and 64-bit AIX are descriptor based. For ELF only the 64-bit + // v1 ABI uses descriptors. + return isAIXABI() || (is64BitELFABI() && !isELFv2ABI()); + } + bool isXRaySupported() const override { return IsPPC64 && IsLittleEndian; } }; } // End llvm namespace -- cgit v1.2.3