[Mlir-commits] [mlir] Rewrites for I2 to I8 signed and unsigned extension (PR #121298)
Han-Chung Wang
llvmlistbot at llvm.org
Mon Jan 6 23:46:23 PST 2025
https://github.com/hanhanW requested changes to this pull request.
The logic of signed and unsigned conversion is very similar. The only difference is that they use different `extractNBits*` functions. I think we can pass the function to the method, so we no longer need to duplicate the logic. E.g.,
```
using ExtractNBitsFn = std::function<Value(PatternRewriter&, Location, Value, int, int)>;
static Value rewriteI4ToI8(PatternRewriter &rewriter, Location loc,
Value srcValue, ExtractNBitsFn extFn) {
// ...
Value low = extFn(rewriter, loc, i8Vector, 0, 4);
Value high = extFn(rewriter, loc, i8Vector, 4, 4);
// ...
}
```
https://github.com/llvm/llvm-project/pull/121298
More information about the Mlir-commits
mailing list