[PATCH] D28578: [GlobalISel] correctly record PHI sources coming from switch instructions

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 15:16:16 PST 2017


qcolombet added inline comments.


================
Comment at: include/llvm/CodeGen/GlobalISel/IRTranslator.h:405
+  /// represented simply by the IR-level CFG.
+  void addMachineCFGPred(CFGEdge Edge, MachineBasicBlock *NewPred);
+
----------------
t.p.northover wrote:
> qcolombet wrote:
> > t.p.northover wrote:
> > > qcolombet wrote:
> > > > const CFGEdge &, MachineBasicBlock &
> > > I did think about this at the time, but decided a pair of pointers was simple enough to pass by value. I can change it, but I'm not convinced there's a strong argument either way.
> > Fine by me. I would still turn the pointer to NewPred into a reference though. That makes it obvious nullptr is not a valid argument :).
> I'm not so sure about that one either. The problem is that maps can't contain references, which means the querying interface essentially has to use pointers. Having those out of sync seems a bit worse than passing a raw pointer to me.
Fair enough.
I would add an assert that NewPred is not null in that method.


Repository:
  rL LLVM

https://reviews.llvm.org/D28578





More information about the llvm-commits mailing list