SuccessChanges

Summary

  1. [PowerPC] add more builtins for PPCTargetLowering::getTgtMemIntrinsic (details)
  2. [PowerPC] implement target hook getTgtMemIntrinsic (details)
  3. [MachineInstr] exclude call instruction in mayAlias (details)
  4. Reapply "[OpenMP][FIX] Verify compatible types for declare variant calls" D88384 (details)
  5. [Test] Add test showing that we can avoid inserting trunc/zext (details)
  6. BPF: avoid duplicated globals for CORE relocations (details)
  7. [SROA] rewritePartition()/findCommonType(): if uses have conflicting type, try getTypePartition() before falling back to largest integral use type (PR47592) (details)
  8. [lldb] Format unix signal table (NFC) (details)
  9. [NFC] Use getZero instead of getConstant(0) (details)
  10. [Support][unittests] Enforce alignment in ConvertUTFTest (details)
  11. [AST][RecoveryExpr] Support dependent conditional operators in C for error recovery. (details)
  12. [clang] Use isCompoundAssignmentOp to simplify the code, NFC. (details)
  13. [clangd] Don't set the Underlying bit on targets of UsingDecls. (details)
  14. [mlir][NFC] Style cleanup in comments (details)
  15. [Test] Add one more test where we can avoid creating trunc (details)
  16. [SDag] SimplifyDemandedBits: simplify to FP constant if all bits known (details)
Commit 0492dd91c49ca38bb45d5294f2a6711e3d40b16f by czhengsz
[PowerPC] add more builtins for PPCTargetLowering::getTgtMemIntrinsic

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D88374
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
Commit f05608707c641423a4cd4d5923a44cda153ebbcb by czhengsz
[PowerPC] implement target hook getTgtMemIntrinsic

This patch can make pass recognize Powerpc related memory intrinsics.

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D88373
The file was addedllvm/test/Transforms/LoopStrengthReduce/Power/memory-intrinsic.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
Commit ed46e84c7aaffd847656ac559acb06089096ec33 by czhengsz
[MachineInstr] exclude call instruction in mayAlias

we now get noAlias result for a call instruction and other
load/store/call instructions if we query mayAlias.
This is not right as call instruction is not with mayloadorstore,
but it may alter the memory.

This patch fixes this wrong alias query.

Differential Revision: https://reviews.llvm.org/D87490
The file was modifiedllvm/lib/CodeGen/MachineInstr.cpp
Commit 5a3f6bfe8a71b94728597aee12a4c36949d5f6af by johannes
Reapply "[OpenMP][FIX] Verify compatible types for declare variant calls" D88384

This reapplies D88384 with the minor modification that an assertion was
changed to a regular conditional and graceful exit from
ASTContext::mergeTypes.
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was addedclang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
Commit 0c009e092e29a3dff16c5c0522979341fab3be62 by mkazantsev
[Test] Add test showing that we can avoid inserting trunc/zext
The file was modifiedllvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll
Commit edd71db38b0c2292e6a36fb789a3ec3cbde6a023 by yhs
BPF: avoid duplicated globals for CORE relocations

This patch fixed two issues related with relocation globals.
In LLVM, if a global, e.g. with name "g", is created and
conflict with another global with the same name, LLVM will
rename the global, e.g., with a new name "g.2". Since
relocation global name has special meaning, we do not want
llvm to change it, so internally we have logic to check
whether duplication happens or not. If happens, just reuse
the previous global.

