Skip to content

Commit 60309d0

Browse files
Giuseppe Rossiniylc
authored andcommitted
Decoupling AOT from graph memory planner (apache#8096)
* Fix an issue with storage-rewrite pass and packed functions Change-Id: I13888471d4b8927a4012d6a8e749fb7a8935dd77 * Rebasing Change-Id: I7aa12e0217b8a2e1ff2a97a7c5fdda6b7597ae64 * Addressing comments Change-Id: If9f1ee190690f9a810fe41eb1933d736f1eb4ec3 * Add a pass to legalize packed calls Change-Id: I8aa43d3a1b837b03a5cf3c6b32fc760bd78d3436 * Add a unit test for the legalization pass Change-Id: I5b0d75380ff660dd5a0acf5b14fa84bb992fbec4 * rebasing Change-Id: I52ceab5cf6e9b54390cb36c18dbb8e22505d8e18 * Use common StorageInfo Change-Id: Ia8b7de1373f167ca7d0d69a99846d417405bbe48
1 parent 5f1ae26 commit 60309d0

File tree

9 files changed

+573
-126
lines changed

9 files changed

+573
-126
lines changed

include/tvm/tir/transform.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ TVM_DLL Pass ConvertBlocksToOpaque();
418418
*/
419419
TVM_DLL Pass CompactBufferAllocation();
420420

421+
/*!
422+
* This pass legalizes packed calls by wrapping their arguments into TVMValues
423+
*/
424+
TVM_DLL Pass LegalizePackedCalls();
425+
421426
/*!
422427
* \brief Flatten the multi-dimensional BufferLoad and BufferStore
423428
* to single dimensional Load/Store. Also remove Block to

python/tvm/tir/transform/transform.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,17 @@ def LowerTVMBuiltin():
451451
return _ffi_api.LowerTVMBuiltin()
452452

453453

454+
def LegalizePackedCalls():
455+
"""Legalize packed calls to have its arguments wrapped in TVMValues
456+
457+
Returns
458+
-------
459+
fpass : tvm.transform.Pass
460+
The result pass
461+
"""
462+
return _ffi_api.LegalizePackedCalls()
463+
464+
454465
def LowerIntrin():
455466
"""Lower target specific intrinsic calls.
456467

0 commit comments

Comments
 (0)