[PATCH] D45842: [Reassociate] swap binop operands to increase factoring potential

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 8 09:30:03 PDT 2018


aprantl added inline comments.


================
Comment at: test/Transforms/Reassociate/matching-binops.ll:297
 
-; Verify that debug info for modified instructions gets discarded (references become undef).
+; Verify that debug info for modified instructions is not invalid.
 
----------------
bjope wrote:
> nit: Verify that we "discard" the dbg.value for variable "a" (`metadata !19` in the input, `metadata !18` in the output), since we do nto calculate the value `%and` after the transformation.
> 
> @aprantl once told me that is was better to use `metadata i32 undef` instead of `metadata !{}` when a dbg.value is "discarded". I think it is out-of-scope for this patch, but maybe the code that picks `metadata !2` in this solution should insert an undef value instead (or maybe later passes should handle `metadata !{}` the same way as if we have an explicit undef value, in case there really is a difference today).
Do you think it would help to have a common facility along the lines of DbgInstrinsicInstr::replaceWithUndef() to make it easier to do the right thing?


https://reviews.llvm.org/D45842





More information about the llvm-commits mailing list