I have tried to use llvm to translate some programs. Today I saw a weird
- My program has a global pointer @ptr1 = 0. And the constant integer '0' is
stored in value memory at index 64.
"@ptr = weak global i32 0; <i32*>"
- Somewhere in my program, there is a store instruction:
"store i32 %tmp31, i32* @ptr"
it writes %tmp32 into memory, where @ptr pointed to (here: index 64 of value
- Afterward, another instruction needs to load the integer value '0' from
value memory :
"%tmp17 = mul i32 %mb_col, 0"
It will try to read the value memory at index 64, but it is no more '0' but
now %tmp31. So, the result is not correct !
I do not understand, how llvm handled this case. Anybody known it ?
Thanks for any advice