Skip to content

Commit d68a7fc

Browse files
authored
Metal: Fix IR validation. (#608)
1 parent 641c9b4 commit d68a7fc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/metal.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ function finish_module!(@nospecialize(job::CompilerJob{MetalCompilerTarget}), mo
8787
end
8888

8989
function validate_ir(job::CompilerJob{MetalCompilerTarget}, mod::LLVM.Module)
90+
errors = IRError[]
91+
9092
# Metal never supports double precision
91-
check_ir_values(mod, LLVM.DoubleType())
92-
check_ir_values(mod, LLVM.IntType(128))
93+
append!(errors, check_ir_values(mod, LLVM.DoubleType()))
94+
append!(errors, check_ir_values(mod, LLVM.IntType(128)))
95+
96+
errors
9397
end
9498

9599
# hide `noreturn` function attributes, which cause issues with the back-end compiler,
@@ -926,7 +930,7 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
926930
# normally we'd do this inline, but LLVM.jl doesn't have BB split functionality.
927931
new_intr_fn = if is_minimum
928932
"air.minimum.f$(8*sizeof(jltyp))"
929-
else
933+
else
930934
"air.maximum.f$(8*sizeof(jltyp))"
931935
end
932936

0 commit comments

Comments
 (0)