FailedChanges

Summary

  1. [SLP] avoid reduction transform on patterns that the backend can load-combine I don't see an ideal solution to these 2 related, potentially large, perf regressions: https://bugs.llvm.org/show_bug.cgi?id=42708 https://bugs.llvm.org/show_bug.cgi?id=43146 We decided that load combining was unsuitable for IR because it could obscure other optimizations in IR. So we removed the LoadCombiner pass and deferred to the backend. Therefore, preventing SLP from destroying load combine opportunities requires that it recognizes patterns that could be combined later, but not do the optimization itself ( it's not a vector combine anyway, so it's probably out-of-scope for SLP). Here, we add a scalar cost model adjustment with a conservative pattern match and cost summation for a multi-instruction sequence that can probably be reduced later. This should prevent SLP from creating a vector reduction unless that sequence is extremely cheap. In the x86 tests shown (and discussed in more detail in the bug reports), SDAG combining will produce a single instruction on these tests like: movbe rax, qword ptr [rdi] or: mov rax, qword ptr [rdi] Not some (half) vector monstrosity as we currently do using SLP: vpmovzxbq ymm0, dword ptr [rdi + 1] # ymm0 = mem[0],zero,zero,.. vpsllvq ymm0, ymm0, ymmword ptr [rip + .LCPI0_0] movzx eax, byte ptr [rdi] movzx ecx, byte ptr [rdi + 5] shl rcx, 40 movzx edx, byte ptr [rdi + 6] shl rdx, 48 or rdx, rcx movzx ecx, byte ptr [rdi + 7] shl rcx, 56 or rcx, rdx or rcx, rax vextracti128 xmm1, ymm0, 1 vpor xmm0, xmm0, xmm1 vpshufd xmm1, xmm0, 78 # xmm1 = xmm0[2,3,0,1] vpor xmm0, xmm0, xmm1 vmovq rax, xmm0 or rax, rcx vzeroupper ret Differential Revision: https://reviews.llvm.org/D67841
  2. [X86] lowerShuffleAsLanePermuteAndRepeatedMask - variable renames. NFCI. Rename some variables to match lowerShuffleAsRepeatedMaskAndLanePermute - prep work toward adding some equivalent sublane functionality.
  3. Try to fix sphinx indentation error
  4. [SelectionDAG] Add tests for LKK algorithm Added some tests testing urem and srem operations with a constant divisor. Patch by TG908 (Tim Gymnich) Differential Revision: https://reviews.llvm.org/D68421
  5. RewriteObjC - silence static analyzer getAs<> null dereference warnings. NFCI. The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
  6. [Diagnostics] Highlight expr's source range for -Wbool-operation Warning message looks better; and GCC adds it too.
  7. SemaTemplate - silence static analyzer getAs<> null dereference warnings. NFCI. The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
  8. TreeTransform - silence static analyzer getAs<> null dereference warnings. NFCI. The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
  9. Remove redundant !HasDependentValue check. NFCI. Fixes cppcheck warning.
  10. SemaStmt - silence static analyzer getAs<> null dereference warnings. NFCI. The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
  11. BranchFolding - IsBetterFallthrough - assert non-null pointers. NFCI. Silences static analyzer null dereference warnings.
  12. [clang-format] SpacesInSquareBrackets should affect lambdas with parameters too Summary: This patch makes the `SpacesInSquareBrackets` setting also apply to C++ lambdas with parameters. Looking through the revision history, it appears support for only array brackets was added, and lambda brackets were ignored. Therefore, I am inclined to think it was simply an omission, rather than a deliberate choice. See https://bugs.llvm.org/show_bug.cgi?id=17887 and https://reviews.llvm.org/D4944. Reviewers: MyDeveloperDay, reuk, owenpan Reviewed By: MyDeveloperDay Subscribers: cfe-commits Patch by: mitchell-stellar Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D68473
  13. [UnitTests] Try and pacify gcc-5 This looks like a defect in gcc-5 where it chooses a constexpr constructor from the initializer-list that it considers to be explicit. I've tried to reproduce but I can't install anything prior to gcc-6 easily on my system, and that doesn't have the error. So this is speculative pacification. Reported by Steven Wan.
  14. [NFCI] Slightly improve warning message
  15. [Diagnostics] Use Expr::isKnownToHaveBooleanValue() to check bitwise negation of bool in languages without a bool type Thanks for this advice, Richard Trieu!
Revision 373833 by spatel:
[SLP] avoid reduction transform on patterns that the backend can load-combine

I don't see an ideal solution to these 2 related, potentially large, perf regressions:
https://bugs.llvm.org/show_bug.cgi?id=42708
https://bugs.llvm.org/show_bug.cgi?id=43146

We decided that load combining was unsuitable for IR because it could obscure other
optimizations in IR. So we removed the LoadCombiner pass and deferred to the backend.
Therefore, preventing SLP from destroying load combine opportunities requires that it
recognizes patterns that could be combined later, but not do the optimization itself (
it's not a vector combine anyway, so it's probably out-of-scope for SLP).

Here, we add a scalar cost model adjustment with a conservative pattern match and cost
summation for a multi-instruction sequence that can probably be reduced later.
This should prevent SLP from creating a vector reduction unless that sequence is
extremely cheap.

In the x86 tests shown (and discussed in more detail in the bug reports), SDAG combining
will produce a single instruction on these tests like:

  movbe   rax, qword ptr [rdi]

or:

  mov     rax, qword ptr [rdi]

Not some (half) vector monstrosity as we currently do using SLP:

  vpmovzxbq       ymm0, dword ptr [rdi + 1] # ymm0 = mem[0],zero,zero,..
  vpsllvq ymm0, ymm0, ymmword ptr [rip + .LCPI0_0]
  movzx   eax, byte ptr [rdi]
  movzx   ecx, byte ptr [rdi + 5]
  shl     rcx, 40
  movzx   edx, byte ptr [rdi + 6]
  shl     rdx, 48
  or      rdx, rcx
  movzx   ecx, byte ptr [rdi + 7]
  shl     rcx, 56
  or      rcx, rdx
  or      rcx, rax
  vextracti128    xmm1, ymm0, 1
  vpor    xmm0, xmm0, xmm1
  vpshufd xmm1, xmm0, 78          # xmm1 = xmm0[2,3,0,1]
  vpor    xmm0, xmm0, xmm1
  vmovq   rax, xmm0
  or      rax, rcx
  vzeroupper
  ret

Differential Revision: https://reviews.llvm.org/D67841
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h (diff)llvm.src/include/llvm/Analysis/TargetTransformInfo.h
The file was modified/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp (diff)llvm.src/lib/Analysis/TargetTransformInfo.cpp
The file was modified/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (diff)llvm.src/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modified/llvm/trunk/test/Transforms/SLPVectorizer/X86/bad-reduction.ll (diff)llvm.src/test/Transforms/SLPVectorizer/X86/bad-reduction.ll
Revision 373832 by rksimon:
[X86] lowerShuffleAsLanePermuteAndRepeatedMask - variable renames. NFCI.

Rename some variables to match lowerShuffleAsRepeatedMaskAndLanePermute - prep work toward adding some equivalent sublane functionality.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (diff)llvm.src/lib/Target/X86/X86ISelLowering.cpp
Revision 373831 by rksimon:
Try to fix sphinx indentation error
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/docs/ReleaseNotes.rst (diff)clang.src/docs/ReleaseNotes.rst
Revision 373830 by xbolva00:
[SelectionDAG] Add tests for LKK algorithm

Added some tests testing urem and srem operations with a constant divisor.

Patch by TG908 (Tim Gymnich)

Differential Revision: https://reviews.llvm.org/D68421
Change TypePath in RepositoryPath in Workspace
The file was added/llvm/trunk/test/CodeGen/AArch64/srem-lkk.llllvm.src/test/CodeGen/AArch64/srem-lkk.ll
The file was added/llvm/trunk/test/CodeGen/AArch64/srem-vector-lkk.llllvm.src/test/CodeGen/AArch64/srem-vector-lkk.ll
The file was added/llvm/trunk/test/CodeGen/AArch64/urem-lkk.llllvm.src/test/CodeGen/AArch64/urem-lkk.ll
The file was added/llvm/trunk/test/CodeGen/AArch64/urem-vector-lkk.llllvm.src/test/CodeGen/AArch64/urem-vector-lkk.ll
The file was added/llvm/trunk/test/CodeGen/PowerPC/srem-lkk.llllvm.src/test/CodeGen/PowerPC/srem-lkk.ll
The file was added/llvm/trunk/test/CodeGen/PowerPC/srem-vector-lkk.llllvm.src/test/CodeGen/PowerPC/srem-vector-lkk.ll
The file was added/llvm/trunk/test/CodeGen/PowerPC/urem-lkk.llllvm.src/test/CodeGen/PowerPC/urem-lkk.ll
The file was added/llvm/trunk/test/CodeGen/PowerPC/urem-vector-lkk.llllvm.src/test/CodeGen/PowerPC/urem-vector-lkk.ll
The file was added/llvm/trunk/test/CodeGen/RISCV/srem-lkk.llllvm.src/test/CodeGen/RISCV/srem-lkk.ll
The file was added/llvm/trunk/test/CodeGen/RISCV/srem-vector-lkk.llllvm.src/test/CodeGen/RISCV/srem-vector-lkk.ll
The file was added/llvm/trunk/test/CodeGen/RISCV/urem-lkk.llllvm.src/test/CodeGen/RISCV/urem-lkk.ll
The file was added/llvm/trunk/test/CodeGen/RISCV/urem-vector-lkk.llllvm.src/test/CodeGen/RISCV/urem-vector-lkk.ll
The file was added/llvm/trunk/test/CodeGen/X86/srem-lkk.llllvm.src/test/CodeGen/X86/srem-lkk.ll
The file was added/llvm/trunk/test/CodeGen/X86/srem-vector-lkk.llllvm.src/test/CodeGen/X86/srem-vector-lkk.ll
The file was added/llvm/trunk/test/CodeGen/X86/urem-lkk.llllvm.src/test/CodeGen/X86/urem-lkk.ll
The file was added/llvm/trunk/test/CodeGen/X86/urem-vector-lkk.llllvm.src/test/CodeGen/X86/urem-vector-lkk.ll
Revision 373829 by rksimon:
RewriteObjC - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp (diff)clang.src/lib/Frontend/Rewrite/RewriteObjC.cpp
Revision 373828 by xbolva00:
[Diagnostics] Highlight expr's source range for -Wbool-operation

