1.4K Star 7.3K Fork 1.3K

GVP方舟编译器 / OpenArkCompiler

 / 详情

mplfe is not using array opcode when the C source is using subscripts for pointers

Backlog
member
Opened this issue  
2021-10-02 08:01

Example is in x264_src/common/mc.c line 193:

        buf[x+2] = v;

where buf is declared:

int16_t *buf;

clang2mpl generates:

LOC 23 193
iassign <* i16> 0 (
array 0 a64 <* <[1] i16>> (
dread a64 %buf,
add i32 (dread i32 %x, constval i32 2)),
sext i32 16 (dread i32 %v))

but mplfe generates:

LOC 19 193
iassign <* i16> 0 (
add ptr (
dread ptr %buf,
mul ptr (
cvt i64 i32 (add i32 (dread i32 %x_189_14, constval i32 2)),
constval ptr 2)),
sext i32 16 (dread i32 %v_191_13))

mplfe does not use the array opcode, so LFO would not be able to do any vectorization.

Comments (4)

fredchow created任务
Expand operation logs

Since buf is a pointer, I think it is more semantic to use the ptr operation because the [1] of "array 0 a64 <* <[1] i16>>" is misleading, but if it helps performance, mplfe can be modified as suggested.

The modification has been completed according to the description. After CI is passed, it will be synchronized to the community.

the change causes some internal cases fail, clang2mpl behaves the same way. I need to fix other bugs first.

All fixes have been megerd in HW and will be synchronized to the community later today. @fredchow

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(2)
C++
1
https://git.oschina.net/openarkcompiler/OpenArkCompiler.git
git@git.oschina.net:openarkcompiler/OpenArkCompiler.git
openarkcompiler
OpenArkCompiler
OpenArkCompiler

Search

161121 f78d6d6f 1850385 154831 86f8c370 1850385