Skip to content

Commit 678851b

Browse files
committed
Reduce num of phi uses needed to 1
Previously when we were checking for we were matching the or it was also a use on the phi
1 parent 7b4100d commit 678851b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ bool RISCVCodeGenPrepare::widenVPMerge(IntrinsicInst &II) {
146146
return false;
147147

148148
auto *Phi = dyn_cast<PHINode>(PhiV);
149-
if (!Phi || Phi->getNumUses() > 2 || Phi->getNumIncomingValues() != 2 ||
149+
if (!Phi || !Phi->hasOneUse() || Phi->getNumIncomingValues() != 2 ||
150150
!match(Phi->getIncomingValue(0), m_Zero()) ||
151151
Phi->getIncomingValue(1) != &II)
152152
return false;

0 commit comments

Comments
 (0)