summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-07-29 10:20:22 +0000
committerTim Northover <tnorthover@apple.com>2014-07-29 10:20:22 +0000
commite2239ff3eb5ddfe063f152c6238aab5c049662e0 (patch)
tree5faebf6d25f0130f25fe464c56f17e3093d11de9 /llvm/lib/CodeGen
parent4e13a61413e83dafc5c4c3675c9f2bbdade1dcb7 (diff)
downloadbcm5719-llvm-e2239ff3eb5ddfe063f152c6238aab5c049662e0.tar.gz
bcm5719-llvm-e2239ff3eb5ddfe063f152c6238aab5c049662e0.zip
CodeGenPrep: fall back to MVT::Other if instruction's type isn't an EVT.
The test being performed is just an approximation anyway, so it really shouldn't crash when things don't go entirely as expected. Should fix PR20474. llvm-svn: 214177
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index d5039b2e851..8b1c3ad8eab 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -662,10 +662,13 @@ SinkShiftAndTruncate(BinaryOperator *ShiftI, Instruction *User, ConstantInt *CI,
if (!ISDOpcode)
continue;
- // If the use is actually a legal node, there will not be an implicit
- // truncate.
+ // If the use is actually a legal node, there will not be an
+ // implicit truncate.
+ // FIXME: always querying the result type is just an
+ // approximation; some nodes' legality is determined by the
+ // operand or other means. There's no good way to find out though.
if (TLI.isOperationLegalOrCustom(ISDOpcode,
- EVT::getEVT(TruncUser->getType())))
+ EVT::getEVT(TruncUser->getType(), true)))
continue;
// Don't bother for PHI nodes.
OpenPOWER on IntegriCloud