[LLVMdev] Complex load patterns and token factors

Tim Northover t.p.northover at gmail.com
Sun Jun 24 02:18:00 PDT 2012


> 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)?

Tim.



More information about the llvm-dev mailing list