[Mlir-commits] [mlir] 5afd86b - [MLIR] Add helper functions for common integer types

Frederik Gossen llvmlistbot at llvm.org
Tue May 19 04:43:17 PDT 2020


Author: Frederik Gossen
Date: 2020-05-19T11:42:41Z
New Revision: 5afd86b0de729b78f1aa1b2fb4faf755e1de90de

URL: https://github.com/llvm/llvm-project/commit/5afd86b0de729b78f1aa1b2fb4faf755e1de90de
DIFF: https://github.com/llvm/llvm-project/commit/5afd86b0de729b78f1aa1b2fb4faf755e1de90de.diff

LOG: [MLIR] Add helper functions for common integer types

Add helper functions for 32-bit and 64-bit integer types.

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

Added: 
    

Modified: 
    mlir/include/mlir/IR/Builders.h
    mlir/lib/IR/Builders.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/Builders.h b/mlir/include/mlir/IR/Builders.h
index d4dc8041d3b1..4ade6bb1e439 100644
--- a/mlir/include/mlir/IR/Builders.h
+++ b/mlir/include/mlir/IR/Builders.h
@@ -69,6 +69,8 @@ class Builder {
   IndexType getIndexType();
 
   IntegerType getI1Type();
+  IntegerType getI32Type();
+  IntegerType getI64Type();
   IntegerType getIntegerType(unsigned width);
   IntegerType getIntegerType(unsigned width, bool isSigned);
   FunctionType getFunctionType(ArrayRef<Type> inputs, ArrayRef<Type> results);

diff  --git a/mlir/lib/IR/Builders.cpp b/mlir/lib/IR/Builders.cpp
index 4cb4a5c2962b..a72e03c739e3 100644
--- a/mlir/lib/IR/Builders.cpp
+++ b/mlir/lib/IR/Builders.cpp
@@ -54,6 +54,10 @@ IndexType Builder::getIndexType() { return IndexType::get(context); }
 
 IntegerType Builder::getI1Type() { return IntegerType::get(1, context); }
 
+IntegerType Builder::getI32Type() { return IntegerType::get(32, context); }
+
+IntegerType Builder::getI64Type() { return IntegerType::get(64, context); }
+
 IntegerType Builder::getIntegerType(unsigned width) {
   return IntegerType::get(width, context);
 }


        


More information about the Mlir-commits mailing list