aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2024-07-27 18:35:25 -0700
committerCraig Topper <craig.topper@sifive.com>2024-07-27 18:35:44 -0700
commitfed94333fd54ec6012386b7b7977c3226ebfd2ac (patch)
treea974669feb4575369713e742ee30996977caf4b4 /llvm/lib
parentbbc457a4f40328452f0c8c8f9b0b5fcb8d286a7b (diff)
downloadllvm-fed94333fd54ec6012386b7b7977c3226ebfd2ac.zip
llvm-fed94333fd54ec6012386b7b7977c3226ebfd2ac.tar.gz
llvm-fed94333fd54ec6012386b7b7977c3226ebfd2ac.tar.bz2
Revert "[DAG] Reducing instructions by better legalization handling of AVGFLOORU for illegal data types (#99913)"
This reverts commit d5521d128494690be66e03a674b9d1181935bf77. The AArch64 test is failing on the bots.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 7fa83a5..6fd23b5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -9379,26 +9379,6 @@ SDValue TargetLowering::expandAVG(SDNode *N, SelectionDAG &DAG) const {
}
}
- // avgflooru(lhs, rhs) -> or(lshr(add(lhs, rhs),1),shl(overflow, typesize-1))
- if (Opc == ISD::AVGFLOORU && VT.isScalarInteger() && !isTypeLegal(VT)) {
- SDValue UAddWithOverflow =
- DAG.getNode(ISD::UADDO, dl, DAG.getVTList(VT, MVT::i1), {RHS, LHS});
-
- SDValue Sum = UAddWithOverflow.getValue(0);
- SDValue Overflow = UAddWithOverflow.getValue(1);
-
- // Right shift the sum by 1
- SDValue One = DAG.getShiftAmountConstant(1, VT, dl);
- SDValue LShrVal = DAG.getNode(ISD::SRL, dl, VT, Sum, One);
-
- SDValue ZeroExtOverflow = DAG.getNode(ISD::ANY_EXTEND, dl, VT, Overflow);
- SDValue OverflowShl =
- DAG.getNode(ISD::SHL, dl, VT, ZeroExtOverflow,
- DAG.getConstant(VT.getScalarSizeInBits() - 1, dl, VT));
-
- return DAG.getNode(ISD::OR, dl, VT, LShrVal, OverflowShl);
- }
-
// avgceils(lhs, rhs) -> sub(or(lhs,rhs),ashr(xor(lhs,rhs),1))
// avgceilu(lhs, rhs) -> sub(or(lhs,rhs),lshr(xor(lhs,rhs),1))
// avgfloors(lhs, rhs) -> add(and(lhs,rhs),ashr(xor(lhs,rhs),1))