Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions tirx/include/tvm/tirx/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ TVM_TIRX_DLL Pass SplitHostDevice();
*/
TVM_TIRX_DLL Pass SkipAssert();

/*!
* \brief This annotation is for nodes to be disabled for builtin lowering
*/
static constexpr const char* kDisableLowerTVMBuiltin = "disable_lower_builtin";

/*!
* \brief Lower builtin intrinsics.
* \return The pass.
Expand Down
6 changes: 0 additions & 6 deletions tirx/src/tirx/transform/lower_tvm_builtin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,6 @@ class BuiltinLower : public StmtExprMutator {
DLDataType dtype = tensor_call->ty_args[0].as_or_throw<TensorType>()->dtype->dtype;
PrimType element_type(dtype);
auto scope = tensor_call->ty_args[0].as_or_throw<TensorType>()->scope;
DictAttrs annotations = tensor_call->attrs.value().as_or_throw<DictAttrs>();
if (annotations->dict.count(transform::kDisableLowerTVMBuiltin)) {
if (annotations->dict[transform::kDisableLowerTVMBuiltin].as_or_throw<IntImm>()->value) {
return stmt;
}
}
if (element_type.IsScalableVector()) {
return stmt;
}
Expand Down
21 changes: 0 additions & 21 deletions tirx/tests/python/codegen/llvm/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,27 +838,6 @@ def Kirby(v: T.float32) -> T.float32:
assert matches == sorted(matches)


@pytest.mark.skipif(not env.has_llvm(), reason="need llvm")
@pytest.mark.parametrize("extent", [2**32 + 1, 2**32 + 4])
def test_llvm_large_stack_allocation_uses_64bit_extent(extent):
@T.function
def main(A: T.Tensor((1,), "float32")):
B = T.alloc_tensor(
ty_args=[T.Tensor((extent,), "float32", scope="global")],
annotations={"disable_lower_builtin": True},
)
A[0] = B[T.int64(extent - 1)]

module = tvm_tirx.tirx.compile(
main,
target={"kind": "llvm", "opt-level": 0},
pipeline="tirx",
).mod
llvm_ir = module.inspect_source("ll")

assert re.search(rf"alloca float, i64 {extent}(?:,|$)", llvm_ir)


@pytest.mark.skipif(not env.has_llvm(), reason="need llvm")
def test_llvm_scalar_concat():
@I.ir_module
Expand Down
Loading