Skip to content

Commit da46244

Browse files
committed
Revert "[LegalizeVectorOps] Make the AArch64 hack in ExpandFNEG more specific."
This reverts commit 884ff9e. Regression was reported in Halide for arm32.
1 parent 100b34b commit da46244

File tree

4 files changed

+1009
-560
lines changed

4 files changed

+1009
-560
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,13 +1804,9 @@ SDValue VectorLegalizer::ExpandFNEG(SDNode *Node) {
18041804
EVT VT = Node->getValueType(0);
18051805
EVT IntVT = VT.changeVectorElementTypeToInteger();
18061806

1807-
if (!TLI.isOperationLegalOrCustom(ISD::XOR, IntVT))
1808-
return SDValue();
1809-
1810-
// FIXME: This is to force unrolling v1f64 vectors for AArch64.
1811-
if (VT.isFixedLengthVector() && VT.getVectorNumElements() == 1 &&
1812-
!TLI.isOperationLegalOrCustom(ISD::FSUB, VT) &&
1813-
TLI.isOperationLegal(ISD::FNEG, VT.getVectorElementType()))
1807+
// FIXME: The FSUB check is here to force unrolling v1f64 vectors on AArch64.
1808+
if (!TLI.isOperationLegalOrCustom(ISD::XOR, IntVT) ||
1809+
!(TLI.isOperationLegalOrCustom(ISD::FSUB, VT) || VT.isScalableVector()))
18141810
return SDValue();
18151811

18161812
SDLoc DL(Node);

llvm/test/CodeGen/NVPTX/f16-instructions.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,8 @@ define half @test_neg_f16(half noundef %arg) #0 {
11921192
; CHECK-LABEL: test_neg_f16x2(
11931193
; CHECK-F16-NOFTZ: neg.f16x2
11941194
; CHECK-F16-FTZ: neg.ftz.f16x2
1195-
; CHECK-NOF16: xor.b32 %r{{.*}}, %r{{.*}}, -2147450880
1195+
; CHECK-NOF16: xor.b16 %rs{{.*}}, %rs{{.*}}, -32768
1196+
; CHECK-NOF16: xor.b16 %rs{{.*}}, %rs{{.*}}, -32768
11961197
define <2 x half> @test_neg_f16x2(<2 x half> noundef %arg) #0 {
11971198
%res = fneg <2 x half> %arg
11981199
ret <2 x half> %res

0 commit comments

Comments
 (0)