SuccessChanges

Summary

  1. [NFC][InstCombine] Add a test for assume-induced miscompile (details)
  2. [ValueTracking] isValidAssumeForContext(): CxtI itself also must (details)
  3. [ValueTracking] isKnownNonZero() should take non-null-ness assumptions (details)
  4. [analyzer] Add a syntactic security check for ObjC NSCoder API. (details)
  5. Fix crash on init-capture packs where the type of the initializer is (details)
  6. [NFC][InlineCost] Simplify internal inlining cost interface (details)
Commit ffcae008d74c2008697211e66a72ff9a20696bc9 by lebedev.ri
[NFC][InstCombine] Add a test for assume-induced miscompile
@escape() may throw here, we don't know that assumption, which is
located afterwards in the same block, is executed, therefore %load arg
of call to @escape() can not be marked as non-null.
As noted in D71660 review by @nikic.
The file was modifiedllvm/test/Transforms/InstCombine/assume.ll
Commit 92083a295a02f46ecd168438d2145a0ca3c9b6ec by lebedev.ri
[ValueTracking] isValidAssumeForContext(): CxtI itself also must
transfer execution to successor
This is a pretty rare case, when CxtI and assume are in the same basic
block, with assume being located later.
We were already checking that assumption was guaranteed to be executed,
but we omitted CxtI itself from consideration, and as the test
(miscompile) shows, that is incorrect.
As noted in D71660 review by @nikic.
The file was modifiedllvm/test/Transforms/InstCombine/assume.ll
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
Commit 047186cc986f5bb53ce716dfe363ba517b7d0ed8 by lebedev.ri
[ValueTracking] isKnownNonZero() should take non-null-ness assumptions
into consideration (PR43267)
Summary: It is pretty common to assume that something is not zero. Even
optimizer itself sometimes emits such assumptions
(e.g. `addAssumeNonNull()` in `PromoteMemoryToRegister.cpp`).
But we currently don't deal with such assumptions :) The only way
`isKnownNonZero()` handles assumptions is by calling
`computeKnownBits()` which calls `computeKnownBitsFromAssume()`. But `x
!= 0` does not tell us anything about set bits, it only says that there
are *some* set bits. So naturally, `KnownBits` does not get populated,
and we fail to make use of this assumption.
I propose to deal with this special case by special-casing it via adding
a `isKnownNonZeroFromAssume()` that returns boolean when there is an
applicable assumption.
While there, we also deal with other predicates, mainly if the
comparison is with constant.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=43267 | PR43267 ]].
Differential Revision: https://reviews.llvm.org/D71660
The file was modifiedllvm/test/Transforms/InstCombine/assume.ll
The file was modifiedllvm/test/Transforms/InstSimplify/assume-non-zero.ll
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
Commit b284005072122fe4af879725e3c8090009f89ca0 by Artem Dergachev
[analyzer] Add a syntactic security check for ObjC NSCoder API.
Method '-[NSCoder decodeValueOfObjCType:at:]' is not only deprecated but
also a security hazard, hence a loud check.
Differential Revision: https://reviews.llvm.org/D71728
The file was modifiedclang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
The file was addedclang/test/Analysis/security-syntax-checks-nscoder.m
The file was modifiedclang/www/analyzer/available_checks.html
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Checkers/Checkers.td
Commit f4a45c2ce4ce2a7a33d5773048682e65f348a486 by richard
Fix crash on init-capture packs where the type of the initializer is
non-dependent.
The file was modifiedclang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp
The file was modifiedclang/lib/Sema/SemaTemplateDeduction.cpp
The file was modifiedclang/test/Lexer/cxx-features.cpp
The file was modifiedclang/lib/Frontend/InitPreprocessor.cpp
Commit 93ac81cc9d2cbd24830125b64156d0a7da206d99 by mtrofin
[NFC][InlineCost] Simplify internal inlining cost interface
Summary: All the use cases of CallAnalyzer use the same call site
parameter to both construct the CallAnalyzer, and then pass to the
analysis member. This change removes this duplication.
Reviewers: davidxl, eraman, Jim
Reviewed By: davidxl
Subscribers: Jim, hiraditya, haicheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71645
The file was modifiedllvm/lib/Analysis/InlineCost.cpp