summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-12-05 21:40:33 +0000
committerTim Northover <tnorthover@apple.com>2016-12-05 21:40:33 +0000
commit6ad7b9f83712f171acec4d55c3b295c15cb3037c (patch)
tree1a31d75008ecec521f6644623f285f3affddcb17 /llvm/lib/CodeGen/GlobalISel
parentc38860b0d22c205e95f5c80970c6daeec362256f (diff)
downloadbcm5719-llvm-6ad7b9f83712f171acec4d55c3b295c15cb3037c.tar.gz
bcm5719-llvm-6ad7b9f83712f171acec4d55c3b295c15cb3037c.zip
GlobalISel: improve translation fallback for constants.
Returning 0 (NoReg) from getOrCreateVReg leads to unexpected situations later in the translation. It's better to return a valid (if undefined) register and let the rest of the instruction carry on as planned. llvm-svn: 288709
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index e8d1ce0586d..a580e745171 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -74,7 +74,7 @@ unsigned IRTranslator::getOrCreateVReg(const Value &Val) {
if (!TPC->isGlobalISelAbortEnabled()) {
MIRBuilder.getMF().getProperties().set(
MachineFunctionProperties::Property::FailedISel);
- return 0;
+ return VReg;
}
reportTranslationError(Val, "unable to translate constant");
}
OpenPOWER on IntegriCloud