On Sun, 24 Jun 2012 10:18:00 +0100 Tim Northover <t.p.northover at gmail.com> wrote:> > I also had to include II.canFoldAsLoad to make this work for me. As > > is the case with other "simple" loads in the PowerPC backend, > > canFoldAsLoad is set but mayLoad is not (is this wrong)? > > Hmm. So far we've got: mayLoad, mayStore, canFoldAsLoad and > hasUnmodeledSideEffects as candidates. > > Looking at Target.td, I see that I missed hasCtrlDep which seems to be > exactly what we're looking for, though it doesn't appear to actually > be used for *anything* at the moment. I'm not sure how I missed it > before. > > Unless anyone comes up with a better idea (or just a reason why this > idea is bad) I think I'll send a patch making the predicate just > hasCtrlDep to llvm-commits later, and change my instructions so they > set that flag when needed. It's less friendly than checking all of the > others, but what if someone has a mayLoad instruction they don't want > to chain (for some bizarre reason)?If it is not being used, maybe we should change it to be doesNotNeedChain? I am not sure what kind of load does not need to be chained (prefetch?), but I'd prefer to keep the system friendly if at all possible. They'll be fewer bugs that way. Thanks again, Hal> > Tim.-- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory
> If it is not being used, maybe we should change it to be > doesNotNeedChain?That sounded like a really good idea until I started to actually go through removing all traces of hasCtrlDep from other Targets. I felt really bad about wiping those flags people had carefully put on their instructions, even if useless.> I am not sure what kind of load does not need to be chained (prefetch?), but I'd prefer to keep the system friendly if at > all possible. They'll be fewer bugs that way.That is the main worry. Could we justify a second "hasNoCtrlDep" in addition to "hasCtrlDep", with it being a TableGen error to set both? Or just forget about the override until someone actually comes up with an instruction that's legitimately "mayLoad" or whatever yet doesn't want a chain (I don't think even prefetch counts -- if other instructions are modifying that location it needs to know).> Thanks again,No worries. Tim.
On Sun, 24 Jun 2012 18:09:48 +0100 Tim Northover <t.p.northover at gmail.com> wrote:> > If it is not being used, maybe we should change it to be > > doesNotNeedChain? > > That sounded like a really good idea until I started to actually go > through removing all traces of hasCtrlDep from other Targets. I felt > really bad about wiping those flags people had carefully put on their > instructions, even if useless. > > > I am not sure what kind of load does not need to be chained > > (prefetch?), but I'd prefer to keep the system friendly if at all > > possible. They'll be fewer bugs that way. > > That is the main worry. Could we justify a second "hasNoCtrlDep" in > addition to "hasCtrlDep", with it being a TableGen error to set both? > Or just forget about the override until someone actually comes up with > an instruction that's legitimately "mayLoad" or whatever yet doesn't > want a chainThis is probably the best approach. There is no need to invent a feature with no use cases. -Hal> (I don't think even prefetch counts -- if other > instructions are modifying that location it needs to know). > > > Thanks again, > > No worries. > > Tim.-- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory