[PATCH] D26359: Use LiveRangeCalc to extend live ranges in shrinkToUses

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 29 07:23:20 PDT 2018


kparzysz added a comment.

In https://reviews.llvm.org/D26359#1147318, @scott.linder wrote:

> I did not understand the undef register flag. Is there somewhere I can read more about MIR, or is the code the best place? https://llvm.org/docs/MIRLangRef.html is currently a little short on specifics.


There are some comments in include/llvm/CodeGen/MachineOperand.h that explain what different flags mean, for example:

  /// IsUndef - True if this register operand reads an "undef" value, i.e. the
  /// read value doesn't matter.  This flag can be set on both use and def
  /// operands.  On a sub-register def operand, it refers to the part of the
  /// register that isn't written.  On a full-register def operand, it is a
  /// noop.  See readsReg().
  ///
  /// This is only valid on registers.
  ///
  /// Note that an instruction may have multiple <undef> operands referring to
  /// the same register.  In that case, the instruction may depend on those
  /// operands reading the same dont-care value.  For example:
  ///
  ///   %1 = XOR undef %2, undef %2
  ///
  /// Any register can be used for %2, and its value doesn't matter, but
  /// the two operands must be the same register.
  ///
  unsigned IsUndef : 1;

The MIRLangRef is really a documentation of the MIR //format//, not of the contents.  MIR is YAML-based and was introduced to print machine functions in such a way that the output can be read back in and the machine function reconstructed from it.  Before that the printing code would dump the info in a fairly intuitive way, but the format was not defined anywhere and we had no way to parse it.

What I would suggest is that if you see something unfamiliar in the output, check the printing code to see where it gets it from (what data structures, etc.), and then check the source code that defines that data to see if there are any explanations in the comments.  The most commonly used structures are typically documented.


Repository:
  rL LLVM

https://reviews.llvm.org/D26359





More information about the llvm-commits mailing list