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

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 23:55:03 PDT 2018


bjope added a subscriber: aprantl.
bjope 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.
 
----------------
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).


https://reviews.llvm.org/D45842





More information about the llvm-commits mailing list