This is an archive of the discontinued LLVM Phabricator instance.

[llvm][test] restrict 2 GVN tests to just test GVN (NFC)
ClosedPublic

Authored by nickdesaulniers on Feb 9 2023, 2:22 PM.

Diff Detail

Event Timeline

nickdesaulniers created this revision.Feb 9 2023, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 2:22 PM
nickdesaulniers requested review of this revision.Feb 9 2023, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 2:22 PM
nickdesaulniers added inline comments.Feb 9 2023, 2:40 PM
llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll
6

Q: isn't %i8 based on gep ptr %i, 1 while %i3 is based on get ptr %i, 2? Aren't those different addresses? Or is it because it's a 16b load (so the two adjacent 8bits)?

nickdesaulniers added inline comments.Feb 9 2023, 2:56 PM
llvm/test/Transforms/NewGVN/no_speculative_loads_with_asan.ll
19–20

I think these two instructions show that this whole test is kind of pointless IMO.

It's a copy of llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll, but using newgvn rather than gvn (unless I messed something up by converting this from -O3.

The @TestNoAsan case is the same as the @TestAsan case, so it just shows that NewGVN cannot elide redundant non-local loads. Am I understanding correctly?

nikic added inline comments.Feb 14 2023, 2:07 AM
llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll
6

%i8 is an out of bounds load which can be folded to poison (which then allows eliding the phi).

llvm/test/Transforms/NewGVN/no_speculative_loads_with_asan.ll
19–20

Yes, load folding in NewGVN is incomplete. Your new test it fine (the previous one was broken, because it did not actually test newgvn).

  • update comment in test as per @nikic
nickdesaulniers marked 2 inline comments as done.Feb 14 2023, 9:22 AM
This revision is now accepted and ready to land.Feb 14 2023, 11:14 AM