[PATCH] D26593: [X86][GlobalISel] Add minimal call lowering support to the IRTranslator

Zvi Rackover via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 07:46:31 PST 2016


zvi added inline comments.


================
Comment at: lib/Target/X86/X86CallLowering.h:32-33
+
+  bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
+                   unsigned VReg) const override;
+
----------------
dberris wrote:
> zvi wrote:
> > dberris wrote:
> > > I may be missing something obvious, but why does call lowering need to lower a return? I would have thought return-lowering might happen in function lowering.
> > The CallLowering interface is a target-hook for lowering both caller and calee -related constructs. This patch only implements the callee part. The caller-part (i.e. lowering call sites) will be added in the future.
> I think I'm still missing something but maybe this is because of my confusion in naming -- this class is named `X86CallLowering` but it's implementing the lowering of the return instruction and the formal arguments.
> 
> Wouldn't the function-lowering specific ("callee-side") code be better in a class named more appropriately specifically for function-lowering? Because I might expect to see that code alongside stack adjustment and prologue/epilogue lowering of a function rather than for lowering "calls".
> 
> Does that make sense?
We are going off-topic, but i don't mind to continue this discussion if you find it useful.

> this class is named X86CallLowering but it's implementing the lowering of the return instruction and the formal arguments.
> Wouldn't the function-lowering specific ("callee-side") code be better in a class named more appropriately specifically for function-lowering? 
This class also inherits empty overloads of a method named lowerCall(). A follow-up task is to override these methods.


> Because I might expect to see that code alongside stack adjustment and prologue/epilogue lowering of a function rather than for lowering "calls".
If you haven't done this already, I suggest you read the documentation about the LLVM Codegen [http://llvm.org/docs/CodeGenerator.html], There you will see that in the codegen-scale the initial lowering of LLVM IR to Machine IR and prologue/epilogue insertion happen in different (and distant) stages. Just to give you perspective, Global ISel only intends to replace the "Instruction Selection" phase of the entire code-generation pipe.


Repository:
  rL LLVM

https://reviews.llvm.org/D26593





More information about the llvm-commits mailing list