LLVM/project c8d7e53llvm/include/llvm/Support KnownFPClass.h, llvm/lib/Analysis ValueTracking.cpp

InstCombine: Handle canonicalize in SimplifyDemandedFPClass (#173189)

DeltaFile
+22-45llvm/test/Transforms/InstCombine/simplify-demanded-fpclass-canonicalize.ll
+61-0llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+5-47llvm/lib/Analysis/ValueTracking.cpp
+50-0llvm/lib/Support/KnownFPClass.cpp
+6-0llvm/include/llvm/Support/KnownFPClass.h
+144-925 files

LLVM/project 10e152bllvm/lib/Target/X86 X86AvoidTrailingCall.cpp X86DynAllocaExpander.cpp

[X86][NewPM] Consistently preserve IR analyses in MF passes (#173759)

DeltaFile
+1-3llvm/lib/Target/X86/X86AvoidTrailingCall.cpp
+1-3llvm/lib/Target/X86/X86DynAllocaExpander.cpp
+1-3llvm/lib/Target/X86/X86FloatingPoint.cpp
+3-93 files

LLVM/project 78dd3baclang/lib/Driver Driver.cpp, clang/test/Driver spirv-amd-toolchain.c

[Driver][SPIRV] Fix regular C/C++ compilation to AMD SPIRV.

Commit 4c6f398 introduced a non-working compilation path for regular C/C++ to AMD SPIRV; this commit fixes it.
For example, 4c6f398 was expecting an assembler phase but it was never supported since there is no assembler available for it.
Thus, the compilation starting from source code failed.

The compilation path is fixed by taking into account that we cannot rely on external dependencies such as spirv-link or spirv-as.
Thus, the backend emits bitcode and the SPIRVAMDToolChain's linker takes care of generating the final SPIRV as we already do for HIP.
DeltaFile
+14-3clang/test/Driver/spirv-amd-toolchain.c
+12-0clang/lib/Driver/Driver.cpp
+26-32 files

LLVM/project 97b44d4clang/lib/Driver Driver.cpp, clang/test/Driver spirv-amd-toolchain.c

[Driver][SPIRV] Fix regular C/C++ compilation to AMD SPIRV.

Commit 4c6f398 introduced a non-working compilation path for regular C/C++ to AMD SPIRV; this commit fixes it.
For example, 4c6f398 was expecting an assembler phase but it was never supported since there is no assembler available for it.
Thus, the compilation starting from source code failed.

The compilation path is fixed by taking into account that we cannot rely on external dependencies such as spirv-link or spirv-as.
Thus, the backend emits bitcode and the SPIRVAMDToolChain's linker takes care of generating the final SPIRV as we already do for HIP.
DeltaFile
+15-3clang/test/Driver/spirv-amd-toolchain.c
+12-1clang/lib/Driver/Driver.cpp
+27-42 files

LLVM/project bc65c30llvm/lib/Target/RISCV/GISel RISCVRegisterBankInfo.cpp RISCVRegisterBankInfo.h, llvm/test/CodeGen/RISCV/GlobalISel get-register-noreserve.ll legalizer-info-validation.mir

[RISCV][GISel] Support select G_READ_REGISTER and G_WRITE_REGISTER (#173815)

DeltaFile
+46-0llvm/test/CodeGen/RISCV/GlobalISel/get-register-noreserve.ll
+13-0llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp
+6-4llvm/test/CodeGen/RISCV/GlobalISel/legalizer-info-validation.mir
+3-0llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.h
+2-1llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+70-55 files

LLVM/project 843ebcbclang-tools-extra/clang-tidy/readability ImplicitBoolConversionCheck.cpp ImplicitBoolConversionCheck.h, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Enable C99 in `implicit-bool-conversion` and avoid FP with `bool` operands in C23 (#171070)

Closes [#170596](https://github.com/llvm/llvm-project/issues/170596)

---------

Co-authored-by: EugeneZelenko <eugene.zelenko at gmail.com>
Co-authored-by: Baranov Victor <bar.victor.2002 at gmail.com>
DeltaFile
+43-0clang-tools-extra/test/clang-tidy/checkers/readability/implicit-bool-conversion-c99.c
+26-12clang-tools-extra/test/clang-tidy/checkers/readability/implicit-bool-conversion.c
+6-3clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
+4-2clang-tools-extra/docs/ReleaseNotes.rst
+5-0clang-tools-extra/docs/clang-tidy/checks/readability/implicit-bool-conversion.rst
+1-1clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.h
+85-186 files

LLVM/project 57927e9llvm/lib/Transforms/InstCombine InstCombineSelect.cpp, llvm/test/Transforms/InstCombine bit_ceil.ll

[InstCombine] Restrict `foldBitCeil` to power-of-two integer widths (#173849)

The masking rewrite in `foldBitCeil` assumes a power-of-two bitwidth.

For non-power-of-two integer types, `(-ctlz) & (BitWidth - 1)` is not
equivalent to `BitWidth - ctlz` and can miscompile.

This patch restricts the transform to power-of-two bitwidths. 

Alive2 proof: https://alive2.llvm.org/ce/z/i2E6zT

Fixes #173787
DeltaFile
+20-0llvm/test/Transforms/InstCombine/bit_ceil.ll
+2-0llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+22-02 files

LLVM/project 0258aa6clang/lib/Sema SemaHLSL.cpp

[HLSL] Prevent uninitialized on 2 int arguments (#173352)

Unparsed HLSL semantics have 2 int/bool arguments with default values.
Those values are loaded using checkUInt32Argument, and thus this should
never fail.

But if something is wrong in the code above (or the def changed), this
code wouldn't catch it and we'd read uninitialized integers. This
commits checks both return values and assert if one fails. On release
builds, this would early return, causing a bad codegen, but such change
will be caught by tests.
DeltaFile
+5-3clang/lib/Sema/SemaHLSL.cpp
+5-31 files

LLVM/project b6d7d69clang-tools-extra/clang-tidy/modernize UseUsingCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Correct fix-it range for function pointer-like typedef in `modernize-use-using` (#173751)

Extends the function case to all function pointer-like cases, because
their source range contains name.
see more in https://github.com/llvm/llvm-project/pull/65558


Closes [#173732](https://github.com/llvm/llvm-project/issues/173732)
DeltaFile
+24-0clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp
+5-3clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp
+4-0clang-tools-extra/docs/ReleaseNotes.rst
+33-33 files

LLVM/project 137fb1bclang/lib/Lex Lexer.cpp

[NFC][Clang] Remove unused include <tuple> in Lexer.cpp (#173801)

This header was not being used, as found by `Ctrl + F`-ing all the
declarations from `tuple` (found at
https://en.cppreference.com/w/cpp/header/tuple.html).
DeltaFile
+0-1clang/lib/Lex/Lexer.cpp
+0-11 files

LLVM/project 2469d39bolt/lib/Passes PAuthGadgetScanner.cpp

[BOLT] Overhaul the comments in PAuthGadgetScanner for readability (NFC) (#169801)

Update the comments in PAuthGadgetScanner.cpp to better describe the
current version of the code. Along the way, shorten identifier names
that are redundant taking their context into account:
`RegsToTrackInstsFor` (made `RegsToTrack`) and `getNumTrackedRegisters`
(made `getNumRegisters`).

Co-authored-by: Kristof Beyls <kristof.beyls at arm.com>
DeltaFile
+171-111bolt/lib/Passes/PAuthGadgetScanner.cpp
+171-1111 files

LLVM/project 340d3bbllvm/test/FileCheck capture-limit.txt

[FileCheck] Create test to highlight the "more than 9 back-references" issue. (#173501)

When back-referencing more than 9 variables in a CHECK line, FileCheck
will fail.

I intend to fix this issue in a later PR by adjusting FileCheck.
DeltaFile
+8-0llvm/test/FileCheck/capture-limit.txt
+8-01 files

LLVM/project 2d3766allvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/Attributor nofpclass-exp.ll

positive values never denormal
DeltaFile
+8-8llvm/test/Transforms/Attributor/nofpclass-exp.ll
+2-3llvm/lib/Analysis/ValueTracking.cpp
+10-112 files

LLVM/project 956adbdllvm/include/llvm/Support KnownFPClass.h, llvm/lib/Analysis ValueTracking.cpp

Make KnownFPClass::exp not side-effecting
DeltaFile
+9-7llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+5-9llvm/lib/Analysis/ValueTracking.cpp
+5-5llvm/lib/Support/KnownFPClass.cpp
+1-1llvm/include/llvm/Support/KnownFPClass.h
+20-224 files

LLVM/project 0f528e9llvm/lib/Transforms/InstCombine InstCombineSimplifyDemanded.cpp

Use fcPositive
DeltaFile
+1-2llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+1-21 files

LLVM/project bdaddf4llvm/lib/Analysis ValueTracking.cpp

Remove redundant check
DeltaFile
+3-6llvm/lib/Analysis/ValueTracking.cpp
+3-61 files

LLVM/project 6fdbe25llvm/lib/Support KnownFPClass.cpp

Use propagateNaN
DeltaFile
+1-4llvm/lib/Support/KnownFPClass.cpp
+1-41 files

LLVM/project 34a3106llvm/include/llvm/Support KnownFPClass.h, llvm/lib/Analysis ValueTracking.cpp

InstCombine: Handle exp/exp2/exp10 in SimplifyDemandedFPClass

I'm working on optimizing out the tail sequences in the
implementations of the 4 different flavors of pow. These
include chains of selects on the various edge cases.

Related to #64870
DeltaFile
+90-0llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+34-47llvm/test/Transforms/InstCombine/simplify-demanded-fpclass-exp.ll
+24-0llvm/lib/Support/KnownFPClass.cpp
+2-17llvm/lib/Analysis/ValueTracking.cpp
+3-0llvm/include/llvm/Support/KnownFPClass.h
+153-645 files

LLVM/project 0854e1allvm/test/Transforms/InstCombine simplify-demanded-fpclass-exp.ll

InstCombine: Add baseline tests for exp SimplifyDemandedFPClass
DeltaFile
+502-0llvm/test/Transforms/InstCombine/simplify-demanded-fpclass-exp.ll
+502-01 files

LLVM/project 650471cllvm/lib/Analysis ValueTracking.cpp

Adjust comment
DeltaFile
+1-1llvm/lib/Analysis/ValueTracking.cpp
+1-11 files

LLVM/project 37bd647llvm/lib/Transforms/InstCombine InstCombineSimplifyDemanded.cpp, llvm/test/Transforms/InstCombine simplify-demanded-fpclass-canonicalize.ll

Remove broken nan handling
DeltaFile
+4-2llvm/test/Transforms/InstCombine/simplify-demanded-fpclass-canonicalize.ll
+0-5llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+4-72 files

LLVM/project 50298d2llvm/test/Transforms/Attributor nofpclass-exp.ll

ValueTracking: Add baseline tests for computeKnownFPClass exp

This is already handled, but misses opportunities. Test cases
where the input is known positive or negative.
DeltaFile
+101-0llvm/test/Transforms/Attributor/nofpclass-exp.ll
+101-01 files

LLVM/project 1887d02llvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/Attributor nofpclass-exp.ll

ValueTracking: Improve handling of exp intrinsic for overflow

Teach exp handling that positive inputs cannot introduce overflow,
and negative inputs cannot introduce underflow.
DeltaFile
+24-24llvm/test/Transforms/Attributor/nofpclass-exp.ll
+16-0llvm/lib/Analysis/ValueTracking.cpp
+2-2llvm/test/Transforms/Attributor/AMDGPU/nofpclass-amdgcn-exp.ll
+42-263 files

LLVM/project 5d208c7llvm/include/llvm/Support KnownFPClass.h, llvm/lib/Analysis ValueTracking.cpp

Make KnownFPClass::canonicalize not side-effecting
DeltaFile
+16-14llvm/lib/Support/KnownFPClass.cpp
+3-2llvm/include/llvm/Support/KnownFPClass.h
+3-2llvm/lib/Analysis/ValueTracking.cpp
+1-3llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+23-214 files

LLVM/project 74d3750llvm/lib/Transforms/InstCombine InstCombineSimplifyDemanded.cpp

Address comment
DeltaFile
+9-14llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+9-141 files

LLVM/project 78cec52llvm/include/llvm/Support KnownFPClass.h, llvm/lib/Analysis ValueTracking.cpp

InstCombine: Handle canonicalize in SimplifyDemandedFPClass

Doesn't try to handle PositiveZero flushing mode, but I
don't believe it is incorrect with it.
DeltaFile
+73-0llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+24-49llvm/test/Transforms/InstCombine/simplify-demanded-fpclass-canonicalize.ll
+6-49llvm/lib/Analysis/ValueTracking.cpp
+48-0llvm/lib/Support/KnownFPClass.cpp
+5-0llvm/include/llvm/Support/KnownFPClass.h
+156-985 files

LLVM/project 559e813llvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/Attributor nofpclass-log.ll

ValueTracking: log may never return -0 (#173380)

DeltaFile
+74-74llvm/test/Transforms/Attributor/nofpclass-log.ll
+52-52llvm/test/Transforms/Attributor/AMDGPU/nofpclass-amdgcn-log.ll
+2-0llvm/lib/Analysis/ValueTracking.cpp
+128-1263 files

LLVM/project 51ca750clang/include/clang/Basic BuiltinsAMDGPU.def, clang/test/CodeGenOpenCL builtins-fp-atomics-gfx90a.cl

[Clang] Remove 't' from __builtin_amdgcn_flat_atomic_fmin/fmax_f64

Allows for type checking depending on the built-in signature.
DeltaFile
+4-4clang/test/CodeGenOpenCL/builtins-fp-atomics-gfx90a.cl
+2-3clang/test/SemaHIP/amdgpu-flat-atomic-fmax-err.hip
+2-3clang/test/SemaHIP/amdgpu-flat-atomic-fmin-err.hip
+2-2clang/include/clang/Basic/BuiltinsAMDGPU.def
+10-124 files

LLVM/project 0d163e7clang/test/SemaHIP amdgpu-flat-atomic-fmax-err.hip amdgpu-flat-atomic-fmin-err.hip

Pre-commit: [Clang] Remove 't' from __builtin_amdgcn_flat_atomic_fmin/fmax_f64
DeltaFile
+18-0clang/test/SemaHIP/amdgpu-flat-atomic-fmax-err.hip
+18-0clang/test/SemaHIP/amdgpu-flat-atomic-fmin-err.hip
+36-02 files

LLVM/project 367e388libunwind/src libunwind.cpp

[PAC][libunwind] Enhance PAuth-related comments in `__unw_set_reg` (#173769)

The PAuth-related checks performed for arm64e are also performed for
other PAuth-enabled ABIs such as Linux's pauthtest. This patch
introduces use of 'PAuth-enabled ABI' phrase instead of 'arm64e' term
for non-arm64e specific things. Also, on non-arm64e we cannot assume
that we have FPAC, so an additional explanation regarding resign
function guarantees is provided.

Note that other comments mentioning arm64e while not being
arm64e-specific are fixed as part of #171717.

Fixes #160117
DeltaFile
+9-6libunwind/src/libunwind.cpp
+9-61 files