Skip to content

Commit f119151

Browse files
authored
IVDescriptors: improve readability of a function (NFC) (#106219)
Avoid dereferencing operand to llvm::isa.
1 parent 3d53212 commit f119151

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/lib/Analysis/IVDescriptors.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -734,13 +734,12 @@ RecurrenceDescriptor::isConditionalRdxPattern(RecurKind Kind, Instruction *I) {
734734
Value *FalseVal = SI->getFalseValue();
735735
// Handle only when either of operands of select instruction is a PHI
736736
// node for now.
737-
if ((isa<PHINode>(*TrueVal) && isa<PHINode>(*FalseVal)) ||
738-
(!isa<PHINode>(*TrueVal) && !isa<PHINode>(*FalseVal)))
737+
if ((isa<PHINode>(TrueVal) && isa<PHINode>(FalseVal)) ||
738+
(!isa<PHINode>(TrueVal) && !isa<PHINode>(FalseVal)))
739739
return InstDesc(false, I);
740740

741-
Instruction *I1 =
742-
isa<PHINode>(*TrueVal) ? dyn_cast<Instruction>(FalseVal)
743-
: dyn_cast<Instruction>(TrueVal);
741+
Instruction *I1 = isa<PHINode>(TrueVal) ? dyn_cast<Instruction>(FalseVal)
742+
: dyn_cast<Instruction>(TrueVal);
744743
if (!I1 || !I1->isBinaryOp())
745744
return InstDesc(false, I);
746745

@@ -754,8 +753,8 @@ RecurrenceDescriptor::isConditionalRdxPattern(RecurKind Kind, Instruction *I) {
754753
(m_Mul(m_Value(Op1), m_Value(Op2)).match(I1))))
755754
return InstDesc(false, I);
756755

757-
Instruction *IPhi = isa<PHINode>(*Op1) ? dyn_cast<Instruction>(Op1)
758-
: dyn_cast<Instruction>(Op2);
756+
Instruction *IPhi = isa<PHINode>(Op1) ? dyn_cast<Instruction>(Op1)
757+
: dyn_cast<Instruction>(Op2);
759758
if (!IPhi || IPhi != FalseVal)
760759
return InstDesc(false, I);
761760

0 commit comments

Comments
 (0)