Skip to content

[ExecutionEngine] Avoid repeated hash lookups (NFC) #132587

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

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@kazutakahirata kazutakahirata requested a review from nikic March 23, 2025 03:51
@kazutakahirata kazutakahirata merged commit 0b181de into llvm:main Mar 23, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_ExecutionEngine branch March 23, 2025 14:37
DavidSpickett added a commit that referenced this pull request Mar 26, 2025
DavidSpickett added a commit that referenced this pull request Mar 26, 2025
Reverts #132587

Due to causing test failures on several of Linaro's buildbots. Several
MLIR test failures and at least one test timing out.

I doubt it's the patch itself, but instead an issue it has uncovered.
Revert while we dig into that.
@DavidSpickett
Copy link
Collaborator

I've reverted this sooner than we might normally do, because it's intended to be a performance improvement so it's a clean revert.

Going to get you details of the test failures...

@DavidSpickett
Copy link
Collaborator

DavidSpickett commented Mar 26, 2025

A normal AArch64 build: https://lab.llvm.org/buildbot/#/builders/84/builds/1436
An AArch64 with SVE build: https://lab.llvm.org/buildbot/#/builders/17/builds/6730

 FAIL: MLIR::padded_sparse_conv_2d.mlir
 FAIL: MLIR::sparse_conv_3d_ndhwc_dhwcf.mlir
 FAIL: MLIR::sparse_matmul.mlir
 FAIL: MLIR::sparse_binary.mlir
 FAIL: MLIR::sparse_conversion.mlir
 FAIL: MLIR::sparse_conversion_sparse2dense.mlir
 <...>

Both got hit which means this isn't SVE specific. Lots of MLIR failures, that use mlir-runner, which uses LLVM's ExecutionEngine. Which makes sense given that there are changes in the function resolveAArch64Branch.

And explains why no other platform had this problem.

@@ -1515,15 +1515,15 @@ void RuntimeDyldELF::resolveAArch64Branch(unsigned SectionID,
uint64_t Offset = RelI->getOffset();
unsigned RelType = RelI->getType();
// Look for an existing stub.
StubMap::const_iterator i = Stubs.find(Value);
if (i != Stubs.end()) {
auto [It, Inserted] = Stubs.try_emplace(Value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem here is that before, we only added an entry to the map if resolveAArch64ShortBranch returned false. Now, it could return true and it's too late, we already added the entry to the map.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidSpickett Ah, I see. Without this patch, we sometimes don't insert a new entry depending on the outcome of resolveAArch64ShortBranch.

Thanks for the revert!

@DavidSpickett
Copy link
Collaborator

@kazutakahirata , I think this would reproduce by doing ninja check-mlir on any AArch64 machine. If you do not have access to one, @omjavaid can test your fixes for you.

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 26, 2025
…)" (#133101)

Reverts llvm/llvm-project#132587

Due to causing test failures on several of Linaro's buildbots. Several
MLIR test failures and at least one test timing out.

I doubt it's the patch itself, but instead an issue it has uncovered.
Revert while we dig into that.
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.

4 participants