[all-commits] [llvm/llvm-project] 316664: [AVR] Fix atomicrmw result value

Ayke via All-commits all-commits at lists.llvm.org
Wed Feb 2 00:11:00 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 316664783df8061b39febeef4c800c85f735eef1
      https://github.com/llvm/llvm-project/commit/316664783df8061b39febeef4c800c85f735eef1
  Author: Ayke van Laethem <aykevanlaethem at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
    M llvm/lib/Target/AVR/AVRFrameLowering.cpp
    M llvm/lib/Target/AVR/AVRISelLowering.cpp
    M llvm/lib/Target/AVR/AVRISelLowering.h
    M llvm/lib/Target/AVR/AVRInstrInfo.td
    M llvm/lib/Target/AVR/AVRRegisterInfo.cpp
    M llvm/lib/Target/AVR/AVRSubtarget.h
    M llvm/test/CodeGen/AVR/atomics/load16.ll
    M llvm/test/CodeGen/AVR/atomics/load8.ll

  Log Message:
  -----------
  [AVR] Fix atomicrmw result value

This patch fixes the atomicrmw result value to be the value before the
operation instead of the value after the operation. This was a bug, left
as a FIXME in the code (see https://reviews.llvm.org/D97127).

>From the LangRef:

> The contents of memory at the location specified by the <pointer>
> operand are atomically read, modified, and written back. The original
> value at the location is returned.

Doing this expansion early allows the register allocator to arrange
registers in such a way that commutable operations are simply swapped
around as needed, which results in shorter code while still being
correct.

Differential Revision: https://reviews.llvm.org/D117725


  Commit: 44ee9864a4569cfb568781c408b7d7f5fd3f2b2d
      https://github.com/llvm/llvm-project/commit/44ee9864a4569cfb568781c408b7d7f5fd3f2b2d
  Author: Ayke van Laethem <aykevanlaethem at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M llvm/test/CodeGen/AVR/atomics/load16.ll

  Log Message:
  -----------
  [AVR][NFC] Make atomics tests easier to read

Use the same mnemonics in the tests that are used in the AtomicLoadOp
pattern ($rd, $rr) but use RR1 instead of $operand. This matches similar
tests in load8.ll.

Differential Revision: https://reviews.llvm.org/D117991


Compare: https://github.com/llvm/llvm-project/compare/a2601c988733...44ee9864a456


More information about the All-commits mailing list