[BACKEND] Add error reporting to report non-kernel-argument (#2552)

Co-authored-by: dongdongl <dongdongl@nvidia.com>
This commit is contained in:
Dongdong Li
2023-11-02 08:22:10 +08:00
committed by GitHub
parent 702cde0d6f
commit d0098da7b1
2 changed files with 13 additions and 4 deletions

View File

@@ -877,6 +877,11 @@ private:
return -1 -
op.getValue().dyn_cast<IntegerAttr>().getValue().getZExtValue();
}
if (!isa<BlockArgument>(v) &&
!isa<mlir::UnrealizedConversionCastOp, arith::ExtSIOp>(
v.getDefiningOp()))
llvm::report_fatal_error(
"Operand of `MakeTensorPtrOp` is not the function's argument");
if (v.getDefiningOp() &&
isa<mlir::UnrealizedConversionCastOp>(v.getDefiningOp())) {
return getArgIdx(v.getDefiningOp()->getOperand(0));
@@ -1771,6 +1776,11 @@ private:
return -1 -
op.getValue().dyn_cast<IntegerAttr>().getValue().getZExtValue();
}
if (!isa<BlockArgument>(v) &&
!isa<mlir::UnrealizedConversionCastOp, arith::ExtSIOp>(
v.getDefiningOp()))
llvm::report_fatal_error(
"Operand of `MakeTensorPtrOp` is not the function's argument");
if (v.getDefiningOp() &&
isa<mlir::UnrealizedConversionCastOp>(v.getDefiningOp())) {
return getArgIdx(v.getDefiningOp()->getOperand(0));