Skip to content

Commit c2f47d6

Browse files
committed
Shifted Tests to vector types
1 parent f24f251 commit c2f47d6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,6 +2847,8 @@ static SDValue combineFixedwidthToAVG(SDNode *N, SelectionDAG &DAG) {
28472847
if (!N1C || N1C->getAPIntValue() != 1)
28482848
return SDValue();
28492849
EVT VT = And.getValueType();
2850+
if (VT.isVector())
2851+
return SDValue();
28502852
SDLoc DL(N);
28512853
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
28522854
if (!TLI.isOperationLegalOrCustom(ISD::AVGFLOORU, VT))

llvm/test/CodeGen/AArch64/hadd-combine.ll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -859,19 +859,19 @@ define <4 x i32> @urhadd_v4i32(<4 x i32> %x) {
859859
ret <4 x i32> %r
860860
}
861861

862-
define i4 @fixedwidth(i4 %a0, i4 %a1) {
862+
define <4 x i32> @fixedwidth(<4 x i32> %a0, <4 x i32> %a1) {
863863
; CHECK-LABEL: fixedwidth:
864864
; CHECK: // %bb.0:
865-
; CHECK-NEXT: eor w8, w0, w1
866-
; CHECK-NEXT: and w9, w0, w1
867-
; CHECK-NEXT: and w8, w8, #0xe
868-
; CHECK-NEXT: add w0, w9, w8, lsr #1
865+
; CHECK-NEXT: and v2.16b, v0.16b, v1.16b
866+
; CHECK-NEXT: eor v0.16b, v0.16b, v1.16b
867+
; CHECK-NEXT: usra v2.4s, v0.4s, #1
868+
; CHECK-NEXT: mov v0.16b, v2.16b
869869
; CHECK-NEXT: ret
870-
%and = and i4 %a0, %a1
871-
%xor = xor i4 %a0, %a1
872-
%srl = lshr i4 %xor, 1
873-
%res = add i4 %and, %srl
874-
ret i4 %res
870+
%and = and <4 x i32> %a0, %a1
871+
%xor = xor <4 x i32> %a0, %a1
872+
%srl = lshr <4 x i32> %xor, <i32 1,i32 1,i32 1,i32 1>
873+
%res = add <4 x i32> %and, %srl
874+
ret <4 x i32> %res
875875
}
876876

877877
declare <8 x i8> @llvm.aarch64.neon.shadd.v8i8(<8 x i8>, <8 x i8>)

0 commit comments

Comments
 (0)