[LLVMdev] Eliminating redundant loads

Dibyendu Majumdar mobile at majumdar.org.uk
Sun Feb 22 14:40:52 PST 2015


On 22 February 2015 at 20:58, David Jones <djones at xtreme-eda.com> wrote:
> Not sure if this is your problem, but it was mine:
>
> You must create (or obtain) a DataLayout *and install it into the Module*.
>
> It is possible to generate machine code for IR and not install the
> DataLayout into the Module. Rather, the DataLayout is used locally at the
> point where code is generated. However, if you do this, then the alias
> analyses required to get rid of your redundant loads and stores cannot
> reason about possible aliasing.
>

Hi David,

I tried setting the module's DataLayout  to the engine's DataLayout.
Don't see any improvement.
The memcpy() is to perform a struct assign, so I tried replacing that
with member by member store.
But even then the loads are not being eliminated so I guess the
memcpy() isn't the issue.

Regards
Dibyendu



More information about the llvm-dev mailing list