[mlir][LLVM] Plumb range attributes on parameters and results through (#117801)
We've had the ability to define LLVM's `range` attribute through #llvm.constant_range for some time, and have used this for some GPU intrinsics. This commit allows using `llvm.range` as a parameter or result attribute on function declarations and definitions.
This commit is contained in:
committed by
GitHub
parent
1bc9de2474
commit
92a15dd748
@@ -1581,7 +1581,12 @@ ModuleTranslation::convertParameterAttrs(LLVMFuncOp func, int argIdx,
|
||||
.Case<IntegerAttr>([&](auto intAttr) {
|
||||
attrBuilder.addRawIntAttr(llvmKind, intAttr.getInt());
|
||||
})
|
||||
.Case<UnitAttr>([&](auto) { attrBuilder.addAttribute(llvmKind); });
|
||||
.Case<UnitAttr>([&](auto) { attrBuilder.addAttribute(llvmKind); })
|
||||
.Case<LLVM::ConstantRangeAttr>([&](auto rangeAttr) {
|
||||
attrBuilder.addConstantRangeAttr(
|
||||
llvmKind, llvm::ConstantRange(rangeAttr.getLower(),
|
||||
rangeAttr.getUpper()));
|
||||
});
|
||||
} else if (namedAttr.getNameDialect()) {
|
||||
if (failed(iface.convertParameterAttr(func, argIdx, namedAttr, *this)))
|
||||
return failure();
|
||||
|
||||
Reference in New Issue
Block a user