Skip to content

Commit

Permalink
skip ir_value check if allowdouble meta is present
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Sep 17, 2024
1 parent bbd6124 commit d89cee9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,16 @@ 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))
bt = backtrace(inst)
push!(errors, ("use of $(string(T_bad)) value", bt, inst))
if value_type(inst) != T_bad || haskey(metadata(inst), "ir_check_ignore")
continue
end

if all(op->value_type(op) != T_bad || (op isa Instruction && haskey("ir_check_ignore", metadata(op))), operands(inst))
continue
end

bt = backtrace(inst)
push!(errors, ("use of $(string(T_bad)) value", bt, inst))
end

return errors
Expand Down

0 comments on commit d89cee9

Please sign in to comment.