1. [InstCombine] Regenerate test checks (NFC) (details)
  2. [InstCombine] Add more tests for select op replacement (NFC) (details)
  3. [DemandedBits] Add braces to large if (NFC) (details)
  4. [DemandedBits][BDCE] Add support for min/max intrinsics (details)
  5. [ORC] Make MaterializationResponsibility immovable, pass by unique_ptr. (details)
  6. [libc][obvious] Include Sqrt.h in SqrtLongDoubleX86.h. (details)
  7. [EarlyCSE] Equivalent SELECTs should hash equally (details)
  8. [DSE] Switch to MemorySSA-backed DSE by default. (details)
  9. [ELF] Make two PPC64.cpp variables constexpr. NFC (details)
  10. [flang] Fix assert on constant folding of extended types (details)
  11. Use pragmas to work around MSVC x86_32 debug miscompile bug (details)
  12. [AArch64][GlobalISel] Don't emit a branch for a fallthrough G_BR at -O0. (details)
Commit adb738899e6378ae0023acb19cde57a585dce502 by nikita.ppv
[InstCombine] Regenerate test checks (NFC)
The file was modifiedllvm/test/Transforms/InstCombine/select-binop-cmp.ll
The file was modifiedllvm/test/Transforms/InstCombine/rem.ll
The file was modifiedllvm/test/Transforms/InstCombine/select.ll
Commit 476836331f7d31ca46779742dccf2e26698b94ed by nikita.ppv
[InstCombine] Add more tests for select op replacement (NFC)
The file was modifiedllvm/test/Transforms/InstCombine/select.ll
Commit 99e78cb7185db1a15afd33020a1e026dc7ac5e1b by nikita.ppv
[DemandedBits] Add braces to large if (NFC)

While the if only contains a single statement, it happens to be
a huge switch. Add braces to make this code easier to read.
The file was modifiedllvm/lib/Analysis/DemandedBits.cpp
Commit a5168bdb4a25485ac62e18bdc538b4842bc9fbd9 by nikita.ppv
[DemandedBits][BDCE] Add support for min/max intrinsics

Add DemandedBits / BDCE support for min/max intrinsics: If the low
bits are not demanded in the result, they also aren't demanded in
the operands.

Differential Revision:
The file was modifiedllvm/lib/Analysis/DemandedBits.cpp
The file was modifiedllvm/test/Transforms/BDCE/intrinsics.ll
Commit c74900ca67241bf963b7a4cfa1fae8eadf6bb8cd by Lang Hames
[ORC] Make MaterializationResponsibility immovable, pass by unique_ptr.

Making MaterializationResponsibility instances immovable allows their
associated VModuleKeys to be updated by the ExecutionSession while the
responsibility is still in-flight. This will be used in the upcoming
removable code feature to enable safe merging of resource keys even if
there are active compiles using the keys being merged.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Speculation.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/Core.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/Layer.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/LLJIT.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
The file was modifiedllvm/examples/SpeculativeJIT/SpeculativeJIT.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
The file was modifiedllvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectTransformLayer.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/IRCompileLayer.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/LazyReexports.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Core.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Layer.h
The file was modifiedllvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
The file was modifiedllvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/IRTransformLayer.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/Speculation.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
Commit cb19e8c6d192a108b72ab07362921864a9e244f9 by sivachandra
[libc][obvious] Include Sqrt.h in SqrtLongDoubleX86.h.

This makes SqrtLongDoubleX86.h includable by itself.
The file was modifiedlibc/utils/FPUtil/SqrtLongDoubleX86.h
Commit c9826829d74e637163fdb0351870b8204e62d6e6 by bryan.chan
[EarlyCSE] Equivalent SELECTs should hash equally

