Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLVM/CG] Sort PrimFuncs when creating LLVM module #8958

Merged
merged 3 commits into from
Sep 9, 2021
Merged

[LLVM/CG] Sort PrimFuncs when creating LLVM module #8958

merged 3 commits into from
Sep 9, 2021

Conversation

kparzysz-quic
Copy link
Contributor

PrimFuncs are stored in a map where the order of iteration is not deterministic. This can cause a different llvm::Module to be created each time, which can defeat debugging tools like -opt-bisect-limit.

Add function CodeGenLLVM::AddFunctionsOrdered that takes a range of PrimFuncs or objects convertible to PrimFunc, and adds them to the LLVM module in a deterministic order.

@kparzysz-quic
Copy link
Contributor Author

cc: @jroesch @tkonolige

PrimFuncs are stored in a map where the order of iteration is not
deterministic. This can cause a different llvm::Module to be created
each time, which can defeat debugging tools like -opt-bisect-limit.

Add function CodeGenLLVM::AddFunctionsOrdered that takes a range of
PrimFuncs or objects convertible to PrimFuncs, and adds them to the
LLVM module in a deterministic order.
@tqchen
Copy link
Member

tqchen commented Sep 8, 2021

also cc @vinx13 @ZihengJiang @masahi

@tqchen tqchen assigned masahi and jroesch and unassigned masahi Sep 8, 2021
@tkonolige
Copy link
Contributor

Do you think it would be possible to add a test that the functions are in sorted order?

@masahi masahi merged commit b8fcad8 into apache:main Sep 9, 2021
@kparzysz-quic kparzysz-quic deleted the codegenllvm-sort-primfuncs branch September 9, 2021 12:44
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
* [LLVM/CG] Sort PrimFuncs when creating LLVM module

PrimFuncs are stored in a map where the order of iteration is not
deterministic. This can cause a different llvm::Module to be created
each time, which can defeat debugging tools like -opt-bisect-limit.

Add function CodeGenLLVM::AddFunctionsOrdered that takes a range of
PrimFuncs or objects convertible to PrimFuncs, and adds them to the
LLVM module in a deterministic order.

* Empty commit to restart build

* Add testcase
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* [LLVM/CG] Sort PrimFuncs when creating LLVM module

PrimFuncs are stored in a map where the order of iteration is not
deterministic. This can cause a different llvm::Module to be created
each time, which can defeat debugging tools like -opt-bisect-limit.

Add function CodeGenLLVM::AddFunctionsOrdered that takes a range of
PrimFuncs or objects convertible to PrimFuncs, and adds them to the
LLVM module in a deterministic order.

* Empty commit to restart build

* Add testcase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants