[Backend] Rewrite code for linking external library to expose more inlining opportunities (#1037)

- Also make it cleaner. 
- And mark out the code needs to be fixed in `semantic.py`.
This commit is contained in:
Keren Zhou
2023-01-08 16:44:29 -05:00
committed by GitHub
parent ff399fbc20
commit 733301ff31
4 changed files with 129 additions and 118 deletions

View File

@@ -1116,11 +1116,13 @@ def xor_sum(input: tl.tensor, axis: int, builder: ir.builder) -> tl.tensor:
def umulhi(x: tl.tensor, y: tl.tensor, builder: ir.builder) -> tl.tensor:
x, y = binary_op_type_checking_impl(x, y, builder)
# FIXME(Keren): not portable, should be fixed
from . import libdevice
return libdevice.mulhi(x, y, _builder=builder)
def floor(x: tl.tensor, builder: ir.builder) -> tl.tensor:
# FIXME(Keren): not portable, should be fixed
from . import libdevice
return libdevice.floor(x, _builder=builder)