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

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 13 21:10:13 PST 2016


dberris added a comment.

It's really hard for me to see how this works without a more useful/completed implementation. It's also very under-specified at this time.



================
Comment at: lib/Target/X86/X86CallLowering.cpp:30-39
+bool X86CallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
+                                  const Value *Val, unsigned VReg) const {
+  // TODO: handle functions returning non-void values.
+  if (Val)
+    return false;
+
+  MIRBuilder.buildInstr(X86::RET).addImm(0);
----------------
I'm interested in this bit -- how will a return be lowered? i.e. what will call this function, and will it happen for any instruction that counts as a return?


================
Comment at: lib/Target/X86/X86CallLowering.h:32-33
+
+  bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
+                   unsigned VReg) const override;
+
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D26593





More information about the llvm-commits mailing list