[PATCH] D47986: [CostModel] Treat Identity shuffle masks as zero cost
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 11 11:11:51 PDT 2018
RKSimon added a comment.
In https://reviews.llvm.org/D47986#1128533, @spatel wrote:
> We should fold these in InstSimplify, so assigning a zero cost seems appropriate, but that raises the question: who's creating these? Couldn't they call llvm::SimplifyShuffleVectorInst() and short-circuit the problem?
I believe this is the default expansion of the reduction intrinsics - I suppose specifying undef in the upper lanes is useful to help propagate demanded elts so InstSimplify might prevent further improvements if it prematurely optimizes?
I know there are a couple of tests in AMDGPU that was specifying an identity shuffle as one of its costs tests (it expects it to be recognised as a SK_PermuteSingleSrc which is free - so this patch isn't affecting it).
Repository:
rL LLVM
https://reviews.llvm.org/D47986
More information about the llvm-commits
mailing list