DenseMap<SimpleValue> assumes that, if its isEqual method returns true
for two elements, then its getHashValue method must return the same value
for them. This invariant is broken when one SELECT node is a min/max
operation, and the other can be transformed into an equivalent min/max by
inverting its predicate and swapping its operands. This patch fixes an
assertion failure that would occur intermittently while compiling the
following IR:

    define i32 @t(i32 %i) {
      %cmp = icmp sle i32 0, %i
      %twin1 = select i1 %cmp, i32 %i, i32 0
      %cmpinv = icmp sgt i32 0, %i
      %twin2 = select i1 %cmpinv,  i32 0, i32 %i
      %sink = add i32 %twin1, %twin2
      ret i32 %sink

Differential Revision:
The file was modifiedllvm/test/Transforms/EarlyCSE/commute.ll
The file was modifiedllvm/lib/Transforms/Scalar/EarlyCSE.cpp
Commit fb109c42d91c30c8c7497ef1fd7aff6f2969c6e7 by flo
[DSE] Switch to MemorySSA-backed DSE by default.

The tests have been updated and I plan to move them from the MSSA
directory up.

Some end-to-end tests needed small adjustments. One difference to the
legacy DSE is that legacy DSE also deletes trivially dead instructions
that are unrelated to memory operations. Because MemorySSA-backed DSE
just walks the MemorySSA, we only visit/check memory instructions. But
removing unrelated dead instructions is not really DSE's job and other
passes will clean up.

One noteworthy change is in llvm/test/Transforms/Coroutines/ArgAddr.ll,
but I think this comes down to legacy DSE not handling instructions that
may throw correctly in that case. To cover this with MemorySSA-backed
DSE, we need an update to llvm.coro.begin to treat it's return value to
belong to the same underlying object as the passed pointer.

There are some minor cases MemorySSA-backed DSE currently misses, e.g. related
to atomic operations, but I think those can be implemented after the switch.

This has been discussed on llvm-dev:

For the MultiSource/SPEC2000/SPEC2006 the number of eliminated stores
goes from ~17500 (legayc DSE) to ~26300 (MemorySSA-backed). More numbers
and details in the thread on llvm-dev.

Impact on CTMark:
                                     Legacy Pass Manager
                        exec instrs    size-text
O3                       + 0.60%        - 0.27%
ReleaseThinLTO           + 1.00%        - 0.42%
ReleaseLTO-g.            + 0.77%        - 0.33%
RelThinLTO (link only)   + 0.87%        - 0.42%
RelLO-g (link only)      + 0.78%        - 0.33%
                                     New Pass Manager
                       exec instrs.   size-text
O3                       + 0.95%       - 0.25%
ReleaseThinLTO           + 1.34%       - 0.41%
ReleaseLTO-g.            + 1.71%       - 0.35%
RelThinLTO (link only)   + 0.96%       - 0.41%
RelLO-g (link only)      + 2.21%       - 0.35%

Reviewed By: asbirlea, xbolva00, nikic

Differential Revision:
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/PartialStore.ll
The file was modifiedllvm/test/Other/new-pm-defaults.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-loops.ll
The file was modifiedllvm/test/Other/opt-O3-pipeline-enable-matrix.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/2011-03-25-DSEMiscompile.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/2011-09-06-EndOfFunction.ll
The file was modifiedllvm/test/Other/opt-O2-pipeline.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-unreachable.ll
The file was modifiedllvm/test/Transforms/Coroutines/ArgAddr.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-throwing.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/merge-stores.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/dominate.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-partial.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/mda-with-dbg-values.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/atomic-overlapping.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-overlap.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/memcpy-complete-overwrite.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/pr11390.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/debuginfo.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/tail-byval.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/OverwriteStoreBegin.ll
The file was modifiedllvm/test/Other/opt-O3-pipeline.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-simple.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/inst-limits.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/noop-stores.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/X86/gather-null-pointer.ll
The file was modifiedllvm/test/Other/opt-Os-pipeline.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-memintrinsics.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/OverwriteStoreEnd.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-exceptions.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-multipath.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/lifetime.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/PartialStore2.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/simple-preservation.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-malloc-free.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-multipath-throwing.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/calloc-store.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/fence.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/int_sideeffect.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/memintrinsics.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/invariant.start.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/libcalls.ll
The file was modifiedllvm/test/Transforms/MemCpyOpt/memcpy.ll
The file was modifiedclang/test/CodeGenObjC/exceptions.m
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/memset-missing-debugloc.ll
The file was modifiedllvm/test/Other/new-pm-thinlto-defaults.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/operand-bundles.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/combined-partial-overwrites.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/debug-counter.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/overlap.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/free.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/merge-stores-big-endian.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-memoryphis.ll
The file was modifiedllvm/test/Other/new-pm-lto-defaults.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/cs-cs-aliasing.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/pr47285-not-overwritten-on-all-exit-paths.ll
The file was modifiedclang/test/CodeGen/thinlto-distributed-newpm.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/no-targetdata.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/const-pointers.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-captures.ll
The file was modifiedllvm/test/Analysis/BasicAA/modref.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/simple-todo.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/memset-and-memcpy.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/fence-todo.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-retcon.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/2011-09-06-MemCpy.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/memoryssa-scan-limit.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/crash.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/memset-unknown-sizes.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/opt-pipeline.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/2016-07-17-UseAfterFree.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/stats.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/atomic.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/
The file was modifiedllvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/atomic-todo.ll
Commit 485f3f35cc511637661619967319eafb932df5d5 by i
[ELF] Make two PPC64.cpp variables constexpr. NFC

Why are they mutable? :)
The file was modifiedlld/ELF/Arch/PPC64.cpp
Commit b34f116856306d97aa9244a46eb1643a8ddd49a8 by psteinfeld
[flang] Fix assert on constant folding of extended types

