[PATCH] D42679: [DAGCombiner] When combining zero_extend of a truncate, only mask before extending for vectors.

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 09:58:06 PST 2018


tra added a comment.

In https://reviews.llvm.org/D42679#1017544, @tra wrote:

> In https://reviews.llvm.org/D42679#1016635, @craig.topper wrote:
>
> > @tra, did you figure out what was going on?
>
>
> Some of it. Something weird is going on during lowering or i1 arguments in NVPTX and we end up with CopyToReg on a chain, but with no other uses. I've found references to what looks like a similar issue in PPC code (ANDIGlueBug <https://github.com/llvm-mirror/llvm/blob/master/lib/Target/PowerPC/PPCISelDAGToDAG.cpp#L86>), so it may not be a new issue. It certainly has nothing to do with your patch.


That unused setp is an artifact of -O0. Without it (or with any other -O level) NVPTX generates more sensible code (with or without this patch):

  	ld.param.u8 	%r1, [test_i1_param_0];
  	and.b32  	%r2, %r1, 1;
  	st.param.b32 	[func_retval0+0], %r2;
  	ret;


https://reviews.llvm.org/D42679





More information about the llvm-commits mailing list