[llvm-dev] Usage of base register other than ebp for array accesses
Gnanambikai Krishnakumar via llvm-dev
llvm-dev at lists.llvm.org
Sun Sep 17 07:24:02 PDT 2017
We want to write a transformation pass such that the array accesses use
a base register other than ebp (assuming that the code is compiled for x86
architecture). For example,
The below C code
->a = 2
by default, gets compiled to something like this:
->mov dword ptr [ebp - 28], eax
However, we want our pass to emit the something similar to the following
->mov ecx, "base of array"
->mov dword ptr [ecx - "index from base of array a"], eax
Is there any way we could modify the llvm code so as to achieve the
required instruction format? Please let us know if there is some code that
already does this or if it is documented elsewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev