FailedChanges

Summary

  1. Revert r372082 "[Clang] Pragma vectorize_width() implies vectorize(enable)" This broke the Chromium build. Consider the following code: float ScaleSumSamples_C(const float* src, float* dst, float scale, int width) { float fsum = 0.f; int i; #if defined(__clang__) #pragma clang loop vectorize_width(4) #endif for (i = 0; i < width; ++i) { float v = *src++; fsum += v * v; *dst++ = v * scale; } return fsum; } Compiling at -Oz, Clang now warns: $ clang++ -target x86_64 -Oz -c /tmp/a.cc /tmp/a.cc:1:7: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] this suggests it's not actually enabling vectorization hard enough. At -Os it asserts instead: $ build.release/bin/clang++ -target x86_64 -Os -c /tmp/a.cc clang-10: /work/llvm.monorepo/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2734: void llvm::InnerLoopVectorizer::emitMemRuntimeChecks(llvm::Loop*, llvm::BasicBlock*): Assertion ` !BB->getParent()->hasOptSize() && "Cannot emit memory checks when optimizing for size"' failed. Of course neither of these are what the developer expected from the pragma. > Specifying the vectorization width was supposed to implicitly enable > vectorization, except that it wasn't really doing this. It was only > setting the vectorize.width metadata, but not vectorize.enable. > > This should fix PR27643. > > Differential Revision: https://reviews.llvm.org/D66290
  2. [SDA] Don't stop divergence propagation at the IPD. Summary: This fixes B42473 and B42706. This patch makes the SDA propagate branch divergence until the end of the RPO traversal. Before, the SyncDependenceAnalysis propagated divergence only until the IPD in rpo order. RPO is incompatible with post dominance in the presence of loops. This made the SDA crash because blocks were missed in the propagation. Reviewers: foad, nhaehnle Reviewed By: foad Subscribers: jvesely, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65274
  3. [mips] Pass "xgot" flag as a subtarget feature We need "xgot" flag in the MipsAsmParser to implement correct expansion of some pseudo instructions in case of using 32-bit GOT (XGOT). MipsAsmParser does not have reference to MipsSubtarget but has a reference to "feature bit set".
  4. [mips] Mark tests for lw/sw expansion in PIC by a separate "check prefix". NFC That simplify adding XGOT tests later.
  5. [mips] Reduce code duplication in the `loadAndAddSymbolAddress`. NFC
Revision 372225 by hans:
Revert r372082 "[Clang] Pragma vectorize_width() implies vectorize(enable)"

This broke the Chromium build. Consider the following code:

  float ScaleSumSamples_C(const float* src, float* dst, float scale, int width) {
    float fsum = 0.f;
    int i;
  #if defined(__clang__)
  #pragma clang loop vectorize_width(4)
  #endif
    for (i = 0; i < width; ++i) {
      float v = *src++;
      fsum += v * v;
      *dst++ = v * scale;
    }
    return fsum;
  }

Compiling at -Oz, Clang  now warns:

  $ clang++ -target x86_64 -Oz -c /tmp/a.cc
  /tmp/a.cc:1:7: warning: loop not vectorized: the optimizer was unable to
  perform the requested transformation; the transformation might be disabled or
  specified as part of an unsupported transformation ordering
  [-Wpass-failed=transform-warning]

this suggests it's not actually enabling vectorization hard enough.

At -Os it asserts instead:

  $ build.release/bin/clang++ -target x86_64 -Os -c /tmp/a.cc
  clang-10: /work/llvm.monorepo/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2734: void
  llvm::InnerLoopVectorizer::emitMemRuntimeChecks(llvm::Loop*, llvm::BasicBlock*): Assertion `
  !BB->getParent()->hasOptSize() && "Cannot emit memory checks when optimizing for size"' failed.

Of course neither of these are what the developer expected from the pragma.

> Specifying the vectorization width was supposed to implicitly enable
> vectorization, except that it wasn't really doing this. It was only
> setting the vectorize.width metadata, but not vectorize.enable.
>
> This should fix PR27643.
>
> Differential Revision: https://reviews.llvm.org/D66290
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/CodeGen/CGLoopInfo.cpp (diff)clang.src/lib/CodeGen/CGLoopInfo.cpp
The file was modified/cfe/trunk/test/CodeGenCXX/pragma-loop-predicate.cpp (diff)clang.src/test/CodeGenCXX/pragma-loop-predicate.cpp
The file was modified/cfe/trunk/test/CodeGenCXX/pragma-loop.cpp (diff)clang.src/test/CodeGenCXX/pragma-loop.cpp
Revision 372223 by foad:
[SDA] Don't stop divergence propagation at the IPD.

Summary:
This fixes B42473 and B42706.

This patch makes the SDA propagate branch divergence until the end of the RPO traversal. Before, the SyncDependenceAnalysis propagated divergence only until the IPD in rpo order. RPO is incompatible with post dominance in the presence of loops. This made the SDA crash because blocks were missed in the propagation.

Reviewers: foad, nhaehnle

Reviewed By: foad

Subscribers: jvesely, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65274
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Analysis/SyncDependenceAnalysis.cpp (diff)llvm.src/lib/Analysis/SyncDependenceAnalysis.cpp
The file was added/llvm/trunk/test/Analysis/DivergenceAnalysis/AMDGPU/b42473-r1-crash.llllvm.src/test/Analysis/DivergenceAnalysis/AMDGPU/b42473-r1-crash.ll
Revision 372220 by atanasyan:
[mips] Pass "xgot" flag as a subtarget feature

We need "xgot" flag in the MipsAsmParser to implement correct expansion
of some pseudo instructions in case of using 32-bit GOT (XGOT).
MipsAsmParser does not have reference to MipsSubtarget but has a
reference to "feature bit set".
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp (diff)N/A
The file was modified/cfe/trunk/lib/Driver/ToolChains/Clang.cpp (diff)N/A
The file was modified/cfe/trunk/test/Driver/mips-features.c (diff)N/A
The file was modified/cfe/trunk/test/Driver/mips-integrated-as.s (diff)N/A
The file was modified/llvm/trunk/lib/Target/Mips/Mips.td (diff)llvm.src/lib/Target/Mips/Mips.td
The file was modified/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (diff)llvm.src/lib/Target/Mips/MipsISelLowering.cpp
The file was modified/llvm/trunk/lib/Target/Mips/MipsSubtarget.h (diff)llvm.src/lib/Target/Mips/MipsSubtarget.h
The file was modified/llvm/trunk/test/CodeGen/Mips/address-selection.ll (diff)llvm.src/test/CodeGen/Mips/address-selection.ll
The file was modified/llvm/trunk/test/CodeGen/Mips/biggot.ll (diff)llvm.src/test/CodeGen/Mips/biggot.ll
The file was modified/llvm/trunk/test/CodeGen/Mips/mirparser/target-flags-pic-mxgot-tls.mir (diff)llvm.src/test/CodeGen/Mips/mirparser/target-flags-pic-mxgot-tls.mir
Revision 372219 by atanasyan:
[mips] Mark tests for lw/sw expansion in PIC by a separate "check prefix". NFC

That simplify adding XGOT tests later.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/test/MC/Mips/mips-expansions.s (diff)llvm.src/test/MC/Mips/mips-expansions.s
The file was modified/llvm/trunk/test/MC/Mips/mips64-expansions.s (diff)llvm.src/test/MC/Mips/mips64-expansions.s
Revision 372218 by atanasyan:
[mips] Reduce code duplication in the `loadAndAddSymbolAddress`. NFC
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (diff)llvm.src/lib/Target/Mips/AsmParser/MipsAsmParser.cpp