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

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 17:04:11 PST 2018


aprantl added a comment.

In https://reviews.llvm.org/D41924#972883, @probinson wrote:

> >   the dagcombine rule (zext (truncate x)) -> (zext (truncate x)).
>
> Are my eyes going bad (well, they are, but more than usual) or do both sides of this rule say the same thing?


Your eyes are fine: The code replaces a (zext (truncate x)) with

  Op = DAG.getZeroExtendInReg(Op, SDLoc(N), MinVT.getScalarType());
  SDValue ZExtOrTrunc = DAG.getZExtOrTrunc(Op, SDLoc(N), VT);

My Selection-DAG-Fu is not very good but I think the relevant change is the `inReg` part of the zext.


Repository:
  rL LLVM

https://reviews.llvm.org/D41924





More information about the llvm-commits mailing list