@@ -864,13 +864,12 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
864
864
error (" Unsupported intrinsic type: $typ " )
865
865
end
866
866
867
- new_intr_ft = LLVM. FunctionType (typ, parameters (call_ft))
868
- new_intr = LLVM. Function (mod, fn, new_intr_ft)
867
+ new_intr = LLVM. Function (mod, fn, call_ft)
869
868
@dispose builder= IRBuilder (ctx) begin
870
869
position! (builder, call)
871
870
debuglocation! (builder, call)
872
871
873
- new_value = call! (builder, new_intr, arguments (call))
872
+ new_value = call! (builder, call_ft, new_intr, arguments (call))
874
873
replace_uses! (call, new_value)
875
874
unsafe_delete! (bb, call)
876
875
changed = true
@@ -936,7 +935,7 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
936
935
if haskey (functions (mod), new_intr_fn)
937
936
new_intr = functions (mod)[new_intr_fn]
938
937
else
939
- new_intr = LLVM. Function (mod, new_intr_fn, LLVM . FunctionType (typ, parameters ( call_ft)) )
938
+ new_intr = LLVM. Function (mod, new_intr_fn, call_ft)
940
939
push! (function_attributes (new_intr), EnumAttribute (" alwaysinline" ; ctx))
941
940
942
941
arg0, arg1 = parameters (new_intr)
@@ -1008,9 +1007,9 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
1008
1007
fallback_intr = if haskey (functions (mod), fallback_intr_fn)
1009
1008
functions (mod)[fallback_intr_fn]
1010
1009
else
1011
- LLVM. Function (mod, fallback_intr_fn, LLVM . FunctionType (typ, parameters ( call_ft)) )
1010
+ LLVM. Function (mod, fallback_intr_fn, call_ft)
1012
1011
end
1013
- val = call! (builder, fallback_intr, collect (parameters (new_intr)))
1012
+ val = call! (builder, call_ft, fallback_intr, collect (parameters (new_intr)))
1014
1013
ret! (builder, val)
1015
1014
end
1016
1015
end
@@ -1019,7 +1018,7 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
1019
1018
position! (builder, call)
1020
1019
debuglocation! (builder, call)
1021
1020
1022
- new_value = call! (builder, new_intr, arguments (call))
1021
+ new_value = call! (builder, call_ft, new_intr, arguments (call))
1023
1022
replace_uses! (call, new_value)
1024
1023
unsafe_delete! (bb, call)
1025
1024
changed = true
0 commit comments