Hi folks,
Moving the discussion to llvm.dev.
None of the changes we talked earlier help.
Find attached the C source code that you can use to reproduce the issue.
clang --target=aarch64-linux-gnu -c -mcpu=cortex-a57 -Ofast -fno-math-errno test.c -S -o test.s -mllvm -debug-only=licm
LICM hoisting to while.body.lr.ph: %21 = load double** %arrayidx8, align 8, !tbaa !5
LICM hoisting to while.body.lr.ph: %arrayidx72 = getelementptr inbounds double* %11, i64 1
LICM hoisting to while.body.lr.ph: %arrayidx81 = getelementptr inbounds double* %11, i64 2
LICM hoisting to for.body.lr.ph: %2 = ptrtoint i32* %Index to i64
clang --target=aarch64-linux-gnu -c -mcpu=cortex-a57 -Ofast -fno-math-errno test.c -S -o test-cflaa.s -mllvm -use-cfl-aa -mllvm -debug-only=licm
LICM hoisting to for.body.lr.ph: %2 = ptrtoint i32* %Index to i64
Why CFL AA cannot allow hoisting this out: %21 = load double** %arrayidx8, align 8, !tbaa !5
Which leads to this extra load in assembly code: ldr x14, [x4, x9, lsl #3]
Thanks!
Ana.
test.c (582 Bytes)