Fix for PR14824: Optimization arm_ldst_opt inserts newly generated instruction vldmia at incorrect position

Stepan Dyatkovskiy stpworld at narod.ru
Tue Mar 26 21:48:31 PDT 2013


Oh.. sorry, I've applied outdated patch, since I totally refactored it 
in Monday. Reattached.
Relative to getElementaries... So you propose just to keep the list of 
unit registers currently used? right?  I try to fix it today.
-Stepan.
Renato Golin wrote:
> On 25 March 2013 16:20, Stepan Dyatkovskiy <stpworld at narod.ru
> <mailto:stpworld at narod.ru>> wrote:
>
>     Hello Jiangning,
>     The main reason I did it, is that we need to analyze contents of
>     MemOps *each time* we modify it: we need to prevent more than one
>     "load" operations into the same place.
>
>
> Hi Stepan,
>
> I like the idea of inspecting it on every load, but the current patch is
> very inefficient.
>
> On:
>
> +    SmallVector<unsigned, 4> getElementaries(unsigned Reg) {
>
> You create the small vector on *every* call. This is really bad. And
> then you iterate and compare every register of the new operations with
> every register of every other operation so far. That's far from optimal.
> This is why STL sorts and creates new sets, etc.
>
> If I get correctly you don't need a list of memory ops and their
> respective registers, but the opposite, since you're looking for
> registers, not memory ops.
>
> So, instead of keeping a list of operations and querying their registers
> *every single time*, you can keep a list of registers "in use" with a
> pointer to a small vector with the memory operations that use that register.
>
> That will give you near constant time query over all registers in use
> and you'll only have to gather the registers (via getElementaries) once
> per operation.
>
> The rest looks ok, the encapsulation of MemOps into MemOpsTrckr seems to
> work (wrt push_back/insert).
>
> Would also be good to have the IR in the PR bug as a test, just to make
> sure the objective was met and to have a history on what this patch is
> fixing.
>
> Thanks,
> --renato

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr14824-2013-03-25.patch
Type: text/x-diff
Size: 4650 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130327/655b0597/attachment.patch>


More information about the llvm-commits mailing list