[PATCH] D41924: dagcombine: Transfer debug information when folding (zext (truncate x)) -> (zext (truncate x))

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 11:18:58 PST 2018


efriedma added a comment.

The transform here is really trunc+zext->and+zext.  DAGCombine naturally transfers the debug into from the old zext to the new zext; what the explicit call to transferDbgValues is doing here is transfering debug info from the old *trunc* to the new zext.

It seems a little dubious to transferDbgValues between two nodes which don't have the same type, but I guess it works out here because the debugger implicitly truncates the result of the zext?  How exactly does that work?  The code could use a better comment to clarify this.


Repository:
  rL LLVM

https://reviews.llvm.org/D41924





More information about the llvm-commits mailing list