Eliminate "primitive" types from being a thing, splitting them into FloatType
and OtherType. Other type is now the thing that holds AffineInt, Control,
eventually Resource, Variant, String, etc. FloatType holds the floating point
types, and allows convenient query of isa<FloatType>().
This fixes issues where we allowed control to be the element type of tensor,
memref, vector. At the same time, ban AffineInt from being an element of a
vector/memref/tensor as well since we don't need it.
I updated the spec to match this as well.
PiperOrigin-RevId: 206361942
diff --git a/lib/IR/Builders.cpp b/lib/IR/Builders.cpp
index a3ad431..e7cb9cb 100644
--- a/lib/IR/Builders.cpp
+++ b/lib/IR/Builders.cpp
@@ -35,21 +35,17 @@
// Types.
//===----------------------------------------------------------------------===//
-PrimitiveType *Builder::getAffineIntType() {
- return Type::getAffineInt(context);
-}
+FloatType *Builder::getBF16Type() { return Type::getBF16(context); }
-PrimitiveType *Builder::getBF16Type() { return Type::getBF16(context); }
+FloatType *Builder::getF16Type() { return Type::getF16(context); }
-PrimitiveType *Builder::getF16Type() { return Type::getF16(context); }
+FloatType *Builder::getF32Type() { return Type::getF32(context); }
-PrimitiveType *Builder::getF32Type() { return Type::getF32(context); }
+FloatType *Builder::getF64Type() { return Type::getF64(context); }
-PrimitiveType *Builder::getF64Type() { return Type::getF64(context); }
+OtherType *Builder::getAffineIntType() { return Type::getAffineInt(context); }
-PrimitiveType *Builder::getTFControlType() {
- return Type::getTFControl(context);
-}
+OtherType *Builder::getTFControlType() { return Type::getTFControl(context); }
IntegerType *Builder::getIntegerType(unsigned width) {
return Type::getInteger(width, context);