[llvm-commits] [PATCH] Multidimensional Array Index Delinearization Analysis

Sameer Sahasrabuddhe sameer.sahasrabuddhe at amd.com
Thu Sep 27 02:29:50 PDT 2012


Hi Hal,

I tried the version from Delinearization-20120926.patch on a Fortran
loopnest, with -O3 before invoking delinearization. See attached file
"m.pre.ll".

The delinearizer misses out on the negation expression implemented as
an XOR (the value "%not"):

    ~n = -n - 1

As a result, the "n" above is not available as a possible term in a GCD.
It worked when I manually substituted that negation with its expansion.
I am not sure if this should be handled as an additional method
"addPolysForXor()", or the IR itself should be modified as a precursor
to delinearization. This expansion is similar to what happens in
ScalarEvolution::getNotSCEV().

Also attaching a diff on Delinearization.cpp, that introduces a useful
debug dump during the iterations happening over the candidate GCDs in
Delinearization::factorOuterSizeAndIndex().

The result provided by the delinearization is a map from the original
Value to SCEVs representing the size (MaxS) and the index (MaxR). It
might be useful to also expose the quotient (MaxQ), so that the entire
expression is now available to the user for whatever purpose.

Sameer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug-delinearizer.patch
Type: application/octet-stream
Size: 581 bytes
Desc: debug-delinearizer.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120927/40724663/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m.pre.ll
Type: application/octet-stream
Size: 2418 bytes
Desc: m.pre.ll
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120927/40724663/attachment-0001.obj>


More information about the llvm-commits mailing list