Skip to content

Commit 5da361a

Browse files
committed
[InstSimplify] fix formatting; NFC
llvm-svn: 329736
1 parent 9f7b5cc commit 5da361a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static bool isSameCompare(Value *V, CmpInst::Predicate Pred, Value *LHS,
9090
}
9191

9292
/// Does the given value dominate the specified phi node?
93-
static bool ValueDominatesPHI(Value *V, PHINode *P, const DominatorTree *DT) {
93+
static bool valueDominatesPHI(Value *V, PHINode *P, const DominatorTree *DT) {
9494
Instruction *I = dyn_cast<Instruction>(V);
9595
if (!I)
9696
// Arguments and constants dominate all instructions.
@@ -99,7 +99,7 @@ static bool ValueDominatesPHI(Value *V, PHINode *P, const DominatorTree *DT) {
9999
// If we are processing instructions (and/or basic blocks) that have not been
100100
// fully added to a function, the parent nodes may still be null. Simply
101101
// return the conservative answer in these cases.
102-
if (!I->getParent() || !P->getParent() || !I->getParent()->getParent())
102+
if (!I->getParent() || !P->getParent() || !I->getFunction())
103103
return false;
104104

105105
// If we have a DominatorTree then do a precise test.
@@ -108,7 +108,7 @@ static bool ValueDominatesPHI(Value *V, PHINode *P, const DominatorTree *DT) {
108108

109109
// Otherwise, if the instruction is in the entry block and is not an invoke,
110110
// then it obviously dominates all phi nodes.
111-
if (I->getParent() == &I->getParent()->getParent()->getEntryBlock() &&
111+
if (I->getParent() == &I->getFunction()->getEntryBlock() &&
112112
!isa<InvokeInst>(I))
113113
return true;
114114

@@ -443,13 +443,13 @@ static Value *ThreadBinOpOverPHI(Instruction::BinaryOps Opcode, Value *LHS,
443443
if (isa<PHINode>(LHS)) {
444444
PI = cast<PHINode>(LHS);
445445
// Bail out if RHS and the phi may be mutually interdependent due to a loop.
446-
if (!ValueDominatesPHI(RHS, PI, Q.DT))
446+
if (!valueDominatesPHI(RHS, PI, Q.DT))
447447
return nullptr;
448448
} else {
449449
assert(isa<PHINode>(RHS) && "No PHI instruction operand!");
450450
PI = cast<PHINode>(RHS);
451451
// Bail out if LHS and the phi may be mutually interdependent due to a loop.
452-
if (!ValueDominatesPHI(LHS, PI, Q.DT))
452+
if (!valueDominatesPHI(LHS, PI, Q.DT))
453453
return nullptr;
454454
}
455455

@@ -490,7 +490,7 @@ static Value *ThreadCmpOverPHI(CmpInst::Predicate Pred, Value *LHS, Value *RHS,
490490
PHINode *PI = cast<PHINode>(LHS);
491491

492492
// Bail out if RHS and the phi may be mutually interdependent due to a loop.
493-
if (!ValueDominatesPHI(RHS, PI, Q.DT))
493+
if (!valueDominatesPHI(RHS, PI, Q.DT))
494494
return nullptr;
495495

496496
// Evaluate the BinOp on the incoming phi values.
@@ -3986,7 +3986,7 @@ static Value *SimplifyPHINode(PHINode *PN, const SimplifyQuery &Q) {
39863986
// instruction, we cannot return X as the result of the PHI node unless it
39873987
// dominates the PHI block.
39883988
if (HasUndefInput)
3989-
return ValueDominatesPHI(CommonValue, PN, Q.DT) ? CommonValue : nullptr;
3989+
return valueDominatesPHI(CommonValue, PN, Q.DT) ? CommonValue : nullptr;
39903990

39913991
return CommonValue;
39923992
}

0 commit comments

Comments
 (0)