Changes

Summary

  1. DWARFDie.cpp: Reduce indentation with early continue (details)
  2. DWARFDie:DWARFTypePrinter: Add common utility function for checking where parentheses are required (details)
  3. [RISCV] Optimize (add (shl x, c0), (shl y, c1)) with SH*ADD (details)
  4. llvm/cmake: fix a typo (details)
  5. [X86][Atom] Fix (U)COMISS/SD uops, latency and throughput (details)
  6. [mlir][emitc] Fix indent in CondBranchOp and block label (details)
  7. [ARM] Add VGETLANEu patterns for v4f16 and v8f16 (details)
  8. [InstCombine] add/adjust tests for min/max intrinsics; NFC (details)
  9. [X86] combineX86ShufflesRecursively(): call SimplifyMultipleUseDemandedVectorElts() on after finishing recursing (details)
  10. [NFC] combineX86ShufflesRecursively(): actually address nits for previous patch (details)
  11. [X86] lowerShuffleAsDecomposedShuffleMerge(): if both inputs are broadcastable/identities, canonicalize broadcasts as such (details)
  12. [X86][TLI] SimplifyDemandedVectorEltsForTargetNode(): don't break apart broadcasts from which not just the 0'th elt is demanded (details)
  13. [X86][Atom] Specific uops for all IMUL/IDIV instructions (details)
  14. llvm-dwarfdump: Refactor type pretty printing tests (details)
  15. [X86] Fold SHUFPS(shuffle(x),shuffle(y),mask) -> SHUFPS(x,y,mask') (details)
  16. [X86][Atom] Fix FP uops + port usage (details)
  17. DWARFDie: Improve type printing for function and array types - with qualifiers (cv/reference) and pointers to them (details)
  18. DWARFDie.cpp: Minor follow-up clang-format (details)
  19. [X86] Add test cases for pr51908. NFC (details)
  20. [X86] Remove Commutable flag from mpsadbw intrinsics. (details)
  21. llvm-dwarfdump: Pretty printing types including a space between const and parenthesized references/pointers to arrays (details)
  22. [DebugInfo][LSR] Emit shorter expressions from scev-based salvaging (details)
  23. [llvm] Use pop_back_val (NFC) (details)
Commit d2373c04a7cbbc38221bbfb6120e5285c765785c by dblaikie
DWARFDie.cpp: Reduce indentation with early continue
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Commit ae0873483d9393d35bd5bdbfcb2bfb843c335cd5 by dblaikie
DWARFDie:DWARFTypePrinter: Add common utility function for checking where parentheses are required
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Commit dee5a8ca325f3c752534442233cb601910e918c4 by ben.shi
[RISCV] Optimize (add (shl x, c0), (shl y, c1)) with SH*ADD

Optimize (add (shl x, c0), (shl y, c1)) ->
         (SLLI (SH*ADD x, y), c1), if c0-c1 == 1/2/3.

Reviewed By: craig.topper, luismarques

Differential Revision: https://reviews.llvm.org/D108916
The file was modifiedllvm/test/CodeGen/RISCV/rv64zba.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rv32zba.ll
Commit b7ec8f3dcbcdf6d27902688c8eac0e6196061cb3 by sylvestre
llvm/cmake: fix a typo
The file was modifiedllvm/CMakeLists.txt
Commit e381d8b24329cae6408205f74d0d6d9eaa6b29cf by llvm-dev
[X86][Atom] Fix (U)COMISS/SD uops, latency and throughput

Both ports are required, for reg and mem variants - we can also use the WriteFComX class directly and remove the unnecessary InstRW overrides. Matches what Intel AoM / Agner / InstLatX64 report as well.
The file was modifiedllvm/lib/Target/X86/X86ScheduleAtom.td
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-sse2.s
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-sse1.s
Commit 9de88fc0eac1bfc719dfd63a32b7eb069489407e by xndchn
[mlir][emitc] Fix indent in CondBranchOp and block label

1. Add missing indent in CondBranchOp
2. Remove indent in block label

Differential Revision: https://reviews.llvm.org/D109805
The file was modifiedmlir/lib/Target/Cpp/TranslateToCpp.cpp
Commit 1da52ef2943b67c0ec1ccd3b8e459d0e57e67a6d by david.green
[ARM] Add VGETLANEu patterns for v4f16 and v8f16

These were apparently missing, having no pattern that could convert a
VGETLANEu of a v4f16 to an i32. Added bf16 whilst here, following the
same code.
The file was modifiedllvm/lib/Target/ARM/ARMInstrNEON.td
The file was modifiedllvm/test/CodeGen/ARM/bf16-getlane-with-fp16.ll
The file was modifiedllvm/test/CodeGen/ARM/fp16-insert-extract.ll
Commit 9555d1edb0d16f135ae57695fc2da55deaabf082 by spatel
[InstCombine] add/adjust tests for min/max intrinsics; NFC

If we transform these, we have to propagate no-wrap/undef carefully.
The file was modifiedllvm/test/Transforms/InstCombine/minmax-intrinsics.ll
Commit 1e72ca94e5796a744d0e1a8871c33b1b4edb0acb by lebedev.ri
[X86] combineX86ShufflesRecursively(): call SimplifyMultipleUseDemandedVectorElts() on after finishing recursing

This was suggested in https://reviews.llvm.org/D108382#inline-1039018,
and it avoids regressions in that patch.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D109065
The file was modifiedllvm/test/CodeGen/X86/vselect.ll
The file was modifiedllvm/test/CodeGen/X86/oddshuffles.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 0852313e47836152b00fb8b8fd62a7e12bf92abd by lebedev.ri
[NFC] combineX86ShufflesRecursively(): actually address nits for previous patch
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 07f1d8f0caa1516e0d97616adfea4aa94f7883a4 by lebedev.ri
[X86] lowerShuffleAsDecomposedShuffleMerge(): if both inputs are broadcastable/identities, canonicalize broadcasts as such

Split off from D108253.
Broadcast is simpler than any other shuffle we might produce
to do what we want to do here, so prefer it.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D108382
The file was modifiedllvm/test/CodeGen/X86/copy-low-subvec-elt-to-high-subvec-elt.ll
The file was modifiedllvm/test/CodeGen/X86/horizontal-sum.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 5f2fe48d06c742872804da8b3d86596ed2bb9acb by lebedev.ri
[X86][TLI] SimplifyDemandedVectorEltsForTargetNode(): don't break apart broadcasts from which not just the 0'th elt is demanded

Apparently this has no test coverage before D108382,
but D108382 itself shows a few regressions that this fixes.

It doesn't seem worthwhile breaking apart broadcasts,
assuming we want the broadcasted value to be preset in several elements,
not just the 0'th one.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D108411
The file was modifiedllvm/test/CodeGen/X86/horizontal-sum.ll
The file was modifiedllvm/test/CodeGen/X86/sse41.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/copy-low-subvec-elt-to-high-subvec-elt.ll
Commit cf8fac7d07307bc6679d60c3ad3e7a7792a2caa6 by llvm-dev
[X86][Atom] Specific uops for all IMUL/IDIV instructions

Based off a mixture of llvm-exegesis captures (PR36895) and Intel AoM / Agner / InstLatX64 reports.
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-x86_64.s
The file was modifiedllvm/lib/Target/X86/X86ScheduleAtom.td
Commit 2ca637c9769ff50e94ace3083075a97b50d147f0 by dblaikie
llvm-dwarfdump: Refactor type pretty printing tests

Move most type tests to a pre-generated assembly file to make it easier
to add more weird cases without having to hand craft more DWARF.

Move the novel array types that aren't reachable via clang-generated
DWARF to a separate file for easy maintenance.
The file was addedllvm/test/tools/llvm-dwarfdump/X86/prettyprint_types_handcrafted.s
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s
Commit b7342e3137d8fa7c356a80c1ddecf1d410c27eef by llvm-dev
[X86] Fold SHUFPS(shuffle(x),shuffle(y),mask) -> SHUFPS(x,y,mask')

We can combine unary shuffles into either of SHUFPS's inputs and adjust the shuffle mask accordingly.

Unlike general shuffle combining, we can be more aggressive and handle multiuse cases as we're not going to accidentally create additional shuffles.
The file was modifiedllvm/test/CodeGen/X86/vselect.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/horizontal-sum.ll
Commit f855ef260148df0f08c73a70b9425a5215232874 by llvm-dev
[X86][Atom] Fix FP uops + port usage

Both ports are required in most cases. Update the uops counts + port usage based off the most recent llvm-exegesis captures (PR36895) and what Intel AoM / Agner / InstLatX64 reports as well.

Noticed while trying to improve fp costs for vectorization via the D103695 helper script.
The file was modifiedllvm/lib/Target/X86/X86ScheduleAtom.td
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-sse1.s
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-sse2.s
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-ssse3.s
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-sse3.s
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-x87.s
Commit f09ca5c6461b604113b6e1adb825be2d92575aff by dblaikie
DWARFDie: Improve type printing for function and array types - with qualifiers (cv/reference) and pointers to them
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Commit a51fb58c557c2cd217eddc8a2332b245350118cf by dblaikie
DWARFDie.cpp: Minor follow-up clang-format
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Commit 2bde3dcd32b3ce2c8855d13659c6708f4434a985 by craig.topper
[X86] Add test cases for pr51908. NFC
The file was modifiedllvm/test/CodeGen/X86/avx2-intrinsics-x86.ll
The file was modifiedllvm/test/CodeGen/X86/sse41-intrinsics-x86.ll
Commit 391fa371fdfbc5ea4d4a924aebb27cb77d483da4 by craig.topper
[X86] Remove Commutable flag from mpsadbw intrinsics.

Unlike psadbw, mpsadbw is not commutable because of how it operates
on blocks. We already marked as not commutable for MachineIR, but
had it commutable for the tablegened isel patterns.

Fixes PR51908.
The file was modifiedllvm/include/llvm/IR/IntrinsicsX86.td
The file was modifiedllvm/test/CodeGen/X86/avx2-intrinsics-x86.ll
The file was modifiedllvm/test/CodeGen/X86/sse41-intrinsics-x86.ll
Commit 372e2c24b6e17bbff8fe6ed488cff5f7b7abd2b7 by dblaikie
llvm-dwarfdump: Pretty printing types including a space between const and parenthesized references/pointers to arrays
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Commit 5ba8020326a522c0dfa32f59a472fe20bee4908a by chris.jackson
[DebugInfo][LSR] Emit shorter expressions from scev-based salvaging

The scev-based salvaging for LSR can sometimes produce unnecessarily
verbose expressions. This patch adds logic to detect when the value to
be recovered and the induction variable differ by only a constant
offset. Then, the expression to derive the current iteration count can
be omitted from the dbg.value in favour of the offset.

Reviewed by: aprantl

Differential Revision: https://reviews.llvm.org/D109044
The file was modifiedllvm/test/Transforms/LoopStrengthReduce/dbg-preserve-0.ll
The file was modifiedllvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Commit 84b07c9b3aa79e073a97290bdd30d98b1941a536 by kazu
[llvm] Use pop_back_val (NFC)
The file was modifiedllvm/lib/CodeGen/ReachingDefAnalysis.cpp
The file was modifiedllvm/lib/CodeGen/LiveRangeEdit.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64StackTaggingPreRA.cpp
The file was modifiedllvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
The file was modifiedllvm/lib/Transforms/Coroutines/CoroFrame.cpp
The file was modifiedllvm/lib/Target/ARM/A15SDOptimizer.cpp
The file was modifiedllvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
The file was modifiedllvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
The file was modifiedllvm/lib/CodeGen/TwoAddressInstructionPass.cpp
The file was modifiedllvm/lib/CodeGen/LiveVariables.cpp
The file was modifiedllvm/lib/Analysis/MemorySSAUpdater.cpp
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
The file was modifiedllvm/lib/CodeGen/CodeGenPrepare.cpp
The file was modifiedllvm/lib/IR/Value.cpp
The file was modifiedllvm/lib/CodeGen/LoopTraversal.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp