summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-12-06 18:38:29 +0000
committerTim Northover <tnorthover@apple.com>2016-12-06 18:38:29 +0000
commit405e25cd6a109551ce483272e16e2095bdb355f6 (patch)
tree355ce9d965f6ae1c197a022238b9123d5fab014d /llvm/lib/CodeGen
parentd0ccdb46b9c1f6324e7bb77e1fb7d93fc4b77775 (diff)
downloadbcm5719-llvm-405e25cd6a109551ce483272e16e2095bdb355f6.tar.gz
bcm5719-llvm-405e25cd6a109551ce483272e16e2095bdb355f6.zip
GlobalISel: stop the legalizer from trying to handle oddly-sized types.
It'll almost immediately fail because it always tries to half/double the size until it finds a legal one. Unfortunately, this triggers an assertion preventing the DAG fallback from being possible. llvm-svn: 288834
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
index ebbed12943b..2b99a555858 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
@@ -71,6 +71,11 @@ LegalizerInfo::getAction(const InstrAspect &Aspect) const {
// These *have* to be implemented for now, they're the fundamental basis of
// how everything else is transformed.
+ // Nothing is going to go well with types that aren't a power of 2 yet, so
+ // don't even try because we might make things worse.
+ if (!isPowerOf2_64(Aspect.Type.getSizeInBits()))
+ return std::make_pair(Unsupported, LLT());
+
// FIXME: the long-term plan calls for expansion in terms of load/store (if
// they're not legal).
if (Aspect.Opcode == TargetOpcode::G_SEQUENCE ||
OpenPOWER on IntegriCloud