Skip to content

Commit 0ce9319

Browse files
author
Krzysztof Parzyszek
committed
[Hexagon] Fix type in HexagonTargetLowering::ReplaceNodeResults
llvm-svn: 371083
1 parent f9f31ce commit 0ce9319

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

llvm/lib/Target/Hexagon/HexagonISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2902,7 +2902,8 @@ HexagonTargetLowering::ReplaceNodeResults(SDNode *N,
29022902
if (N->getValueType(0) == MVT::i8) {
29032903
SDValue P = getInstr(Hexagon::C2_tfrpr, dl, MVT::i32,
29042904
N->getOperand(0), DAG);
2905-
Results.push_back(P);
2905+
SDValue T = DAG.getAnyExtOrTrunc(P, dl, MVT::i8);
2906+
Results.push_back(T);
29062907
}
29072908
break;
29082909
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; RUN: llc -march=hexagon < %s | FileCheck %s
2+
; REQUIRES: asserts
3+
4+
; Check that this doesn't crash.
5+
; CHECK-LABEL: foo:
6+
; CHECK: p[[P:[0-3]]] = vcmpb.eq
7+
; CHECK: r[[R:[0-9]+]] = p[[P]]
8+
; CHECK: and(r[[R]],#32)
9+
10+
define i32 @foo(<8 x i8> %a0, <8 x i8> %a1) #0 {
11+
%v0 = icmp eq <8 x i8> %a0, %a1
12+
%v1 = bitcast <8 x i1> %v0 to i8
13+
%v2 = and i8 %v1, 32
14+
%v3 = zext i8 %v2 to i32
15+
ret i32 %v3
16+
}
17+
18+
attributes #0 = { readnone nounwind }

0 commit comments

Comments
 (0)