[LLVMdev] Post-increments and pre-decrements

Roman Levenstein romixlev at yahoo.com
Tue Dec 19 07:45:40 PST 2006


I'm trying to enable the pre-decrementing and post-incrementing based
addressing modes for my target. So far without any success :(
I enabled these modes in my TargetLowering class using
setIndexedLoadAction and setIndexedStoreAction calls. I also defined
getPreIndexedAddressParts and getPostIndexedAddressParts. And I can see
that DAGCombiner::CombineToPostIndexedLoadStore is invoked. But this
function never does any replacements and very seldomly invoke
getPostIndexedAddressParts and so on, even in those situations where I
would assume it.

For example, it does not use these modes for the code like:
void test_postinc(int array[], int i)
  array[i] = 1;
  array[i+1] = 1;
  array[i+2] = 1;
  array[i+3] = 1;

So, I'm wondering how good is the support for these modes in LLVM? Do I
miss something which should be implemented for my target to enable it?
It looks like only PowerPC backend tries to make use of it, but even
there it is not implemented completely.

And, BTW, are there any good test-cases or sample code (either ll or c
files) that is (or should be) translated by LLVM using these modes? I'd
like to get a better understanding about the situations where it can
happen at all. For example, is the code like above a good candidate for
it or not?


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the llvm-dev mailing list