Skip to content

Commit 319ed77

Browse files
author
himadhith
committed
Reusing EVT VecVT
1 parent 64c2768 commit 319ed77

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4570,23 +4570,21 @@ bool PPCDAGToDAGISel::trySETCC(SDNode *N) {
45704570
if (Subtarget->hasSPE())
45714571
return false;
45724572

4573+
EVT VecVT = LHS.getValueType();
45734574
// Optimize 'Not equal to zero-vector' comparisons to 'Greater than or
45744575
// less than' operators.
45754576
// Example: Consider k to be any non-zero positive value.
45764577
// * for k != 0, change SETNE to SETUGT (k > 0)
45774578
// * for 0 != k, change SETNE to SETULT (0 < k)
45784579
if (CC == ISD::SETNE) {
4579-
EVT VT = LHS.getValueType();
4580-
45814580
// Only optimize for integer types (avoid FP completely)
4582-
if (VT.getVectorElementType().isInteger()) {
4581+
if (VecVT.getVectorElementType().isInteger()) {
45834582
if (ISD::isBuildVectorAllZeros(RHS.getNode()))
45844583
CC = ISD::SETUGT;
45854584
else if (ISD::isBuildVectorAllZeros(LHS.getNode()))
45864585
CC = ISD::SETULT;
45874586
}
45884587
}
4589-
EVT VecVT = LHS.getValueType();
45904588
bool Swap, Negate;
45914589
unsigned int VCmpInst =
45924590
getVCmpInst(VecVT.getSimpleVT(), CC, Subtarget->hasVSX(), Swap, Negate);

0 commit comments

Comments
 (0)