This is an archive of the discontinued LLVM Phabricator instance.

[Polly][CodeGen]Fix getArrayAccessFor crashes as in bug 32534 with -polly-vectorizer=polly
ClosedPublic

Authored by bin.narwal on Nov 11 2019, 5:34 AM.

Details

Summary

Hi,
Not sure when the original crash information disappeared, the test suffers from crash in function
polly::ScopStmt::getArrayAccessFor now.

Root cause is VectorBlockGenerator::copyStmt iterates all instructions in basic block, however some
load instructions may be not unnecessary thus removed by simplification. As a result, these load
instructions don't have corresponding Array.

Looking at BlockGenerator::copyBB, it only iterates instructions list of ScopStmt. Given it must be
a block type scop in case of vectorization, I think we should do the same in VectorBlockGenerator::copyStmt.

A test is also added in the patch. All tests pass, any comments?

Thanks,
bin

Diff Detail

Event Timeline

bin.narwal created this revision.Nov 11 2019, 5:34 AM
Meinersbur accepted this revision.Nov 11 2019, 8:35 PM

Thanks for looking into the bug. The suggestion change is obvious (IMHO).

However, the test case seems to be the unmodified reduced test case from bugzilla. Generally, committed test cases should be

  1. Minimal (No unnecessary comments, metadata, etc.)
  2. Have at least one positive CHECK line.

But the change is obvious enough, I'd commit it without test-case.

This revision is now accepted and ready to land.Nov 11 2019, 8:35 PM

Thanks for looking into the bug. The suggestion change is obvious (IMHO).

However, the test case seems to be the unmodified reduced test case from bugzilla. Generally, committed test cases should be

  1. Minimal (No unnecessary comments, metadata, etc.)
  2. Have at least one positive CHECK line.

But the change is obvious enough, I'd commit it without test-case.

Okay, thanks. Please help commit it. I will try to minimize the test case in the future.

Thanks,

This revision was automatically updated to reflect the committed changes.