Warning message looks better; and GCC adds it too.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Sema/SemaExpr.cpp (diff)clang.src/lib/Sema/SemaExpr.cpp
Revision 373827 by rksimon:
SemaTemplate - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Sema/SemaTemplate.cpp (diff)clang.src/lib/Sema/SemaTemplate.cpp
Revision 373826 by rksimon:
TreeTransform - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Sema/TreeTransform.h (diff)clang.src/lib/Sema/TreeTransform.h
Revision 373825 by rksimon:
Remove redundant !HasDependentValue check. NFCI.

Fixes cppcheck warning.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Sema/SemaStmt.cpp (diff)clang.src/lib/Sema/SemaStmt.cpp
Revision 373824 by rksimon:
SemaStmt - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Sema/SemaStmt.cpp (diff)clang.src/lib/Sema/SemaStmt.cpp
Revision 373823 by rksimon:
BranchFolding - IsBetterFallthrough - assert non-null pointers. NFCI.

Silences static analyzer null dereference warnings.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/CodeGen/BranchFolding.cpp (diff)llvm.src/lib/CodeGen/BranchFolding.cpp
Revision 373821 by paulhoad:
[clang-format] SpacesInSquareBrackets should affect lambdas with parameters too

Summary:
This patch makes the `SpacesInSquareBrackets` setting also apply to C++ lambdas with parameters.

Looking through the revision history, it appears support for only array brackets was added, and lambda brackets were ignored. Therefore, I am inclined to think it was simply an omission, rather than a deliberate choice.

See https://bugs.llvm.org/show_bug.cgi?id=17887 and https://reviews.llvm.org/D4944.

Reviewers: MyDeveloperDay, reuk, owenpan

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Patch by: mitchell-stellar

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D68473
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/docs/ClangFormatStyleOptions.rst (diff)clang.src/docs/ClangFormatStyleOptions.rst
The file was modified/cfe/trunk/lib/Format/TokenAnnotator.cpp (diff)clang.src/lib/Format/TokenAnnotator.cpp
The file was modified/cfe/trunk/unittests/Format/FormatTest.cpp (diff)clang.src/unittests/Format/FormatTest.cpp
Revision 373820 by jamesm:
[UnitTests] Try and pacify gcc-5

This looks like a defect in gcc-5 where it chooses a constexpr
constructor from the initializer-list that it considers to be explicit.

I've tried to reproduce but I can't install anything prior to gcc-6 easily
on my system, and that doesn't have the error. So this is speculative
pacification.

Reported by Steven Wan.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/unittests/TableGen/AutomataTest.cpp (diff)llvm.src/unittests/TableGen/AutomataTest.cpp
Revision 373818 by xbolva00:
[NFCI] Slightly improve warning message
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (diff)clang.src/include/clang/Basic/DiagnosticSemaKinds.td
The file was modified/cfe/trunk/test/SemaCXX/warn-xor-as-pow.cpp (diff)clang.src/test/SemaCXX/warn-xor-as-pow.cpp
Revision 373817 by xbolva00:
[Diagnostics] Use Expr::isKnownToHaveBooleanValue() to check bitwise negation of bool in languages without a bool type

Thanks for this advice, Richard Trieu!
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Sema/SemaExpr.cpp (diff)clang.src/lib/Sema/SemaExpr.cpp
The file was modified/cfe/trunk/test/Sema/warn-bitwise-negation-bool.c (diff)clang.src/test/Sema/warn-bitwise-negation-bool.c