mirror of https://github.com/commaai/tinygrad.git
add noalias to llvm (#1622)
This commit is contained in:
parent
89e13f2f04
commit
db8344ab83
|
@ -134,6 +134,8 @@ class TestOps(unittest.TestCase):
|
|||
helper_test_op([], lambda: torch.arange(11, 5, -3), lambda: Tensor.arange(11, 5, -3), forward_only=True)
|
||||
def test_arange_simple(self):
|
||||
helper_test_op([], lambda: torch.arange(10), lambda: Tensor.arange(10), forward_only=True)
|
||||
def test_arange_big(self):
|
||||
helper_test_op([], lambda: torch.arange(256), lambda: Tensor.arange(256), forward_only=True)
|
||||
|
||||
def test_where(self):
|
||||
helper_test_op(
|
||||
|
|
|
@ -77,6 +77,7 @@ def uops_to_llvm_ir(function_name:str, uops:List[UOp]) -> Tuple[str, Optional[Li
|
|||
# create llvm function
|
||||
func_dtypes = [dtype_to_llvm_dtype[dtype] for dtype in buf_to_dtype.values()]
|
||||
func = ir.Function(module, ir.FunctionType(ir.VoidType(), [x.as_pointer() for x in func_dtypes]), name=function_name)
|
||||
for a in func.args: a.add_attribute("noalias")
|
||||
|
||||
# force llvmlite to allow us to add function attribute then add the attribute
|
||||
func.attributes._known = func.attributes._known.union(frozenset(['"no-nans-fp-math"="true"']))
|
||||
|
|
Loading…
Reference in New Issue