SuccessChanges

Summary

  1. clang: Exclude efi_main from -Wmissing-prototypes (details)
  2. [clang-tidy] Simplify braced init check (details)
  3. [Clang][OpenMP] Update driver test case for OpenMP offload to use sm_35 (details)
  4. [RISCV] Add an additional remw test to rv64m-exhaustive-w-insts.ll. NFC (details)
  5. [OpenMP] libomp: cleanup some resource leaks (details)
  6. [ConstantRange] Handle wrapping range in binaryNot() (details)
  7. [InstCombine] add tests for fdiv of exp/exp2; NFC (details)
  8. [InstCombine] fold fdiv with exp/exp2 divisor (PR49147) (details)
  9. [ConstantRange] Handle wrapping ranges in min/max (PR48643) (details)
  10. [clang-itdy] Simplify virtual near-miss check (details)
  11. [RISCV] Add another test case showing failure to use remw when the RHS has been zero extended from less than i32. NFC (details)
  12. [clang-tidy] Simplify function complexity check (details)
  13. [clang-tidy] Simplify throw keyword missing check (details)
Commit 7dd42ecfa2a29bac89c965544c14b32805c8f02b by daan.j.demeyer
clang: Exclude efi_main from -Wmissing-prototypes

When compiling UEFI applications, the main function is named
efi_main() instead of main(). Let's exclude efi_main() from
-Wmissing-prototypes as well to avoid warnings when working
on UEFI applications.

Differential Revision: https://reviews.llvm.org/D95746
The file was modifiedclang/test/Sema/no-warn-missing-prototype.c
The file was modifiedclang/lib/Sema/SemaDecl.cpp
Commit e8b8f896024620eb86bf924be73100d83c74c736 by steveire
[clang-tidy] Simplify braced init check

The normalization of matchers means that this now works in all language
modes.

Differential Revision: https://reviews.llvm.org/D96135
The file was modifiedclang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.h
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/modernize-return-braced-init-list.cpp
Commit 33d660939d9acb027f9941f037802936124dad8c by tianshilei1992
[Clang][OpenMP] Update driver test case for OpenMP offload to use sm_35

`sm_35` is the minimum requirement for OpenMP offloading on NVPTX device.
Current driver test case is using `sm_20`. D97003 is going to switch the minimum
CUDA version to 9.2, which only supports `sm_30+`. This patch makes step for the
change.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D97120
The file was modifiedclang/test/Driver/openmp-offload-gpu.c
The file was removedclang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-cuda_80-sm_20.bc
The file was addedclang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-cuda_80-sm_35.bc
Commit 09966a66ffd08a04306c754ce20420d05109771a by craig.topper
[RISCV] Add an additional remw test to rv64m-exhaustive-w-insts.ll. NFC

This adds the IR for this C code

int32_t foo(uint16_t x, int16_t y) {
  x %= y;
  return x;
}

Note the dividend is unsigned and the divisor is signed. C type
promotion rules will extend them and use a 32-bit srem and the
function returns a 32-bit result.

We fail to use remw for this case. The zero extended input has
enough sign bits, but we won't consider (i64 AssertZext X, i16) in
the sexti32 isel pattern.

We also end up with a extra shifts to zero upper bits on the result.
computeKnownBits knew the result was positive before type legalization
and allowed the SIGN_EXTEND to become ZERO_EXTEND. But after promoting
to i64 we no longer know that bit 31 (and all bits above it) should
be 0.
The file was modifiedllvm/test/CodeGen/RISCV/rv64m-exhaustive-w-insts.ll
Commit 1611e5473c5e30e0eea9ec5bd187ed455bdd6109 by Andrey.Churbanov
[OpenMP] libomp: cleanup some resource leaks

Close mutexattr and condattr local objects to eliminate resource leaks.

Differential Revision: https://reviews.llvm.org/D96892
The file was modifiedopenmp/runtime/src/z_Linux_util.cpp
Commit b6088f7465a9a6691d5d237e9c0eb002734da3bf by nikita.ppv
[ConstantRange] Handle wrapping range in binaryNot()

We don't need any special handling for wrapping ranges (or empty
ranges for that matter). The sub() call will already compute a
correct and precise range.

We only need to adjust the test expectation: We're now computing
an optimal result, rather than an unsigned envelope.
The file was modifiedllvm/lib/IR/ConstantRange.cpp
The file was modifiedllvm/unittests/IR/ConstantRangeTest.cpp
Commit fbca27bf2967aff047bb6c2842e0de344b67cf7b by spatel
[InstCombine] add tests for fdiv of exp/exp2; NFC
The file was modifiedllvm/test/Transforms/InstCombine/fdiv.ll
Commit e772618f1ee2fe7709a17e6d850623a97e23a8dc by spatel
[InstCombine] fold fdiv with exp/exp2 divisor (PR49147)

Follow-up to:
D96648 / b40fde062
...for the special-case base calls.

From the earlier commit:
This is unusual in the general (non-reciprocal) case because we need
an extra instruction, but that should be better for general FP
reassociation and codegen. We conservatively check for "arcp" FMF
here as we do with existing fdiv folds, but it is not strictly
necessary to have that.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
The file was modifiedllvm/test/Transforms/InstCombine/fdiv.ll
Commit a852234f70e344b238824b9d71e8df9c46de62f2 by nikita.ppv
[ConstantRange] Handle wrapping ranges in min/max (PR48643)

When one of the inputs is a wrapping range, intersect with the
union of the two inputs. The union of the two inputs corresponds
to the result we would get if we treated the min/max as a simple
select.

This fixes PR48643.
The file was modifiedllvm/lib/IR/ConstantRange.cpp
The file was modifiedllvm/unittests/IR/ConstantRangeTest.cpp
Commit 9a4b574dd6a07d6811356529ebb8a3f15d6e40a2 by steveire
[clang-itdy] Simplify virtual near-miss check

Diagnose the problem in templates in the context of the template
declaration instead of in the context of all of the (possibly very many)
template instantiations.

Differential Revision: https://reviews.llvm.org/D96224
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-virtual-near-miss.cpp
The file was modifiedclang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.h
Commit 038bd14712d149cb51a8e95eb7bbdcfa7753a555 by craig.topper
[RISCV] Add another test case showing failure to use remw when the RHS has been zero extended from less than i32. NFC
The file was modifiedllvm/test/CodeGen/RISCV/rv64m-exhaustive-w-insts.ll
Commit 6852a29a3b5b7858757c175f39e04676fb856dab by steveire
[clang-tidy] Simplify function complexity check

Update test to note use of lambda instead of the invisible operator().

Differential Revision: https://reviews.llvm.org/D96131
The file was modifiedclang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.h
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/readability-function-cognitive-complexity.cpp
Commit 77056fe58e83100b902216d7bc6274129f80abda by steveire
[clang-tidy] Simplify throw keyword missing check

Extend test to verify that it does not match in template instantiations.

Differential Revision: https://reviews.llvm.org/D96132
The file was modifiedclang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.h
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-throw-keyword-missing.cpp
The file was modifiedclang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp