-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy path0046-LegalizeDAG-promote-PREFETCH-operands-to-native-inte.patch
56 lines (48 loc) · 2.38 KB
/
0046-LegalizeDAG-promote-PREFETCH-operands-to-native-inte.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alex Bradbury <[email protected]>
Subject: [LegalizeDAG] promote PREFETCH operands to native integer width
---
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 14 ++++++++++++++
lib/CodeGen/SelectionDAG/LegalizeTypes.h | 1 +
2 files changed, 15 insertions(+)
diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 0aa1b58cbf8..c90842db604 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -958,6 +958,9 @@ bool DAGTypeLegalizer::PromoteIntegerOperand(SDNode *N, unsigned OpNo) {
case ISD::FRAMEADDR:
case ISD::RETURNADDR: Res = PromoteIntOp_RETURNADDR(N, OpNo); break;
+ case ISD::PREFETCH:
+ Res = PromoteIntOp_PREFETCH(N, OpNo);
+ break;
}
// If the result is null, the sub-method took care of registering results etc.
@@ -1346,6 +1349,17 @@ SDValue DAGTypeLegalizer::PromoteIntOp_RETURNADDR(SDNode *N, unsigned OpNo) {
return SDValue(DAG.UpdateNodeOperands(N, Op), 0);
}
+SDValue DAGTypeLegalizer::PromoteIntOp_PREFETCH(SDNode *N, unsigned OpNo) {
+ // Promote the rw, locality, and cache type arguments to a supported integer
+ // width.
+ SDValue Op2 = GetPromotedInteger(N->getOperand(2));
+ SDValue Op3 = GetPromotedInteger(N->getOperand(3));
+ SDValue Op4 = GetPromotedInteger(N->getOperand(4));
+ return SDValue(DAG.UpdateNodeOperands(N, N->getOperand(0), N->getOperand(1),
+ Op2, Op3, Op4),
+ 0);
+}
+
//===----------------------------------------------------------------------===//
// Integer Result Expansion
//===----------------------------------------------------------------------===//
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/lib/CodeGen/SelectionDAG/LegalizeTypes.h
index fca50dc6f53..5c2a5c4dddb 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.h
@@ -311,6 +311,7 @@ private:
SDValue PromoteIntOp_MGATHER(MaskedGatherSDNode *N, unsigned OpNo);
SDValue PromoteIntOp_ADDSUBCARRY(SDNode *N, unsigned OpNo);
SDValue PromoteIntOp_RETURNADDR(SDNode *N, unsigned OpNo);
+ SDValue PromoteIntOp_PREFETCH(SDNode *N, unsigned OpNo);
void PromoteSetCCOperands(SDValue &LHS,SDValue &RHS, ISD::CondCode Code);
--
2.16.2