[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-29 Thread via lldb-commits

lntue wrote:

> #85868

You can update the title of the PR to reflect the changes, and add `Fixes 
https://github.com/llvm/llvm-project/issues/85868` to relating the PR to the 
issue.

OTOH, the libc changes look good to me.

https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-29 Thread Louis Dionne via lldb-commits

https://github.com/ldionne approved this pull request.

The libc++abi changes look fine to me.

https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-29 Thread Alex Langford via lldb-commits

bulbazord wrote:

> > Please update the PR subject as its a lot more than just X86AsmParser.cpp
> 
> Hi @RKSimon
> 
> All the issues mentioned are fixed. The title of the PR is misleading. The 
> title is the same as the issue (#85868) it corresponds to. Got a look to 
> other PR's and I thought that this is the usual naming convention. Please 
> refer to the 
> [commit](https://github.com/llvm/llvm-project/pull/90391/commits/54c6c6b7d71f5ff293412f5f91e9f880480284f8)
>  and you will see all the modified files.

Commit titles should accurately reflect a change. Your change modifies more 
than just X86AsmParser.cpp, so reading the commit title alone might lead one to 
believe that's all that changed. But it's not, you changed many things across 
the code base (even if the changes are all of the same kind). A more accurate 
title might be something like: `Add clarifying parenthesis around non-trivial 
conditions in ternary expressions`.

https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread Mehdi Amini via lldb-commits

joker-eph wrote:

PR should be named according to what they are actually achieving, I'm not sure 
why the GitHub issue title is relevant?

https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread via lldb-commits

luolent wrote:

> Please update the PR subject as its a lot more than just X86AsmParser.cpp

Hi @RKSimon 

All the issues mentioned are fixed. The tile of the PR is misleading. 
The title is the same as the issue (#85868) it corresponds to.
Got a look to other PR's and I thought that this is the usual naming convention.
Please refer to the 
[commit](https://github.com/llvm/llvm-project/pull/90391/commits/54c6c6b7d71f5ff293412f5f91e9f880480284f8)
 and you will see all the modified files.

https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread via lldb-commits

https://github.com/luolent updated 
https://github.com/llvm/llvm-project/pull/90391

>From 54c6c6b7d71f5ff293412f5f91e9f880480284f8 Mon Sep 17 00:00:00 2001
From: luolent 
Date: Sat, 27 Apr 2024 22:17:58 +0300
Subject: [PATCH] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking
 () for clarity

---
 clang/lib/Basic/Targets/AMDGPU.cpp|  2 +-
 compiler-rt/lib/xray/xray_utils.h |  2 +-
 libc/src/__support/FPUtil/aarch64/FEnvImpl.h  | 20 
 .../FPUtil/aarch64/fenv_darwin_impl.h | 48 +--
 libc/src/__support/FPUtil/arm/FEnvImpl.h  | 40 
 libc/src/__support/FPUtil/riscv/FEnvImpl.h| 20 
 libc/src/__support/FPUtil/x86_64/FEnvImpl.h   | 24 +-
 libclc/generic/lib/math/log_base.h|  2 +-
 libcxxabi/src/cxa_personality.cpp |  4 +-
 lld/ELF/LinkerScript.cpp  |  2 +-
 .../source/MacOSX/MachException.cpp   |  2 +-
 .../AMDGPU/AsmParser/AMDGPUAsmParser.cpp  |  4 +-
 .../Disassembler/AMDGPUDisassembler.cpp   |  4 +-
 llvm/lib/Target/AVR/AVRAsmPrinter.cpp |  4 +-
 llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp  |  4 +-
 .../lib/Target/X86/AsmParser/X86AsmParser.cpp |  2 +-
 .../X86/MCTargetDesc/X86MCCodeEmitter.cpp |  2 +-
 .../Transforms/TosaDecomposeTransposeConv.cpp |  4 +-
 18 files changed, 94 insertions(+), 96 deletions(-)

diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp 
b/clang/lib/Basic/Targets/AMDGPU.cpp
index 5742885df0461b..cc7be64656e5b2 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -232,7 +232,7 @@ AMDGPUTargetInfo::AMDGPUTargetInfo(const llvm::Triple 
,
 
   HasLegalHalfType = true;
   HasFloat16 = true;
-  WavefrontSize = GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32 ? 32 : 64;
+  WavefrontSize = (GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32) ? 32 : 64;
   AllowAMDGPUUnsafeFPAtomics = Opts.AllowAMDGPUUnsafeFPAtomics;
 
   // Set pointer width and alignment for the generic address space.
diff --git a/compiler-rt/lib/xray/xray_utils.h 
b/compiler-rt/lib/xray/xray_utils.h
index 333826168c0db2..5dc73d7fa8cdea 100644
--- a/compiler-rt/lib/xray/xray_utils.h
+++ b/compiler-rt/lib/xray/xray_utils.h
@@ -61,7 +61,7 @@ constexpr size_t gcd(size_t a, size_t b) {
 constexpr size_t lcm(size_t a, size_t b) { return a * b / gcd(a, b); }
 
 constexpr size_t nearest_boundary(size_t number, size_t multiple) {
-  return multiple * ((number / multiple) + (number % multiple ? 1 : 0));
+  return multiple * ((number / multiple) + ((number % multiple) ? 1 : 0));
 }
 
 constexpr size_t next_pow2_helper(size_t num, size_t acc) {
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h 
b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index d1d92169475d15..cd8a5970edd65a 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -53,19 +53,19 @@ struct FEnv {
   static constexpr uint32_t ExceptionControlFlagsBitPosition = 8;
 
   LIBC_INLINE static uint32_t getStatusValueForExcept(int excepts) {
-return (excepts & FE_INVALID ? INVALID : 0) |
-   (excepts & FE_DIVBYZERO ? DIVBYZERO : 0) |
-   (excepts & FE_OVERFLOW ? OVERFLOW : 0) |
-   (excepts & FE_UNDERFLOW ? UNDERFLOW : 0) |
-   (excepts & FE_INEXACT ? INEXACT : 0);
+return ((excepts & FE_INVALID) ? INVALID : 0) |
+   ((excepts & FE_DIVBYZERO) ? DIVBYZERO : 0) |
+   ((excepts & FE_OVERFLOW) ? OVERFLOW : 0) |
+   ((excepts & FE_UNDERFLOW) ? UNDERFLOW : 0) |
+   ((excepts & FE_INEXACT) ? INEXACT : 0);
   }
 
   LIBC_INLINE static int exceptionStatusToMacro(uint32_t status) {
-return (status & INVALID ? FE_INVALID : 0) |
-   (status & DIVBYZERO ? FE_DIVBYZERO : 0) |
-   (status & OVERFLOW ? FE_OVERFLOW : 0) |
-   (status & UNDERFLOW ? FE_UNDERFLOW : 0) |
-   (status & INEXACT ? FE_INEXACT : 0);
+return ((status & INVALID) ? FE_INVALID : 0) |
+   ((status & DIVBYZERO) ? FE_DIVBYZERO : 0) |
+   ((status & OVERFLOW) ? FE_OVERFLOW : 0) |
+   ((status & UNDERFLOW) ? FE_UNDERFLOW : 0) |
+   ((status & INEXACT) ? FE_INEXACT : 0);
   }
 
   static uint32_t getControlWord() {
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h 
b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index 5b59ba38d67bb6..feb48e3719bf16 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -63,39 +63,39 @@ struct FEnv {
   // located in a different place from FE_FLUSHTOZERO status bit relative to
   // the other exceptions.
   LIBC_INLINE static uint32_t exception_value_from_status(int status) {
-return (status & FE_INVALID ? EX_INVALID : 0) |
-   (status & FE_DIVBYZERO ? EX_DIVBYZERO : 0) |
-   (status & FE_OVERFLOW ? EX_OVERFLOW : 0) |
-   (status & FE_UNDERFLOW ? EX_UNDERFLOW : 0) |
-  

[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread via lldb-commits

https://github.com/luolent updated 
https://github.com/llvm/llvm-project/pull/90391

>From 2a6b6a3b160ae49b20da6c8cc9f8d858ddb598eb Mon Sep 17 00:00:00 2001
From: luolent 
Date: Sat, 27 Apr 2024 22:17:58 +0300
Subject: [PATCH] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking
 () for clarity

---
 clang/lib/Basic/Targets/AMDGPU.cpp|  2 +-
 compiler-rt/lib/xray/xray_utils.h |  2 +-
 libc/src/__support/FPUtil/aarch64/FEnvImpl.h  | 20 
 .../FPUtil/aarch64/fenv_darwin_impl.h | 48 +--
 libc/src/__support/FPUtil/arm/FEnvImpl.h  | 40 
 libc/src/__support/FPUtil/riscv/FEnvImpl.h| 20 
 libc/src/__support/FPUtil/x86_64/FEnvImpl.h   | 24 +-
 libclc/generic/lib/math/log_base.h|  2 +-
 libcxxabi/src/cxa_personality.cpp |  4 +-
 lld/ELF/LinkerScript.cpp  |  2 +-
 .../source/MacOSX/MachException.cpp   |  2 +-
 .../AMDGPU/AsmParser/AMDGPUAsmParser.cpp  |  4 +-
 .../Disassembler/AMDGPUDisassembler.cpp   |  4 +-
 llvm/lib/Target/AVR/AVRAsmPrinter.cpp |  4 +-
 llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp  |  4 +-
 .../lib/Target/X86/AsmParser/X86AsmParser.cpp |  2 +-
 .../X86/MCTargetDesc/X86MCCodeEmitter.cpp |  2 +-
 .../Transforms/TosaDecomposeTransposeConv.cpp |  4 +-
 18 files changed, 94 insertions(+), 96 deletions(-)

diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp 
b/clang/lib/Basic/Targets/AMDGPU.cpp
index 5742885df0461b..cc7be64656e5b2 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -232,7 +232,7 @@ AMDGPUTargetInfo::AMDGPUTargetInfo(const llvm::Triple 
,
 
   HasLegalHalfType = true;
   HasFloat16 = true;
-  WavefrontSize = GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32 ? 32 : 64;
+  WavefrontSize = (GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32) ? 32 : 64;
   AllowAMDGPUUnsafeFPAtomics = Opts.AllowAMDGPUUnsafeFPAtomics;
 
   // Set pointer width and alignment for the generic address space.
diff --git a/compiler-rt/lib/xray/xray_utils.h 
b/compiler-rt/lib/xray/xray_utils.h
index 333826168c0db2..5dc73d7fa8cdea 100644
--- a/compiler-rt/lib/xray/xray_utils.h
+++ b/compiler-rt/lib/xray/xray_utils.h
@@ -61,7 +61,7 @@ constexpr size_t gcd(size_t a, size_t b) {
 constexpr size_t lcm(size_t a, size_t b) { return a * b / gcd(a, b); }
 
 constexpr size_t nearest_boundary(size_t number, size_t multiple) {
-  return multiple * ((number / multiple) + (number % multiple ? 1 : 0));
+  return multiple * ((number / multiple) + ((number % multiple) ? 1 : 0));
 }
 
 constexpr size_t next_pow2_helper(size_t num, size_t acc) {
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h 
b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index d1d92169475d15..cd8a5970edd65a 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -53,19 +53,19 @@ struct FEnv {
   static constexpr uint32_t ExceptionControlFlagsBitPosition = 8;
 
   LIBC_INLINE static uint32_t getStatusValueForExcept(int excepts) {
-return (excepts & FE_INVALID ? INVALID : 0) |
-   (excepts & FE_DIVBYZERO ? DIVBYZERO : 0) |
-   (excepts & FE_OVERFLOW ? OVERFLOW : 0) |
-   (excepts & FE_UNDERFLOW ? UNDERFLOW : 0) |
-   (excepts & FE_INEXACT ? INEXACT : 0);
+return ((excepts & FE_INVALID) ? INVALID : 0) |
+   ((excepts & FE_DIVBYZERO) ? DIVBYZERO : 0) |
+   ((excepts & FE_OVERFLOW) ? OVERFLOW : 0) |
+   ((excepts & FE_UNDERFLOW) ? UNDERFLOW : 0) |
+   ((excepts & FE_INEXACT) ? INEXACT : 0);
   }
 
   LIBC_INLINE static int exceptionStatusToMacro(uint32_t status) {
-return (status & INVALID ? FE_INVALID : 0) |
-   (status & DIVBYZERO ? FE_DIVBYZERO : 0) |
-   (status & OVERFLOW ? FE_OVERFLOW : 0) |
-   (status & UNDERFLOW ? FE_UNDERFLOW : 0) |
-   (status & INEXACT ? FE_INEXACT : 0);
+return ((status & INVALID) ? FE_INVALID : 0) |
+   ((status & DIVBYZERO) ? FE_DIVBYZERO : 0) |
+   ((status & OVERFLOW) ? FE_OVERFLOW : 0) |
+   ((status & UNDERFLOW) ? FE_UNDERFLOW : 0) |
+   ((status & INEXACT) ? FE_INEXACT : 0);
   }
 
   static uint32_t getControlWord() {
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h 
b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index 5b59ba38d67bb6..feb48e3719bf16 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -63,39 +63,39 @@ struct FEnv {
   // located in a different place from FE_FLUSHTOZERO status bit relative to
   // the other exceptions.
   LIBC_INLINE static uint32_t exception_value_from_status(int status) {
-return (status & FE_INVALID ? EX_INVALID : 0) |
-   (status & FE_DIVBYZERO ? EX_DIVBYZERO : 0) |
-   (status & FE_OVERFLOW ? EX_OVERFLOW : 0) |
-   (status & FE_UNDERFLOW ? EX_UNDERFLOW : 0) |
-  

[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread Simon Pilgrim via lldb-commits

https://github.com/RKSimon commented:

Please address the clang-format warnings the CI has reported

https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread via lldb-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff 738c135ee09de66a26805530d314c2f28d1eca02 
f860432b9434c81ab55d5eded9c976edc58c3fab -- clang/lib/Basic/Targets/AMDGPU.cpp 
compiler-rt/lib/xray/xray_utils.h libc/src/__support/FPUtil/aarch64/FEnvImpl.h 
libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h 
libc/src/__support/FPUtil/arm/FEnvImpl.h 
libc/src/__support/FPUtil/riscv/FEnvImpl.h 
libc/src/__support/FPUtil/x86_64/FEnvImpl.h libclc/generic/lib/math/log_base.h 
libcxxabi/src/cxa_personality.cpp lld/ELF/LinkerScript.cpp 
lldb/tools/debugserver/source/MacOSX/MachException.cpp 
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp 
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp 
llvm/lib/Target/AVR/AVRAsmPrinter.cpp 
llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp 
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp 
llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp 
mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp
``





View the diff from clang-format here.


``diff
diff --git a/libcxxabi/src/cxa_personality.cpp 
b/libcxxabi/src/cxa_personality.cpp
index 8f7914a8c6..d95d781319 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -717,9 +717,7 @@ static void scan_eh_tab(scan_results , 
_Unwind_Action actions,
 if (actionEntry == 0)
 {
 // Found a cleanup
-results.reason = (actions & _UA_SEARCH_PHASE)
- ? _URC_CONTINUE_UNWIND
- : _URC_HANDLER_FOUND;
+results.reason = (actions & _UA_SEARCH_PHASE) ? 
_URC_CONTINUE_UNWIND : _URC_HANDLER_FOUND;
 return;
 }
 // Convert 1-based byte offset into
diff --git a/llvm/lib/Target/AVR/AVRAsmPrinter.cpp 
b/llvm/lib/Target/AVR/AVRAsmPrinter.cpp
index 0c7df65a42..aaec545fc1 100644
--- a/llvm/lib/Target/AVR/AVRAsmPrinter.cpp
+++ b/llvm/lib/Target/AVR/AVRAsmPrinter.cpp
@@ -134,8 +134,8 @@ bool AVRAsmPrinter::PrintAsmOperand(const MachineInstr *MI, 
unsigned OpNum,
 Reg = MI->getOperand(OpNum + RegIdx).getReg();
 
 if (BytesPerReg == 2) {
-  Reg = TRI.getSubReg(Reg,
-  (ByteNumber % BytesPerReg) ? AVR::sub_hi : 
AVR::sub_lo);
+  Reg = TRI.getSubReg(Reg, (ByteNumber % BytesPerReg) ? AVR::sub_hi
+  : AVR::sub_lo);
 }
 
 O << AVRInstPrinter::getPrettyRegisterName(Reg, MRI);

``




https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread Simon Pilgrim via lldb-commits

https://github.com/RKSimon commented:

Please update the PR subject as its a lot more than just X86AsmParser.cpp

https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread via lldb-commits

llvmbot wrote:



@llvm/pr-subscribers-backend-systemz
@llvm/pr-subscribers-backend-amdgpu

@llvm/pr-subscribers-clang

Author: None (luolent)


Changes

Hi,

parenthesis were added as requested on ternary operators with non trivial 
conditions.
I used this [precedence 
table](https://en.cppreference.com/w/cpp/language/operator_precedence) to make 
sure we get the expected behavior on each change.

There is also a discussion on the issue, about creating a pass in clang-tidy in 
order to catch these missing parenthesis automatically.
Let me know if the above is desired and I can take it over.

Thanks!

---

Patch is 21.90 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/90391.diff


18 Files Affected:

- (modified) clang/lib/Basic/Targets/AMDGPU.cpp (+1-1) 
- (modified) compiler-rt/lib/xray/xray_utils.h (+1-1) 
- (modified) libc/src/__support/FPUtil/aarch64/FEnvImpl.h (+10-10) 
- (modified) libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h (+24-24) 
- (modified) libc/src/__support/FPUtil/arm/FEnvImpl.h (+20-20) 
- (modified) libc/src/__support/FPUtil/riscv/FEnvImpl.h (+10-10) 
- (modified) libc/src/__support/FPUtil/x86_64/FEnvImpl.h (+12-12) 
- (modified) libclc/generic/lib/math/log_base.h (+1-1) 
- (modified) libcxxabi/src/cxa_personality.cpp (+1-1) 
- (modified) lld/ELF/LinkerScript.cpp (+1-1) 
- (modified) lldb/tools/debugserver/source/MacOSX/MachException.cpp (+1-1) 
- (modified) llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (+2-2) 
- (modified) llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp (+2-2) 
- (modified) llvm/lib/Target/AVR/AVRAsmPrinter.cpp (+1-1) 
- (modified) llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp (+2-2) 
- (modified) llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp (+1-1) 
- (modified) llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp (+1-1) 
- (modified) mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp 
(+2-2) 


``diff
diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp 
b/clang/lib/Basic/Targets/AMDGPU.cpp
index 5742885df0461b..cc7be64656e5b2 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -232,7 +232,7 @@ AMDGPUTargetInfo::AMDGPUTargetInfo(const llvm::Triple 
,
 
   HasLegalHalfType = true;
   HasFloat16 = true;
-  WavefrontSize = GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32 ? 32 : 64;
+  WavefrontSize = (GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32) ? 32 : 64;
   AllowAMDGPUUnsafeFPAtomics = Opts.AllowAMDGPUUnsafeFPAtomics;
 
   // Set pointer width and alignment for the generic address space.
diff --git a/compiler-rt/lib/xray/xray_utils.h 
b/compiler-rt/lib/xray/xray_utils.h
index 333826168c0db2..5dc73d7fa8cdea 100644
--- a/compiler-rt/lib/xray/xray_utils.h
+++ b/compiler-rt/lib/xray/xray_utils.h
@@ -61,7 +61,7 @@ constexpr size_t gcd(size_t a, size_t b) {
 constexpr size_t lcm(size_t a, size_t b) { return a * b / gcd(a, b); }
 
 constexpr size_t nearest_boundary(size_t number, size_t multiple) {
-  return multiple * ((number / multiple) + (number % multiple ? 1 : 0));
+  return multiple * ((number / multiple) + ((number % multiple) ? 1 : 0));
 }
 
 constexpr size_t next_pow2_helper(size_t num, size_t acc) {
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h 
b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index d1d92169475d15..cd8a5970edd65a 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -53,19 +53,19 @@ struct FEnv {
   static constexpr uint32_t ExceptionControlFlagsBitPosition = 8;
 
   LIBC_INLINE static uint32_t getStatusValueForExcept(int excepts) {
-return (excepts & FE_INVALID ? INVALID : 0) |
-   (excepts & FE_DIVBYZERO ? DIVBYZERO : 0) |
-   (excepts & FE_OVERFLOW ? OVERFLOW : 0) |
-   (excepts & FE_UNDERFLOW ? UNDERFLOW : 0) |
-   (excepts & FE_INEXACT ? INEXACT : 0);
+return ((excepts & FE_INVALID) ? INVALID : 0) |
+   ((excepts & FE_DIVBYZERO) ? DIVBYZERO : 0) |
+   ((excepts & FE_OVERFLOW) ? OVERFLOW : 0) |
+   ((excepts & FE_UNDERFLOW) ? UNDERFLOW : 0) |
+   ((excepts & FE_INEXACT) ? INEXACT : 0);
   }
 
   LIBC_INLINE static int exceptionStatusToMacro(uint32_t status) {
-return (status & INVALID ? FE_INVALID : 0) |
-   (status & DIVBYZERO ? FE_DIVBYZERO : 0) |
-   (status & OVERFLOW ? FE_OVERFLOW : 0) |
-   (status & UNDERFLOW ? FE_UNDERFLOW : 0) |
-   (status & INEXACT ? FE_INEXACT : 0);
+return ((status & INVALID) ? FE_INVALID : 0) |
+   ((status & DIVBYZERO) ? FE_DIVBYZERO : 0) |
+   ((status & OVERFLOW) ? FE_OVERFLOW : 0) |
+   ((status & UNDERFLOW) ? FE_UNDERFLOW : 0) |
+   ((status & INEXACT) ? FE_INEXACT : 0);
   }
 
   static uint32_t getControlWord() {
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h 
b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index 5b59ba38d67bb6..feb48e3719bf16 100644
--- 

[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread via lldb-commits

github-actions[bot] wrote:



Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this 
page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using `@` followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from 
other developers.

If you have further questions, they may be answered by the [LLVM GitHub User 
Guide](https://llvm.org/docs/GitHub.html).

You can also ask questions in a comment on this PR, on the [LLVM 
Discord](https://discord.com/invite/xS7Z362) or on the 
[forums](https://discourse.llvm.org/).

https://github.com/llvm/llvm-project/pull/90391
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for c… (PR #90391)

2024-04-28 Thread via lldb-commits

https://github.com/luolent created 
https://github.com/llvm/llvm-project/pull/90391

Hi,

parenthesis were added as requested on ternary operators with non trivial 
conditions.
I used this [precedence 
table](https://en.cppreference.com/w/cpp/language/operator_precedence) to make 
sure we get the expected behavior on each change.

There is also a discussion on the issue, about creating a pass in clang-tidy in 
order to catch these missing parenthesis automatically.
Let me know if the above is desired and I can take it over.

Thanks!

>From f860432b9434c81ab55d5eded9c976edc58c3fab Mon Sep 17 00:00:00 2001
From: luolent 
Date: Sat, 27 Apr 2024 22:17:58 +0300
Subject: [PATCH] llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking
 () for clarity

---
 clang/lib/Basic/Targets/AMDGPU.cpp|  2 +-
 compiler-rt/lib/xray/xray_utils.h |  2 +-
 libc/src/__support/FPUtil/aarch64/FEnvImpl.h  | 20 
 .../FPUtil/aarch64/fenv_darwin_impl.h | 48 +--
 libc/src/__support/FPUtil/arm/FEnvImpl.h  | 40 
 libc/src/__support/FPUtil/riscv/FEnvImpl.h| 20 
 libc/src/__support/FPUtil/x86_64/FEnvImpl.h   | 24 +-
 libclc/generic/lib/math/log_base.h|  2 +-
 libcxxabi/src/cxa_personality.cpp |  2 +-
 lld/ELF/LinkerScript.cpp  |  2 +-
 .../source/MacOSX/MachException.cpp   |  2 +-
 .../AMDGPU/AsmParser/AMDGPUAsmParser.cpp  |  4 +-
 .../Disassembler/AMDGPUDisassembler.cpp   |  4 +-
 llvm/lib/Target/AVR/AVRAsmPrinter.cpp |  2 +-
 llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp  |  4 +-
 .../lib/Target/X86/AsmParser/X86AsmParser.cpp |  2 +-
 .../X86/MCTargetDesc/X86MCCodeEmitter.cpp |  2 +-
 .../Transforms/TosaDecomposeTransposeConv.cpp |  4 +-
 18 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp 
b/clang/lib/Basic/Targets/AMDGPU.cpp
index 5742885df0461b..cc7be64656e5b2 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -232,7 +232,7 @@ AMDGPUTargetInfo::AMDGPUTargetInfo(const llvm::Triple 
,
 
   HasLegalHalfType = true;
   HasFloat16 = true;
-  WavefrontSize = GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32 ? 32 : 64;
+  WavefrontSize = (GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32) ? 32 : 64;
   AllowAMDGPUUnsafeFPAtomics = Opts.AllowAMDGPUUnsafeFPAtomics;
 
   // Set pointer width and alignment for the generic address space.
diff --git a/compiler-rt/lib/xray/xray_utils.h 
b/compiler-rt/lib/xray/xray_utils.h
index 333826168c0db2..5dc73d7fa8cdea 100644
--- a/compiler-rt/lib/xray/xray_utils.h
+++ b/compiler-rt/lib/xray/xray_utils.h
@@ -61,7 +61,7 @@ constexpr size_t gcd(size_t a, size_t b) {
 constexpr size_t lcm(size_t a, size_t b) { return a * b / gcd(a, b); }
 
 constexpr size_t nearest_boundary(size_t number, size_t multiple) {
-  return multiple * ((number / multiple) + (number % multiple ? 1 : 0));
+  return multiple * ((number / multiple) + ((number % multiple) ? 1 : 0));
 }
 
 constexpr size_t next_pow2_helper(size_t num, size_t acc) {
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h 
b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index d1d92169475d15..cd8a5970edd65a 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -53,19 +53,19 @@ struct FEnv {
   static constexpr uint32_t ExceptionControlFlagsBitPosition = 8;
 
   LIBC_INLINE static uint32_t getStatusValueForExcept(int excepts) {
-return (excepts & FE_INVALID ? INVALID : 0) |
-   (excepts & FE_DIVBYZERO ? DIVBYZERO : 0) |
-   (excepts & FE_OVERFLOW ? OVERFLOW : 0) |
-   (excepts & FE_UNDERFLOW ? UNDERFLOW : 0) |
-   (excepts & FE_INEXACT ? INEXACT : 0);
+return ((excepts & FE_INVALID) ? INVALID : 0) |
+   ((excepts & FE_DIVBYZERO) ? DIVBYZERO : 0) |
+   ((excepts & FE_OVERFLOW) ? OVERFLOW : 0) |
+   ((excepts & FE_UNDERFLOW) ? UNDERFLOW : 0) |
+   ((excepts & FE_INEXACT) ? INEXACT : 0);
   }
 
   LIBC_INLINE static int exceptionStatusToMacro(uint32_t status) {
-return (status & INVALID ? FE_INVALID : 0) |
-   (status & DIVBYZERO ? FE_DIVBYZERO : 0) |
-   (status & OVERFLOW ? FE_OVERFLOW : 0) |
-   (status & UNDERFLOW ? FE_UNDERFLOW : 0) |
-   (status & INEXACT ? FE_INEXACT : 0);
+return ((status & INVALID) ? FE_INVALID : 0) |
+   ((status & DIVBYZERO) ? FE_DIVBYZERO : 0) |
+   ((status & OVERFLOW) ? FE_OVERFLOW : 0) |
+   ((status & UNDERFLOW) ? FE_UNDERFLOW : 0) |
+   ((status & INEXACT) ? FE_INEXACT : 0);
   }
 
   static uint32_t getControlWord() {
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h 
b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index 5b59ba38d67bb6..feb48e3719bf16 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++