-
Notifications
You must be signed in to change notification settings - Fork 0
/
6_0_bug1381.patch
37 lines (35 loc) · 1.7 KB
/
6_0_bug1381.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This patch is required to fix #1381.
# Extend inputs with elements smaller than i32 to sint_to_fp/uint_to_fp
# before type legalization. In this particular case extending bool to 32 bits.
Index: lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp (revision 348642)
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp (working copy)
@@ -36768,11 +36768,11 @@
SDValue Op0 = N->getOperand(0);
EVT VT = N->getValueType(0);
EVT InVT = Op0.getValueType();
- EVT InSVT = InVT.getScalarType();
+ // UINT_TO_FP(vXi1) -> SINT_TO_FP(SEXT(vXi1 to vXi32))
// UINT_TO_FP(vXi8) -> SINT_TO_FP(ZEXT(vXi8 to vXi32))
// UINT_TO_FP(vXi16) -> SINT_TO_FP(ZEXT(vXi16 to vXi32))
- if (InVT.isVector() && (InSVT == MVT::i8 || InSVT == MVT::i16)) {
+ if (InVT.isVector() && InVT.getScalarSizeInBits() < 32) {
SDLoc dl(N);
EVT DstVT = EVT::getVectorVT(*DAG.getContext(), MVT::i32,
InVT.getVectorNumElements());
@@ -36802,14 +36802,11 @@
SDValue Op0 = N->getOperand(0);
EVT VT = N->getValueType(0);
EVT InVT = Op0.getValueType();
- EVT InSVT = InVT.getScalarType();
// SINT_TO_FP(vXi1) -> SINT_TO_FP(SEXT(vXi1 to vXi32))
// SINT_TO_FP(vXi8) -> SINT_TO_FP(SEXT(vXi8 to vXi32))
// SINT_TO_FP(vXi16) -> SINT_TO_FP(SEXT(vXi16 to vXi32))
- if (InVT.isVector() &&
- (InSVT == MVT::i8 || InSVT == MVT::i16 ||
- (InSVT == MVT::i1 && !DAG.getTargetLoweringInfo().isTypeLegal(InVT)))) {
+ if (InVT.isVector() && InVT.getScalarSizeInBits() < 32) {
SDLoc dl(N);
EVT DstVT = EVT::getVectorVT(*DAG.getContext(), MVT::i32,
InVT.getVectorNumElements());