[Mlir-commits] [mlir] [MLIR][LLVM][Mem2Reg] Extends support for partial stores (PR #89740)
Tobias Gysi
llvmlistbot at llvm.org
Wed Apr 24 02:30:06 PDT 2024
================
@@ -196,48 +229,118 @@ static Value createConversionSequence(RewriterBase &rewriter, Location loc,
return rewriter.createOrFold<LLVM::AddrSpaceCastOp>(loc, targetType,
srcValue);
- IntegerType valueSizeInteger =
- rewriter.getIntegerType(srcTypeSize * kBitsInByte);
- Value replacement = srcValue;
+ // For all other castable types, casting through integers is necessary.
+ Value replacement = castToSameSizedInt(rewriter, loc, srcValue, dataLayout);
+ return castIntValueToSameSizedType(rewriter, loc, replacement, targetType);
+}
+
+/// Constructs operations that convert `srcValue` into a new value of type
+/// `targetType`. Performs bitlevel extraction if the source type is larger than
----------------
gysit wrote:
```suggestion
/// `targetType`. Performs bit-level extraction if the source type is larger than
```
nit: I believe it is two words
https://github.com/llvm/llvm-project/pull/89740
More information about the Mlir-commits
mailing list