[PATCH] D58191: [DebugInfo] Make postra sinking of DBG_VALUEs safe in the presence of subregisters

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 02:48:48 PDT 2019


jmorse marked an inline comment as done.
jmorse added inline comments.


================
Comment at: lib/CodeGen/MachineSink.cpp:1208
+    DbgValsToSink.insert(DbgValsToSink.begin(), DbgValsToSinkSet.begin(),
+                         DbgValsToSinkSet.end());
 
----------------
vsk wrote:
> jmorse wrote:
> > aprantl wrote:
> > > I think you may need to sort here to avoid nondeterministic output when iterating over a Set?
> > Good catch, I've added a sort to avoid relying on the sets order.
> Naive question, but: is llvm::sort sorting by address-of-the-MI here, or something else? (Just checking -- if it's the former that's not quite deterministic, and maybe a SetVector is called for)
*blinks* *double-takes* Clearly I had a serious caffeine deficiency when writing that code. Updated to use a SetVector as recommended. Single sunk instructions tend to only have a few DBG_VALUEs attached, so I'm not worried about the performance implications.

I'll continue on and land this as I think this qualifies as a trivial update to the patch.


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

https://reviews.llvm.org/D58191





More information about the llvm-commits mailing list