[PATCH] D46329: [SelectionDAG] Selection of DBG_VALUE using a PHI node result (pt 2)

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 1 13:45:00 PDT 2018


vsk added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5273
+          auto RegisterVT = RFV.RegVTs.begin();
+          for (auto RegCount : RFV.RegCount) {
+            unsigned RegisterSize = (RegisterVT++)->getSizeInBits();
----------------
bjope wrote:
> vsk wrote:
> > You might be able to simplify this by using zip_first(RegCount, RegVTs) (see STLExtras.h, or unittests/ADT/IteratorTest for example usage).
> I basically stole this code/loop from EmitFuncArgumentDbgValue (line ~4917). But your suggestion sounds like a really good idea.
> 
> May I suggest a follow up commit to refactor this and the code in EmitFuncArgumentDbgValue at the same time? Or is it preferred to have this one nice-looking from the start? (I can totally but that...)
I'd be fine with a follow-up commit to clean up both sites.

Although now that you mention this, there may be a opportunity here to share code. It's conceivable that some common helper could take care of creating the fragment expressions, and then passing {fragmentExpr, Offset, Reg} to a lambda.


================
Comment at: test/DebugInfo/X86/sdag-dbgvalue-phi-use-3.ll:123
+attributes #2 = { nounwind readnone speculatable }
+attributes #3 = { nounwind }
+
----------------
Consider stripping out these attributes, lifetime markers, and tbaa metadata to make the test more maintainable.


Repository:
  rL LLVM

https://reviews.llvm.org/D46329





More information about the llvm-commits mailing list