When we define a derived type that extends another derived type, we can then
create a structure constructor that contains values for the fields of both the
child type and its parent.  The compiler's internal representation of that
value contains the name of the parent type where a component name would
normally appear.  This caused an assert during contant folding.

There are three cases for components that appear in structure constructors.
The first is the normal case of a component appearing in a structure
constructor for its type.

  The second is a component of the parent (or grandparent) type appearing in a
  structure constructor for the child type.

  The third is the parent type component, which can appear in the structure
  constructor of its child.

There are also cases where the component can be arrays.

I created the test case folding12.f90 that covers all of these cases and
modified the code to handle them.

Most of my changes were to the "Find()" method of the type
"StructureConstructor" where I added code to cover the second and third cases
described above.  To handle these cases, I needed to create a
"StructureConstructor" for the parent type component and return it.  To handle
returning a newly created "StructureConstructor", I changed the return type of
"Find()" to be "std::optional" rather than an ordinary pointer.

This change supersedes D86172.

Differential Revision:
The file was modifiedflang/lib/Evaluate/fold-implementation.h
The file was addedflang/test/Evaluate/folding12.f90
The file was modifiedflang/lib/Evaluate/expression.cpp
The file was modifiedflang/include/flang/Evaluate/type.h
The file was modifiedflang/lib/Evaluate/type.cpp
The file was modifiedflang/include/flang/Evaluate/expression.h
Commit 4e3edef4b8b637c0c76897497eb7c66f00157210 by rnk
Use pragmas to work around MSVC x86_32 debug miscompile bug

Halide users reported this here:
I reported the issue to MSVC here:

This codepath is apparently not covered by LLVM's unit tests, so I added
coverage in a unit test.

If we want to support this configuration going forward, it means that is
in general not safe to pass a SmallVector<T, N> by value if alignof(T)
is greater than 4. This doesn't appear to come up often because passing
a SmallVector by value is inefficient and not idiomatic: it copies the
inline storage. In this case, the SmallVector<LLT,4> is captured by
value by a lambda, and the lambda is passed by value into std::function,
and that's how we hit the bug.

Differential Revision:
The file was modifiedllvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
Commit 0448d11a06b451a63a8f60408fec613ad24801ba by Amara Emerson
[AArch64][GlobalISel] Don't emit a branch for a fallthrough G_BR at -O0.

With optimizations we leave the decision to eliminate fallthrough branches to
bock placement, but at -O0 we should do it in the selector to save code size.

This regressed -O0 with a recent change to a combiner.
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-jump-table-brjt-constrain.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-returnaddress-liveins.mir
The file was modifiedllvm/test/CodeGen/AArch64/unwind-preserved.ll
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-xor.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-binop.mir