mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-25 05:15:58 +00:00
80-cols; NFC
llvm-svn: 225700
This commit is contained in:
parent
8d76acfd64
commit
8a3043d80f
@ -2106,15 +2106,15 @@ bool GVN::propagateEquality(Value *LHS, Value *RHS,
|
||||
std::swap(LHS, RHS);
|
||||
assert((isa<Argument>(LHS) || isa<Instruction>(LHS)) && "Unexpected value!");
|
||||
|
||||
// If there is no obvious reason to prefer the left-hand side over the right-
|
||||
// hand side, ensure the longest lived term is on the right-hand side, so the
|
||||
// shortest lived term will be replaced by the longest lived. This tends to
|
||||
// expose more simplifications.
|
||||
// If there is no obvious reason to prefer the left-hand side over the
|
||||
// right-hand side, ensure the longest lived term is on the right-hand side,
|
||||
// so the shortest lived term will be replaced by the longest lived.
|
||||
// This tends to expose more simplifications.
|
||||
uint32_t LVN = VN.lookup_or_add(LHS);
|
||||
if ((isa<Argument>(LHS) && isa<Argument>(RHS)) ||
|
||||
(isa<Instruction>(LHS) && isa<Instruction>(RHS))) {
|
||||
// Move the 'oldest' value to the right-hand side, using the value number as
|
||||
// a proxy for age.
|
||||
// Move the 'oldest' value to the right-hand side, using the value number
|
||||
// as a proxy for age.
|
||||
uint32_t RVN = VN.lookup_or_add(RHS);
|
||||
if (LVN < RVN) {
|
||||
std::swap(LHS, RHS);
|
||||
@ -2143,10 +2143,10 @@ bool GVN::propagateEquality(Value *LHS, Value *RHS,
|
||||
NumGVNEqProp += NumReplacements;
|
||||
}
|
||||
|
||||
// Now try to deduce additional equalities from this one. For example, if the
|
||||
// known equality was "(A != B)" == "false" then it follows that A and B are
|
||||
// equal in the scope. Only boolean equalities with an explicit true or false
|
||||
// RHS are currently supported.
|
||||
// Now try to deduce additional equalities from this one. For example, if
|
||||
// the known equality was "(A != B)" == "false" then it follows that A and B
|
||||
// are equal in the scope. Only boolean equalities with an explicit true or
|
||||
// false RHS are currently supported.
|
||||
if (!RHS->getType()->isIntegerTy(1))
|
||||
// Not a boolean equality - bail out.
|
||||
continue;
|
||||
@ -2188,9 +2188,9 @@ bool GVN::propagateEquality(Value *LHS, Value *RHS,
|
||||
// If "A >= B" is known true, replace "A < B" with false everywhere.
|
||||
CmpInst::Predicate NotPred = Cmp->getInversePredicate();
|
||||
Constant *NotVal = ConstantInt::get(Cmp->getType(), isKnownFalse);
|
||||
// Since we don't have the instruction "A < B" immediately to hand, work out
|
||||
// the value number that it would have and use that to find an appropriate
|
||||
// instruction (if any).
|
||||
// Since we don't have the instruction "A < B" immediately to hand, work
|
||||
// out the value number that it would have and use that to find an
|
||||
// appropriate instruction (if any).
|
||||
uint32_t NextNum = VN.getNextUnusedValueNumber();
|
||||
uint32_t Num = VN.lookup_or_add_cmp(Cmp->getOpcode(), NotPred, Op0, Op1);
|
||||
// If the number we were assigned was brand new then there is no point in
|
||||
|
Loading…
x
Reference in New Issue
Block a user