Commit ff687af
authored
[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`.1 parent 54b33eb commit ff687af
File tree
4 files changed
+30
-9
lines changed- clang
- lib/CodeGen
- test/CodeGen
4 files changed
+30
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
593 | 594 | | |
594 | 595 | | |
595 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1919 | 1919 | | |
1920 | 1920 | | |
1921 | 1921 | | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
1922 | 1936 | | |
1923 | 1937 | | |
1924 | 1938 | | |
| |||
2037 | 2051 | | |
2038 | 2052 | | |
2039 | 2053 | | |
2040 | | - | |
2041 | | - | |
2042 | | - | |
2043 | | - | |
2044 | | - | |
2045 | | - | |
2046 | | - | |
2047 | | - | |
2048 | | - | |
| 2054 | + | |
2049 | 2055 | | |
2050 | 2056 | | |
2051 | 2057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5309 | 5309 | | |
5310 | 5310 | | |
5311 | 5311 | | |
| 5312 | + | |
| 5313 | + | |
| 5314 | + | |
5312 | 5315 | | |
5313 | 5316 | | |
5314 | 5317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments