This is an archive of the discontinued LLVM Phabricator instance.

[MemCpyOpt] precommit tests to add multi-BB stack-move optimization to check crash for D153453 (NFC)
ClosedPublic

Authored by khei4 on Jul 13 2023, 4:36 AM.

Details

Summary

Once https://reviews.llvm.org/D153453 landed, some clang and openmp tests crashed with assertion failure

clang-17: /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/llvm/lib/IR/Instruction.cpp:126: bool llvm::Instruction::comesBefore(const llvm::Instruction*) const: Assertion `Parent == Other->Parent && "cross-BB instruction order comparison"' failed.

to avoid this, add multi-BB load/store separated tests

Diff Detail

Event Timeline

khei4 created this revision.Jul 13 2023, 4:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 4:36 AM
Herald added a subscriber: tpr. · View Herald Transcript
khei4 requested review of this revision.Jul 13 2023, 4:36 AM
Herald added a project: Restricted Project. · View Herald Transcript
khei4 updated this revision to Diff 540305.Jul 14 2023, 12:56 AM
khei4 removed a reviewer: jdoerfert.

add problematic case.

nikic added inline comments.Jul 14 2023, 2:50 AM
llvm/test/Transforms/MemCpyOpt/stack-move-63851.ll
2 ↗(On Diff #540305)

Does the issue reproduce if you feed the result of -passes=early-cse -preserve-ll-uselistorder to memcpyopt?

chfast added a subscriber: chfast.Jul 14 2023, 2:50 AM
khei4 updated this revision to Diff 540339.Jul 14 2023, 2:55 AM
khei4 removed reviewers: jdoerfert, nikic, serge-sans-paille.

rebase
(sorry for being noisy,

khei4 added inline comments.Jul 14 2023, 2:56 AM
llvm/test/Transforms/MemCpyOpt/stack-move-63851.ll
2 ↗(On Diff #540305)

Thanks, now I noticed, I'll see.

khei4 updated this revision to Diff 540354.Jul 14 2023, 4:07 AM
  • specify uselistorder statically
nikic added inline comments.Jul 14 2023, 5:29 AM
llvm/test/Transforms/MemCpyOpt/stack-move-63851.ll
2 ↗(On Diff #540305)

Now that this only requires memcpyopt, can you merge it into the main test?

khei4 updated this revision to Diff 540638.EditedJul 14 2023, 9:34 PM
  • merge tests

matcher changes on CHECK lines are maybe caused by https://github.com/llvm/llvm-project/commit/b9f1df7a04d7a3169623e437597aa4b32d99d8b3

khei4 added inline comments.Jul 14 2023, 9:35 PM
llvm/test/Transforms/MemCpyOpt/stack-move-63851.ll
2 ↗(On Diff #540305)

Yes, you're right. We can!

nikic accepted this revision.Jul 15 2023, 12:20 AM

LGTM

This revision is now accepted and ready to land.Jul 15 2023, 12:20 AM