llvm-project/mlir/lib/Transforms
Lei Zhang 35b685270b [mlir] Add a signedness semantics bit to IntegerType
Thus far IntegerType has been signless: a value of IntegerType does
not have a sign intrinsically and it's up to the specific operation
to decide how to interpret those bits. For example, std.addi does
two's complement arithmetic, and std.divis/std.diviu treats the first
bit as a sign.

This design choice was made some time ago when we did't have lots
of dialects and dialects were more rigid. Today we have much more
extensible infrastructure and different dialect may want different
modelling over integer signedness. So while we can say we want
signless integers in the standard dialect, we cannot dictate for
others. Requiring each dialect to model the signedness semantics
with another set of custom types is duplicating the functionality
everywhere, considering the fundamental role integer types play.

This CL extends the IntegerType with a signedness semantics bit.
This gives each dialect an option to opt in signedness semantics
if that's what they want and helps code sharing. The parser is
modified to recognize `si[1-9][0-9]*` and `ui[1-9][0-9]*` as
signed and unsigned integer types, respectively, leaving the
original `i[1-9][0-9]*` to continue to mean no indication over
signedness semantics. All existing dialects are not affected (yet)
as this is a feature to opt in.

More discussions can be found at:

https://groups.google.com/a/tensorflow.org/d/msg/mlir/XmkV8HOPWpo/7O4X0Nb_AQAJ

Differential Revision: https://reviews.llvm.org/D72533
2020-02-21 09:16:54 -05:00
..
Utils [mlir][NFC] Fix 'gatherLoops' utility 2020-02-19 10:48:14 -08:00
AffineDataCopyGeneration.cpp [mlir] Add MemRef filter to affine data copy optimization 2020-02-14 13:41:45 -08:00
AffineLoopInvariantCodeMotion.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
CMakeLists.txt [mlir] Add support for generating debug locations from intermediate levels of the IR. 2020-02-08 15:11:29 -08:00
CSE.cpp [mlir][NFC] Update Operation::getResultTypes to use ArrayRef<Type> instead of iterator_range. 2020-01-27 19:57:48 -08:00
Canonicalizer.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
DialectConversion.cpp [mlir] Refactor TypeConverter to add conversions without inheritance 2020-02-18 16:17:48 -08:00
Inliner.cpp [mlir] Add a utility method on CallOpInterface for resolving the callable. 2020-02-08 10:44:29 -08:00
LocationSnapshot.cpp [mlir] Add support for generating debug locations from intermediate levels of the IR. 2020-02-08 15:11:29 -08:00
LoopCoalescing.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
LoopFusion.cpp [mlir] Add a signedness semantics bit to IntegerType 2020-02-21 09:16:54 -05:00
LoopInvariantCodeMotion.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
LoopTiling.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
LoopUnroll.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
LoopUnrollAndJam.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
MemRefDataFlowOpt.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
OpStats.cpp Remove static registration for dialects, and the "alwayslink" hack for passes 2020-02-12 09:13:02 +00:00
PipelineDataTransfer.cpp [mlir] Add MemRefTypeBuilder and refactor some MemRefType::get(). 2020-01-30 23:30:46 -08:00
SimplifyAffineStructures.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
StripDebugInfo.cpp [mlir] Add support for basic location translation to LLVM. 2020-02-05 17:41:51 -08:00
SymbolDCE.cpp [mlir] Add a DCE pass for dead symbols. 2020-01-27 23:29:30 -08:00
Vectorize.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
ViewOpGraph.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ViewRegionGraph.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00