This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Inspect more store operands for cycle before merging.
ClosedPublic

Authored by t.p.northover on Oct 24 2018, 10:06 AM.

Details

Reviewers
niravd
Summary

When checking whether merging some stores would create a Cycle we need to look at more of the operands. The address operands are all semantically related (because they must be contiguous), but don't necessarily refer to the same actual base SDNodes, which leaves room for a cycle to form (we saw this happen via an indexed load). I also believe the indexed amount operand (which is usually just undef) could participate in a loop since it can be non-constant on 32-bit ARM-mode ARM; I don't have even an internal test-case where that happens though.

So this extends the check to cover those operands too.

Unfortunately there's no test-case. I had a reasonably simple one (two stores and two memsets, with associated GEPs), but it was so fragile it didn't even survive the move from our internal branch to OSS LLVM (i.e. ToT doesn't trigger it). I can't see a way around that. Hopefully the updated comments will discourage anyone from regressing it.

Diff Detail

Repository
rL LLVM

Event Timeline

t.p.northover created this revision.Oct 24 2018, 10:06 AM

Fixing capitalization of variable. Oops.

niravd accepted this revision.Oct 24 2018, 10:21 AM

LGTM.

This revision is now accepted and ready to land.Oct 24 2018, 10:21 AM
t.p.northover closed this revision.Oct 24 2018, 2:39 PM

Thanks. Committed as r345200.