Scalable Vector IR Type with further LTO fixes

Reintroduces the scalable vector IR type from D32530, after it was reverted
a couple of times due to increasing chromium LTO build times. This latest
incarnation removes the walk over aggregate types from the verifier entirely,
in favor of rejecting scalable vectors in the isValidElementType methods in
ArrayType and StructType. This removes the 70% degradation observed with
the second repro tarball from PR42210.

Reviewers: thakis, hans, rengolin, sdesmalen

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D64079

llvm-svn: 365203
diff --git a/llvm/test/Other/scalable-vector-struct.ll b/llvm/test/Other/scalable-vector-struct.ll
new file mode 100644
index 0000000..44a8c5f
--- /dev/null
+++ b/llvm/test/Other/scalable-vector-struct.ll
@@ -0,0 +1,8 @@
+; RUN: not opt -S -verify < %s 2>&1 | FileCheck %s
+
+;; Structs cannot contain scalable vectors; make sure we detect them even
+;; when nested inside other aggregates.
+
+%ty = type [2 x { i32, <vscale x 1 x i32> }]
+; CHECK: error: invalid element type for struct
+; CHECK: %ty = type [2 x { i32, <vscale x 1 x i32> }]