On Jul 11, 2011, at 3:41 PM, Dan Gohman wrote:> On Jul 11, 2011, at 3:06 PM, Eli Friedman wrote: > >> On Mon, Jul 11, 2011 at 2:44 PM, Eric Christopher <echristo at apple.com> wrote: >>> >>> On Jul 11, 2011, at 1:48 PM, Nick Lewycky wrote: >>> >>> This seems odd. I'd think that fast-isel should be able to materialize the constants when we want them rather than at the beginning of the block. >> >> I'm not entirely sure why, but FastISel does intentionally materialize >> constants at the beginning of the block. See >> FastISel::enterLocalValueArea etc. Maybe Dan knows why? > > > Going bottom-up, FastISel doesn't know when it'll see the first use of a value > in a block. Cleverer schemes are possible.Or less clever by not caching the result? :) -eric
On Jul 11, 2011, at 3:43 PM, Eric Christopher wrote:> > On Jul 11, 2011, at 3:41 PM, Dan Gohman wrote: > >> On Jul 11, 2011, at 3:06 PM, Eli Friedman wrote: >> >>> On Mon, Jul 11, 2011 at 2:44 PM, Eric Christopher <echristo at apple.com> wrote: >>>> >>>> On Jul 11, 2011, at 1:48 PM, Nick Lewycky wrote: >>>> >>>> This seems odd. I'd think that fast-isel should be able to materialize the constants when we want them rather than at the beginning of the block. >>> >>> I'm not entirely sure why, but FastISel does intentionally materialize >>> constants at the beginning of the block. See >>> FastISel::enterLocalValueArea etc. Maybe Dan knows why? >> >> >> Going bottom-up, FastISel doesn't know when it'll see the first use of a value >> in a block. Cleverer schemes are possible. > > Or less clever by not caching the result? :)At least, we shouldn't cache stuff across function calls. /jakob
On Jul 11, 2011, at 3:49 PM, Jakob Stoklund Olesen wrote:>>> >>> Going bottom-up, FastISel doesn't know when it'll see the first use of a value >>> in a block. Cleverer schemes are possible. >> >> Or less clever by not caching the result? :) > > At least, we shouldn't cache stuff across function calls.Special casing "instructions that clobber everything", or just calls, would make a lot of sense. -Chris