Closed tkoenig1 closed 2 years ago
A shorter test case:
void foo (double *a, double *b, double *c)
{
*a = 42.;
*b = 42.;
*c = 42.;
}
gets translated to
foo: ; @foo
.cfi_startproc
; %bb.0: ; %entry
std #4631107791820423168,[r1]
std #4631107791820423168,[r2]
std #4631107791820423168,[r3]
ret
Fixed in commit aca248511f643f5f50497e1545d8bb9e6e5d4907
I had a few more looks at fatigue2.s from Issue#1, and found another thing that I thought worth mentioning.
In the function read_inputm , there is a code section which reads
(I have no reason why flang likes to store the same constant there over and over again, I just used it to generate test cases because it is the only Fortran compiler I have access which generates LLVM :-)
It would make sense to load the constant -4317352126650676160 into a register and just store it, to the different places it wants to be stored to, without putting it into the instruction stream multiple times.
The original Fortran code, by the way, is initializing quite a few variables with the same value, -1.D_20, it reads like