[clang] [clang][CodeGen] Add range metadata for atomic load of boolean type. #131476 (PR #133546)

2025-03-31 Thread Jan Górski via cfe-commits
https://github.com/janagor edited https://github.com/llvm/llvm-project/pull/133546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add range metadata for atomic load of boolean type. #131476 (PR #133546)

2025-03-29 Thread Jan Górski via cfe-commits
https://github.com/janagor edited https://github.com/llvm/llvm-project/pull/133546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add range metadata for atomic load of boolean type. #131476 (PR #133546)

2025-03-29 Thread Jan Górski via cfe-commits
https://github.com/janagor created https://github.com/llvm/llvm-project/pull/133546 Addresses #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 f

[clang] [llvm] [RISC-V] extra andi instruction when loading a bool atomically #131476 (PR #133406)

2025-03-28 Thread Jan Górski via cfe-commits
janagor wrote: Ahh, I see, thanks for info. I will close this this PR and split into two different PR's. https://github.com/llvm/llvm-project/pull/133406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [llvm] [RISC-V] extra andi instruction when loading a bool atomically #131476 (PR #133406)

2025-03-28 Thread Jan Górski via cfe-commits
https://github.com/janagor closed https://github.com/llvm/llvm-project/pull/133406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISC-V] extra andi instruction when loading a bool atomically #131476 (PR #133406)

2025-03-28 Thread Jan Górski via cfe-commits
https://github.com/janagor created https://github.com/llvm/llvm-project/pull/133406 Fixes #131476 In `EmitAtomicOp` for `AtomicLoad` case added ` !range` metadata when encountered boolean type. This results in in generation `trunc nuw` instruction instead of `trunc`. In `RISCVTargetLowering: