SuccessChanges

Summary

  1. [Instruction] Add updateLocationAfterHoist helper (details)
  2. [drr] Add $_loc special directive for NativeCodeCall (details)
  3. [Instcombine] Fix uses of undef (PR46940) (details)
  4. [Analyzer] Support note tags for smart ptr checker (details)
  5. [globalopt] Change so that emitting fragments doesn't use the type size of DIVariables (details)
  6. Revert "[Instruction] Add updateLocationAfterHoist helper" (details)
  7. [libcxx/variant] Add a few benchmarks for `std::visit`. (details)
  8. [flang] Fix interpretation of intrinsic names as arguments (details)
Commit 4a646ca9e2caf70d6312714770f516fb83b7e3cb by Vedant Kumar
[Instruction] Add updateLocationAfterHoist helper

Introduce a helper on Instruction which can be used to update the debug
location after hoisting.

Use this in GVN and LICM, where we were mistakenly introducing new line
0 locations after hoisting (the docs recommend dropping the location in
this case).

For more context, see the discussion in https://reviews.llvm.org/D60913.

Differential Revision: https://reviews.llvm.org/D85670
The file was modifiedllvm/test/DebugInfo/Generic/licm-hoist-debug-loc.ll
The file was modifiedllvm/test/Transforms/LICM/hoisting-preheader-debugloc.ll
The file was modifiedllvm/include/llvm/IR/Instruction.h
The file was modifiedllvm/lib/IR/DebugInfo.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LICM.cpp
The file was modifiedllvm/test/Transforms/GVN/PRE/phi-translate.ll
The file was modifiedllvm/lib/Transforms/Scalar/GVN.cpp
The file was modifiedllvm/unittests/IR/InstructionsTest.cpp
Commit 29429d1a443a51d0e1ac4ef4033a2bcc95909ba3 by jpienaar
[drr] Add $_loc special directive for NativeCodeCall

Allows propagating the location to ops created via NativeCodeCall.

Differential Revision: https://reviews.llvm.org/D85704
The file was modifiedmlir/test/lib/Dialect/Test/TestOps.td
The file was modifiedmlir/tools/mlir-tblgen/RewriterGen.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestPatterns.cpp
The file was modifiedmlir/docs/DeclarativeRewrites.md
Commit cfdc96714bdfeabea31b1f4d2e0c65e424933994 by kazu
[Instcombine] Fix uses of undef (PR46940)

Without this patch, we attempt to distribute And over Xor even in
unsafe circumstances like so:

  undef & (true ^ true)  ==>  (undef & true) ^ (undef & true)

and evaluate it to undef instead of false.  Note that "true ^ true"
may show up implicitly with one true being part of a PHI node.

This patch fixes the problem by teaching SimplifyUsingDistributiveLaws
to not use undef as part of simplifications.

Reviewers: spatel, aqjune, nikic, lebedev.ri, fhahn, jdoerfert

Differential Revision: https://reviews.llvm.org/D85687
The file was addedllvm/test/Transforms/InstCombine/dont-distribute-phi.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstructionCombining.cpp
Commit 06d100a69a08632e6a553a7fb4d3750b55145946 by vrnithinkumar
[Analyzer] Support note tags for smart ptr checker

Summary:
Added support for note tags for null smart_ptr reporting

Reviewers: NoQ, Szelethus, vsavchenko, xazax.hun

Reviewed By: NoQ, vsavchenko, xazax.hun

Subscribers: martong, cfe-commits
Tags: #clang

Differential Revision: https://reviews.llvm.org/D84600
The file was modifiedclang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/SmartPtrChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/SmartPtr.h
The file was addedclang/test/Analysis/smart-ptr-text-output.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
The file was modifiedclang/test/Analysis/smart-ptr.cpp
Commit 54b6cca0f28484395ae43bcda4c9f929bc51cfe3 by akhuang
[globalopt] Change so that emitting fragments doesn't use the type size of DIVariables

When turning on -debug-info-kind=constructor we ran into a "fragment covers
entire variable" error during thinlto. The fragment is currently always
emitted if there is no type size, but sometimes the variable has a
forward declared struct type which doesn't have a size.

This changes the code to get the type size from the GlobalVariable instead.

Differential Revision: https://reviews.llvm.org/D85572
The file was addedllvm/test/DebugInfo/Generic/global-sra-struct-fwd-decl.ll
The file was modifiedllvm/lib/Transforms/IPO/GlobalOpt.cpp
Commit 30c1633386e7cfb01c0a54b31ccf4c3a3873e71b by Vedant Kumar
Revert "[Instruction] Add updateLocationAfterHoist helper"

This reverts commit 4a646ca9e2caf70d6312714770f516fb83b7e3cb.

This is causing some bots to fail with "!dbg attachment points at wrong
subprogram for function", like:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/67958/steps/stage%201%20check/logs/stdio
The file was modifiedllvm/unittests/IR/InstructionsTest.cpp
The file was modifiedllvm/test/DebugInfo/Generic/licm-hoist-debug-loc.ll
The file was modifiedllvm/include/llvm/IR/Instruction.h
The file was modifiedllvm/test/Transforms/GVN/PRE/phi-translate.ll
The file was modifiedllvm/lib/Transforms/Scalar/GVN.cpp
The file was modifiedllvm/lib/IR/DebugInfo.cpp
The file was modifiedllvm/test/Transforms/LICM/hoisting-preheader-debugloc.ll
The file was modifiedllvm/lib/Transforms/Scalar/LICM.cpp
Commit c6f51377e12b343ca2f712b6af6908555f07ad04 by mcypark
[libcxx/variant] Add a few benchmarks for `std::visit`.

This patch adds a few `std::visit` benchmarks as a starting point.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D85419
The file was addedlibcxx/benchmarks/variant_visit_2.bench.cpp
The file was addedlibcxx/benchmarks/VariantBenchmarks.h
The file was addedlibcxx/benchmarks/variant_visit_3.bench.cpp
The file was addedlibcxx/benchmarks/variant_visit_1.bench.cpp
Commit f5e4451e1f27e87d30c4eb0c3c99f2f8d07039e1 by tkeith
[flang] Fix interpretation of intrinsic names as arguments

If an unrestricted specific intrinsic function name is first encountered
as an actual argument, it should be interpreted as an object entity,
not a procedure entity.

Fix some tests that depended on the previous interpretation by adding
explicit INTRINSIC statements.

Differential Revision: https://reviews.llvm.org/D85792
The file was modifiedflang/test/Semantics/call09.f90
The file was modifiedflang/lib/Semantics/resolve-names.cpp
The file was modifiedflang/test/Semantics/call02.f90