From 809940de1c173d97dcc3681604c601c970164694 Mon Sep 17 00:00:00 2001 From: Tim Gymnich Date: Tue, 17 Sep 2024 15:49:33 +0200 Subject: [PATCH] add ir_check_ignore metadata to check ir type check --- src/validation.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/validation.jl b/src/validation.jl index 93e18950..a46fd19a 100644 --- a/src/validation.jl +++ b/src/validation.jl @@ -322,7 +322,8 @@ function check_ir_values(mod::LLVM.Module, T_bad::LLVMType) errors = IRError[] for fun in functions(mod), bb in blocks(fun), inst in instructions(bb) - if value_type(inst) == T_bad || any(param->value_type(param) == T_bad, operands(inst)) + if value_type(inst) == T_bad && !haskey(metadata(inst), "ir_check_ignore") || + any(op -> value_type(op) == T_bad && !(op isa Instruction && haskey(metadata(op), "ir_check_ignore")), operands(inst)) bt = backtrace(inst) push!(errors, ("use of $(string(T_bad)) value", bt, inst)) end