Switch sample tracer to emit builtin_ufunc globals instead of the impl versions.

pull/1/head
Stella Laurenzo 2020-05-08 14:35:13 -07:00
parent 497f1de5a2
commit db0b0ef1b2
1 changed files with 2 additions and 20 deletions

View File

@ -91,26 +91,8 @@ def load_builtin_module(context=None):
_BUILTIN_MODULE_ASM = r"""
numpy.generic_ufunc @numpy.add (
overload(%arg0: i32, %arg1: i32) -> i32 {
%0 = addi %arg0, %arg1 : i32
numpy.ufunc_return %0 : i32
},
overload(%arg0: f32, %arg1: f32) -> f32 {
%0 = addf %arg0, %arg1 : f32
numpy.ufunc_return %0 : f32
}
)
numpy.generic_ufunc @numpy.multiply (
overload(%arg0: i32, %arg1: i32) -> i32 {
%0 = muli %arg0, %arg1 : i32
numpy.ufunc_return %0 : i32
},
overload(%arg0: f32, %arg1: f32) -> f32 {
%0 = mulf %arg0, %arg1 : f32
numpy.ufunc_return %0 : f32
}
)
numpy.builtin_ufunc @numpy.add
numpy.builtin_ufunc @numpy.multiply
"""
if __name__ == "__main__":