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

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 15:22:51 PST 2017


t.p.northover closed this revision.
t.p.northover added a comment.

Thanks Quentin. Committed as r291973. Hopefully the bot should be green soonish.



================
Comment at: include/llvm/CodeGen/GlobalISel/IRTranslator.h:405
+  /// represented simply by the IR-level CFG.
+  void addMachineCFGPred(CFGEdge Edge, MachineBasicBlock *NewPred);
+
----------------
qcolombet wrote:
> 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.
Good idea.


Repository:
  rL LLVM

https://reviews.llvm.org/D28578





More information about the llvm-commits mailing list