[all-commits] [llvm/llvm-project] ff687a: [clang][CodeGen] Add range metadata for atomic loa...

Jan Górski via All-commits all-commits at lists.llvm.org
Mon Apr 14 14:26:33 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff687af04f5b0e85305250587b524cb0b3849aa0
      https://github.com/llvm/llvm-project/commit/ff687af04f5b0e85305250587b524cb0b3849aa0
  Author: Jan Górski <jan.a.gorski at wp.pl>
  Date:   2025-04-14 (Mon, 14 Apr 2025)

  Changed paths:
    M clang/lib/CodeGen/CGAtomic.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    A clang/test/CodeGen/atomic-ops-load.c

  Log Message:
  -----------
  [clang][CodeGen] Add range metadata for atomic load of boolean type. #131476 (#133546)

Fixes #131476.

For `x86_64` it folds
```
movzbl	t1(%rip), %eax
andb	$1, %al
```
into
```
movzbl	t1(%rip), %eax
```
when run: `clang -S atomic-ops-load.c -o atomic-ops-load.s -O1
--target=x86_64`.

But for riscv replaces:
```
lb	a0, %lo(t1)(a0)
andi	a0, a0, 1
```
with
```
lb	a0, %lo(t1)(a0)
zext.b	a0, a0
``` 
when run: `clang -S atomic-ops-load.c -o atomic-ops-load.s -O1
--target=riscv64`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list