[PATCH] D73168: Improvements to call site register worklist

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 07:28:00 PST 2020


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


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:574
+  // register.
+  using FwdRegWorklist = DenseMap<unsigned, SmallVector<unsigned, 2>>;
+
----------------
dstenb wrote:
> vsk wrote:
> > I think this needs to be a MapVector. Otherwise, the iteration order in getForwardingRegsDefinedByMI will be non-deterministic. I.e. the insertion order into the `Defs` SmallSetVector will not be deterministic.
> Good catch! As I've understood it the iteration order for a non-pointer type holding DenseMap is deterministic for a single binary? However, I guess it's not free from implementation-defined behavior (e.g. the hash function is dependent on the width of `unsigned`), so I guess there's no guarantee that the iteration order is deterministic between binaries built with different compilers. I made it a MapVector.
By the way, the DWARF5 standard appears to mandate that the call site parameter entries occur in the same order as they do in the source, which is currently not the case for LLVM. I created a Bugzilla ticket for that: https://bugs.llvm.org/show_bug.cgi?id=44653.


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

https://reviews.llvm.org/D73168





More information about the llvm-commits mailing list