diff options
author | Krzysztof Parzyszek <Krzysztof.Parzyszek@amd.com> | 2025-08-13 15:53:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-13 15:53:59 -0500 |
commit | 1e7772abcbe1ccf3fd6f2bdf5216f3dabeb55c94 (patch) | |
tree | 9f401f6833d487adf27b5c3249e68ad8f9d214c3 /llvm/lib/ObjCopy/ELF/ELFObject.cpp | |
parent | af87214b849ba064dbe6dc13972b29cc49662fd2 (diff) | |
download | llvm-1e7772abcbe1ccf3fd6f2bdf5216f3dabeb55c94.zip llvm-1e7772abcbe1ccf3fd6f2bdf5216f3dabeb55c94.tar.gz llvm-1e7772abcbe1ccf3fd6f2bdf5216f3dabeb55c94.tar.bz2 |
[flang][OpenMP] Reassociate ATOMIC update expressions (#153488)
An atomic update expression of form
x = x + a + b
is technically illegal, since the right-hand side is parsed as (x+a)+b,
and the atomic variable x should be an argument to the top-level +. When
the type of x is integer, the result of (x+a)+b is guaranteed to be the
same as x+(a+b), so instead of reporting an error, the compiler can
treat (x+a)+b as x+(a+b).
This PR implements this kind of reassociation for integral types, and
for the two arithmetic associative/commutative operators: + and *.
Reinstate PR153098 one more time with fixes for the issues that came up:
- unused variable "lsrc",
- use of ‘outer1’ before deduction of ‘auto’.
Diffstat (limited to 'llvm/lib/ObjCopy/ELF/ELFObject.cpp')
0 files changed, 0 insertions, 0 deletions