mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
[InstSimplify] Move masked.gather w/no active lanes handling to InstSimplify from InstCombine
In the process, use the existing masked.load combine which is slightly stronger, and handles a mix of zero and undef elements in the mask. llvm-svn: 358913
This commit is contained in:
parent
56f4e6ed4f
commit
0e2498cde5
@ -4876,7 +4876,8 @@ static Value *simplifyIntrinsic(Function *F, IterTy ArgBegin, IterTy ArgEnd,
|
||||
|
||||
// Handle intrinsics with 3 or more arguments.
|
||||
switch (IID) {
|
||||
case Intrinsic::masked_load: {
|
||||
case Intrinsic::masked_load:
|
||||
case Intrinsic::masked_gather: {
|
||||
Value *MaskArg = ArgBegin[2];
|
||||
Value *PassthruArg = ArgBegin[3];
|
||||
// If the mask is all zeros or undef, the "passthru" argument is the result.
|
||||
|
@ -1220,11 +1220,6 @@ Instruction *InstCombiner::simplifyMaskedStore(IntrinsicInst &II) {
|
||||
// * Vector splat address w/known mask -> scalar load
|
||||
// * Vector incrementing address -> vector masked load
|
||||
static Instruction *simplifyMaskedGather(IntrinsicInst &II, InstCombiner &IC) {
|
||||
// If the mask is all zeros, return the "passthru" argument of the gather.
|
||||
auto *ConstMask = dyn_cast<Constant>(II.getArgOperand(2));
|
||||
if (ConstMask && ConstMask->isNullValue())
|
||||
return IC.replaceInstUsesWith(II, II.getArgOperand(3));
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user