def postpass_link_math(ee, lmod, lfunc): "pykit.math.* -> llvmmath.*" replacements = {} for lf in lmod.functions: if lf.name.startswith("pykit.math."): _, _, name = lf.name.partition(".") replacements[lf.name] = name del lf # this is dead after linking below default_math_lib = llvmmath.get_default_math_lib() linker = linking.get_linker(default_math_lib) linking.link_llvm_math_intrinsics(ee, lmod, default_math_lib, linker, replacements) return lfunc
def link(self): engine, mod, pm, lib, linker, replacements = self linking.link_llvm_math_intrinsics( engine, mod, lib, linker, replacements) mod.verify() # Using the module optimizer to inline all functions remove a segfault # condition on 32-bit linux; thus, this is supporting the my guess # that bad ABI use is causing a stack corruption. # Eliminating the internal function call has successfully remove # the segfault. # TODO: replace all complex wrapping code pm.run(mod)
def link(self): engine, mod, pm, lib, linker, replacements = self linking.link_llvm_math_intrinsics(engine, mod, lib, linker, replacements) mod.verify() # Using the module optimizer to inline all functions remove a segfault # condition on 32-bit linux; thus, this is supporting the my guess # that bad ABI use is causing a stack corruption. # Eliminating the internal function call has successfully remove # the segfault. # TODO: replace all complex wrapping code pm.run(mod)
def postpass_link_math(env, ee, lmod, lfunc): "numba.math.* -> llvmmath.*" replacements = {} for lf in lmod.functions: if lf.name.startswith('numba.math.'): _, _, name = lf.name.rpartition('.') replacements[lf.name] = name del lf # this is dead after linking below default_math_lib = llvmmath.get_default_math_lib() linker = linking.get_linker(default_math_lib) linking.link_llvm_math_intrinsics(ee, lmod, default_math_lib, linker, replacements) return lfunc