News for hackers. Stuff that matters.
Re:Will it optimize? by mian2zi3 on Friday July 23, 2010 @11:58AM (#1541546)
The phase ordering problem in compilers is notoriously hard. You wouldn't worry about the interaction between strength reduction and scheduling, but in other cases you do need to take these interactions into account. In my compiler (aka a compiler I worked on), the software pipeliner estimated register pressure, since you don't want to over-pipeline to expose parallelism if you blow the register set and cause the allocator to spill. Often register allocation is sensitive to the schedule (and there have been attempts to combine them into one pass.)

For x+x vs x*2 vs x<<1, the trick is to represent them in a uniform way and let the scheduler decide what instruction to emit based.

Re:Will it optimize? by 1amzave on Friday July 23, 2010 @01:38PM (#1541840)
> Often register allocation is sensitive to the schedule (and there have been attempts to combine them into one pass.)

Yes -- for what it's worth, the compiler I'm working on at the moment has a pre-allocation scheduling pass and a post-allocation scheduling pass, and will also sometimes reschedule during allocation to shorten live ranges and thus ease register pressure.