mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-03 11:08:32 +00:00
Move a transform from InstCombine to InstSimplify.
This transform doesn't require any new instructions, it can safely live in InstSimplify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
95c81ed0a1
commit
d2dd1e2fd6
@ -3991,6 +3991,15 @@ static Value *SimplifyIntrinsic(Function *F, IterTy ArgBegin, IterTy ArgEnd,
|
||||
Q.DL);
|
||||
}
|
||||
|
||||
// Simplify calls to llvm.masked.load.*
|
||||
if (IID == Intrinsic::masked_load) {
|
||||
IterTy MaskArg = ArgBegin + 2;
|
||||
// If the mask is all zeros, the "passthru" argument is the result.
|
||||
if (auto *ConstMask = dyn_cast<Constant>(*MaskArg))
|
||||
if (ConstMask->isNullValue())
|
||||
return ArgBegin[3];
|
||||
}
|
||||
|
||||
// Perform idempotent optimizations
|
||||
if (!IsIdempotent(IID))
|
||||
return nullptr;
|
||||
|
@ -1044,10 +1044,6 @@ static Value *simplifyMaskedLoad(const IntrinsicInst &II,
|
||||
if (!ConstMask)
|
||||
return nullptr;
|
||||
|
||||
// If the mask is all zeros, the "passthru" argument is the result.
|
||||
if (ConstMask->isNullValue())
|
||||
return II.getArgOperand(3);
|
||||
|
||||
// If the mask is all ones, this is a plain vector load of the 1st argument.
|
||||
if (ConstMask->isAllOnesValue()) {
|
||||
Value *LoadPtr = II.getArgOperand(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user