aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-27 20:28:29 +0000
committerChris Lattner <sabre@nondot.org>2006-03-27 20:28:29 +0000
commit13fc2f1d270cdedffb72b33621369cee9a2cdaaa (patch)
treed5c95247ef7f8d27fd914349e04aa1abdb0286f2 /lib/CodeGen
parent414e682bac7c7fb618aef6bb0caf8ae501f7a2ed (diff)
downloadexternal_llvm-13fc2f1d270cdedffb72b33621369cee9a2cdaaa.zip
external_llvm-13fc2f1d270cdedffb72b33621369cee9a2cdaaa.tar.gz
external_llvm-13fc2f1d270cdedffb72b33621369cee9a2cdaaa.tar.bz2
Fix legalization of intrinsics with chain and result values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 81139dc..b0a48ee 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -564,8 +564,19 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
TargetLowering::Custom) {
Tmp3 = TLI.LowerOperation(Result, DAG);
if (Tmp3.Val) Result = Tmp3;
- }
- break;
+ }
+
+ if (Result.Val->getNumValues() == 1) break;
+
+ // Must have return value and chain result.
+ assert(Result.Val->getNumValues() == 2 &&
+ "Cannot return more than two values!");
+
+ // Since loads produce two values, make sure to remember that we
+ // legalized both of them.
+ AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
+ AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
+ return Result.getValue(Op.ResNo);
}
case ISD::LOCATION: