[PATCH] D139861: [llvm] boilerplate for new callbrprepare codegen IR pass

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 11:01:39 PST 2023


jyknight added inline comments.


================
Comment at: llvm/lib/CodeGen/CallBrPrepare.cpp:9-17
+// This pass lowers callbrs in LLVM IR to something closer that the backend can
+// perform correct instruction selection for.  In particular, callbr may have
+// inline asm with output constraints that require specific physical registers.
+// These physical register will need to be copied back to virtual registers
+// somewhere. If we have critical edges, we may need to split them. Regardless
+// of critical edges, we create distinct new SSA values for each indirect
+// destination of the callbr, then remap users of the direct destinations value
----------------
void wrote:
> jyknight wrote:
> > I think this description needs to be substantially edited for clarity.
> > 
> > A few points on substance: 
> > - the problem is not unique to physical register outputs, so mentioning that here is just misleading.
> > - Worth noting that this is primarily to make things easy for SelectionDAG, and in GlobalISel we may be able to lower directly without the IR pass.
> s/closer//
> [...] GlobalISel we may be able to lower directly [...]

Or, maybe not...since we probably still need to split critical edges, just not insert a new intrinsic? Dunno.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139861/new/

https://reviews.llvm.org/D139861



More information about the llvm-commits mailing list