Commit Graph

4 Commits

Author SHA1 Message Date
Philip Reames 805115655e [LSR] Unify scheduling of existing and inserted addrecs
LSR goes to some lengths to schedule IV increments such that %iv and %iv.next never need to overlap. This is fairly fundamental to LSRs cost model. LSR assumes that an addrec can be represented with a single register. If %iv and %iv.next have to overlap, then that assumption does not hold.

The bug - which this patch is fixing - is that LSR only does this scheduling for IVs which it inserts, but it's cost model assumes the same for existing IVs that it reuses. It will rewrite existing IV users such that the no-overlap property holds, but will not actually reschedule said IV increment.

As you can see from the relatively lack of test updates, this doesn't actually impact codegen much. The main reason for doing it is to make a follow up patch series which improves post-increment use and scheduling easier to follow.

Differential Revision: https://reviews.llvm.org/D97219
2021-03-03 12:07:55 -08:00
Philip Reames 52745e4d90 [tests] precommit tests for D97219 2021-02-24 12:44:12 -08:00
Yvan Roux 38f28f4621 [Test] Fix test case demonstrating oddities in behavior of LSR.
Add x86 targets requirement to fix bots which are not building these
targets.
2021-02-05 16:03:24 +01:00
Max Kazantsev 6c097f73ca [Test] Add more tests demonstrating oddities in behavior of LSR
These tests demonstrate that LSR does not insert IV increment
into the latch block (as it supposes to) when it can use an
existing Phi as IV rather than creating a new LSR IV.
2021-02-05 14:04:29 +07:00