mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-28 06:00:28 +00:00
Simplify code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
132a34981f
commit
f94a2935ee
@ -5418,17 +5418,9 @@ UpdateNodeOperands(SDNode *N, ArrayRef<SDValue> Ops) {
|
||||
assert(N->getNumOperands() == NumOps &&
|
||||
"Update with wrong number of operands");
|
||||
|
||||
// Check to see if there is no change.
|
||||
bool AnyChange = false;
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
if (Ops[i] != N->getOperand(i)) {
|
||||
AnyChange = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// No operands changed, just return the input node.
|
||||
if (!AnyChange) return N;
|
||||
// If no operands changed just return the input node.
|
||||
if (std::equal(Ops.begin(), Ops.end(), N->op_begin()))
|
||||
return N;
|
||||
|
||||
// See if the modified node already exists.
|
||||
void *InsertPos = nullptr;
|
||||
|
@ -1215,11 +1215,9 @@ ConstantExpr::getWithOperandReplaced(unsigned OpNo, Constant *Op) const {
|
||||
Constant *ConstantExpr::getWithOperands(ArrayRef<Constant *> Ops, Type *Ty,
|
||||
bool OnlyIfReduced) const {
|
||||
assert(Ops.size() == getNumOperands() && "Operand count mismatch!");
|
||||
bool AnyChange = Ty != getType();
|
||||
for (unsigned i = 0; i != Ops.size(); ++i)
|
||||
AnyChange |= Ops[i] != getOperand(i);
|
||||
|
||||
if (!AnyChange) // No operands changed, return self.
|
||||
// If no operands changed return self.
|
||||
if (Ty == getType() && std::equal(Ops.begin(), Ops.end(), op_begin()))
|
||||
return const_cast<ConstantExpr*>(this);
|
||||
|
||||
Type *OnlyIfReducedTy = OnlyIfReduced ? Ty : nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user