[Mlir-commits] [mlir] [MLIR][ROCDL] Add conversion for gpu.subgroup_id to ROCDL (PR #136405)
Jakub Kuderski
llvmlistbot at llvm.org
Wed Apr 23 08:07:04 PDT 2025
================
@@ -80,6 +80,26 @@ static constexpr StringLiteral amdgcnDataLayout =
"64-S32-A5-G1-ni:7:8:9";
namespace {
+
+// Truncate or extend the result depending on the index bitwidth specified
+// by the LLVMTypeConverter options.
+static Value truncOrExtToLLVMType(ConversionPatternRewriter &rewriter,
+ Location loc, Value value,
+ const LLVMTypeConverter &converter) {
+ int64_t intWidth = cast<IntegerType>(value.getType()).getWidth();
+ int64_t indexBitwidth = converter.getIndexTypeBitwidth();
+ auto indexBitwidthType =
+ IntegerType::get(rewriter.getContext(), converter.getIndexTypeBitwidth());
+ // TODO: use <=> in C++20
----------------
kuhar wrote:
```suggestion
// TODO: use <=> in C++20.
```
Nit: the llvm coding standards mention using proper casing and punctuation in comments: https://llvm.org/docs/CodingStandards.html#commenting
https://github.com/llvm/llvm-project/pull/136405
More information about the Mlir-commits
mailing list