The first bug is related to non-btf-id relocation
(BPFAbstractMemberAccess.cpp). Commit 54d9f743c8b0
("BPF: move AbstractMemberAccess and PreserveDIType passes
to EP_EarlyAsPossible") changed ModulePass to FunctionPass,
i.e., handling each function at a time. But still just
one BPFAbstractMemberAccess object is created so module
level de-duplication still possible. Commit 40251fee0084
("[BPF][NewPM] Make BPFTargetMachine properly adjust NPM optimizer
pipeline") made a change to create a BPFAbstractMemberAccess
object per function so module level de-duplication is not
possible any more without going through all module globals.
This patch simply changed the map which holds reloc globals
as class static, so it will be available to all
BPFAbstractMemberAccess objects for different functions.

The second bug is related to btf-id relocation
(BPFPreserveDIType.cpp). Before Commit 54d9f743c8b0, the pass
is a ModulePass, so we have a local variable, incremented for
each instance, and works fine. But after Commit 54d9f743c8b0,
the pass becomes a FunctionPass. Local variable won't work
properly since different functions will start with the same
initial value. Fix the issue by change the local count variable
as static, so it will be truely unique across the whole module
compilation.

Differential Revision: https://reviews.llvm.org/D88942
The file was modifiedllvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
The file was addedllvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll
The file was modifiedllvm/lib/Target/BPF/BPFPreserveDIType.cpp
The file was addedllvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll
Commit 7fa503ef4aaddc1c31dd36d970aa6609383e1718 by lebedev.ri
[SROA] rewritePartition()/findCommonType(): if uses have conflicting type, try getTypePartition() before falling back to largest integral use type (PR47592)

And another step towards transformss not introducing inttoptr and/or
ptrtoint casts that weren't there already.

In this case, when load/store uses have conflicting types,
instead of falling back to the iN, we can try to use allocated sub-type.
As disscussed, this isn't the best idea overall (we shouldn't rely on
allocated type), but it works fine as a temporary measure.

I've measured, and @ `-O3` as of vanilla llvm test-suite + RawSpeed,
this results in +0.05% more bitcasts, -5.51% less inttoptr
and -1.05% less ptrtoint (at the end of middle-end opt pipeline)

See https://bugs.llvm.org/show_bug.cgi?id=47592

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D88788
The file was modifiedllvm/test/DebugInfo/ARM/sroa-complex.ll
The file was modifiedllvm/lib/Transforms/Scalar/SROA.cpp
The file was modifiedllvm/test/Transforms/SROA/ppcf128-no-fold.ll
The file was modifiedllvm/test/Transforms/SROA/preserve-nonnull.ll
Commit 0fcacefd160494280dc040f4f055db6df695ac12 by Jonas Devlieghere
[lldb] Format unix signal table (NFC)

Restore unix signal table to its original glory and mark it as not to be
clang-formatted.
The file was modifiedlldb/source/Target/UnixSignals.cpp
Commit fba42aea438cc4c93233a10703e83f45035ffa64 by mkazantsev
[NFC] Use getZero instead of getConstant(0)
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit 53b3873cf428fd78f1d92504cc20adf11181ead7 by ro
[Support][unittests] Enforce alignment in ConvertUTFTest

`LLVM-Unit :: Support/./SupportTests/ConvertUTFTest.ConvertUTF16LittleEndianToUTF8String`
`FAIL`s on Solaris/sparcv9:

In `llvm/lib/Support/ConvertUTFWrapper.cpp` (`convertUTF16ToUTF8String`)
the `SrcBytes` arg is reinterpreted/accessed as `UTF16` (`unsigned short`,
which requires 2-byte alignment on strict-alignment targets like Sparc)
without anything guaranteeing the alignment, so the access yields a
`SIGBUS`.

This patch avoids this by enforcing the required alignment in the callers.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D88824
The file was modifiedllvm/unittests/Support/ConvertUTFTest.cpp
The file was modifiedllvm/lib/Support/ConvertUTFWrapper.cpp
Commit 334ec6f807fa65e09571fa42a0c3be0eb39e7c0f by hokein.wu
[AST][RecoveryExpr] Support dependent conditional operators in C for error recovery.

suppress spurious "typecheck_cond_expect_scalar" diagnostic.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D84322
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/test/Sema/error-dependence.c
The file was modifiedclang/test/AST/ast-dump-recovery.c
Commit 31dc90801746e12d6ae1f967f455cf43a5bbb039 by hokein.wu
[clang] Use isCompoundAssignmentOp to simplify the code, NFC.
The file was modifiedclang/lib/Sema/SemaOverload.cpp
Commit f24649b77d856157c64841457dcc4f70530d607c by hokein.wu
[clangd] Don't set the Underlying bit on targets of UsingDecls.

With this patch, we don't treat `using ns::X` as a first-class declaration like `using Z = ns::Y`, reference to X that goes through this using-decl is considered a direct reference (without the Underlying bit).

Fix the workaround in https://reviews.llvm.org/D87225 and https://reviews.llvm.org/D74054.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D88472
The file was modifiedclang-tools-extra/clangd/unittests/FindTargetTests.cpp
The file was modifiedclang-tools-extra/clangd/XRefs.cpp
The file was modifiedclang-tools-extra/clangd/FindTarget.h
The file was modifiedclang-tools-extra/clangd/unittests/XRefsTests.cpp
The file was modifiedclang-tools-extra/clangd/FindTarget.cpp
Commit 872d72eeeb7eeea05e5812967faf9801fdbe48c4 by tpopp
[mlir][NFC] Style cleanup in comments
The file was modifiedmlir/lib/Dialect/Shape/Transforms/ShapeTypeConversion.cpp
The file was modifiedmlir/include/mlir/Dialect/Shape/Transforms/Passes.td
Commit 85a6f8fc9600164021a56126216ce3c6ef805458 by mkazantsev
[Test] Add one more test where we can avoid creating trunc
The file was modifiedllvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll
Commit 1aa8e6a51a0eb378ae7b2f1934946fc25f298905 by jay.foad
[SDag] SimplifyDemandedBits: simplify to FP constant if all bits known

We were already doing this for integer constants. This patch implements
the same thing for floating point constants.

Differential Revision: https://reviews.llvm.org/D88570
The file was modifiedllvm/test/CodeGen/X86/copysign-constant-magnitude.ll
The file was modifiedllvm/test/CodeGen/X86/uint_to_fp-2.ll
The file was modifiedllvm/test/CodeGen/ARM/fcopysign.ll
The file was modifiedllvm/test/CodeGen/X86/combine-bextr.ll
The file was modifiedllvm/test/CodeGen/X86/fp-intrinsics.ll
The file was modifiedllvm/test/CodeGen/X86/fp-round.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shuffle-combining.ll
The file was modifiedllvm/test/CodeGen/X86/scalar-int-to-fp.ll
The file was modifiedllvm/test/CodeGen/X86/fp-strict-scalar-inttofp.ll
The file was modifiedllvm/test/CodeGen/X86/fp128-cast.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp