SuccessChanges

Summary

  1. [AArch64] Don't implicitly enable global isel on Darwin if code-model==large. Summary: AArch64 GlobalISel doesn't support MachO's large code model, so this patch adds a check for that combination before implicitly enabling it. Reviewers: paquette Subscribers: kristof.beyls, ributzka, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67724
  2. [SimplifyCFG] mergeConditionalStoreToAddress(): consider cost, not instruction count Summary: As it can be see in the changed test, while `div` is really costly, we were speculating it. This does not seem correct. Also, the old code would run for every single insturuction in BB, instead of eagerly bailing out as soon as there are too many instructions. This function still has a problem that `PHINodeFoldingThreshold` is per-basic-block, while it should be for all the basic blocks. Reviewers: efriedma, craig.topper, dmgreen, jmolloy Reviewed By: jmolloy Subscribers: xbolva00, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67315
  3. [MIPS] For vectors, select `add %x, C` as `sub %x, -C` if it results in inline immediate Summary: As discussed in https://reviews.llvm.org/D62341#1515637, for MIPS `add %x, -1` isn't optimal. Unlike X86 there are no fastpaths to matearialize such `-1`/`1` vector constants, and `sub %x, 1` results in better codegen, so undo canonicalization Reviewers: atanasyan, Petar.Avramovic, RKSimon Reviewed By: atanasyan Subscribers: sdardis, arichardson, hiraditya, jrtc27, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66805
  4. [CodeGen][MIPS][NFC] Some standalone tests for D66805 "or vectors, select `add %x, C` as `sub %x, -C` if it results in inline immediate"
  5. [OPENMP]Fix for PR43349: Crash for privatized loop bound. If the variable, used in the loop boundaries, is not captured in the construct, this variable must be considered as undefined if it was privatized.
  6. [mips] Expand 'lw/sw' instructions for 32-bit GOT In case of using 32-bit GOT access to the table requires two instructions with attached %got_hi and %got_lo relocations. This patch implements correct expansion of 'lw/sw' instructions in that case. Differential Revision: https://reviews.llvm.org/D67705
  7. actually also compile output in tests for -frewrite-includes Checking that the created output matches something is nice, but this should also check whether the output makes sense. Differential Revision: https://reviews.llvm.org/D63979
  8. [clang-format][PR41899] PointerAlignment: Left leads to useless space in lambda intializer expression Summary: https://bugs.llvm.org/show_bug.cgi?id=41899 ```auto lambda = [&a = a]() { a = 2; };``` is formatted as ```auto lambda = [& a = a]() { a = 2; };``` With an extra space if PointerAlignment is set to Left > The space "& a" looks strange when there is no type in the lambda's intializer expression. This can be worked around with by setting "PointerAlignment: Right", but ideally "PointerAlignment: Left" would not add a space in this case. Reviewers: klimek, owenpan, krasimir, timwoj Reviewed By: klimek Subscribers: cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D67718
  9. make -frewrite-includes also rewrite conditions in #if/#elif Those conditions may use __has_include, which needs to be rewritten. The existing code has already tried to rewrite just __has_include, but it didn't work with macro expansion, so e.g. Qt's "#define QT_HAS_INCLUDE(x) __has_include(x)" didn't get handled properly. Since the preprocessor run knows what each condition evaluates to, just rewrite the entire condition. This of course requires that the -frewrite-include pass has the same setup as the following compilation, but that has always been the requirement. Differential Revision: https://reviews.llvm.org/D63508
Revision 372256 by Lang Hames:
[AArch64] Don't implicitly enable global isel on Darwin if code-model==large.

Summary:
AArch64 GlobalISel doesn't support MachO's large code model, so this patch
adds a check for that combination before implicitly enabling it.

Reviewers: paquette

Subscribers: kristof.beyls, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67724
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp (diff)llvm.src/lib/Target/AArch64/AArch64TargetMachine.cpp
The file was added/llvm/trunk/test/CodeGen/AArch64/arm64-code-model-large-darwin.llllvm.src/test/CodeGen/AArch64/arm64-code-model-large-darwin.ll
Revision 372255 by lebedevri:
[SimplifyCFG] mergeConditionalStoreToAddress(): consider cost, not instruction count

Summary:
As it can be see in the changed test, while `div` is really costly,
we were speculating it. This does not seem correct.

Also, the old code would run for every single insturuction in BB,
instead of eagerly bailing out as soon as there are too many instructions.

This function still has a problem that `PHINodeFoldingThreshold` is
per-basic-block, while it should be for all the basic blocks.

Reviewers: efriedma, craig.topper, dmgreen, jmolloy

Reviewed By: jmolloy

Subscribers: xbolva00, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67315
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (diff)llvm.src/lib/Transforms/Utils/SimplifyCFG.cpp
The file was modified/llvm/trunk/test/Transforms/SimplifyCFG/X86/merge-cond-stores-cost.ll (diff)llvm.src/test/Transforms/SimplifyCFG/X86/merge-cond-stores-cost.ll
Revision 372254 by lebedevri:
[MIPS] For vectors, select `add %x, C` as `sub %x, -C` if it results in inline immediate

Summary:
As discussed in https://reviews.llvm.org/D62341#1515637,
for MIPS `add %x, -1` isn't optimal. Unlike X86 there
are no fastpaths to matearialize such `-1`/`1` vector constants,
and `sub %x, 1` results in better codegen,
so undo canonicalization

Reviewers: atanasyan, Petar.Avramovic, RKSimon

Reviewed By: atanasyan

Subscribers: sdardis, arichardson, hiraditya, jrtc27, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66805
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (diff)llvm.src/lib/Target/Mips/MipsISelDAGToDAG.cpp
The file was modified/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.h (diff)llvm.src/lib/Target/Mips/MipsISelDAGToDAG.h
The file was modified/llvm/trunk/test/CodeGen/Mips/msa/arithmetic.ll (diff)llvm.src/test/CodeGen/Mips/msa/arithmetic.ll
Revision 372253 by lebedevri:
[CodeGen][MIPS][NFC] Some standalone tests for D66805 "or vectors, select `add %x, C` as `sub %x, -C` if it results in inline immediate"
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/test/CodeGen/Mips/msa/arithmetic.ll (diff)llvm.src/test/CodeGen/Mips/msa/arithmetic.ll
Revision 372252 by abataev:
[OPENMP]Fix for PR43349: Crash for privatized loop bound.

If the variable, used in the loop boundaries, is not captured in the
construct, this variable must be considered as undefined if it was
privatized.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp (diff)clang.src/lib/CodeGen/CGStmtOpenMP.cpp
The file was modified/cfe/trunk/test/OpenMP/parallel_for_codegen.cpp (diff)clang.src/test/OpenMP/parallel_for_codegen.cpp
Revision 372251 by atanasyan:
[mips] Expand 'lw/sw' instructions for 32-bit GOT

In case of using 32-bit GOT access to the table requires two instructions
with attached %got_hi and %got_lo relocations. This patch implements
correct expansion of 'lw/sw' instructions in that case.

Differential Revision: https://reviews.llvm.org/D67705
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
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 372250 by llunak:
actually also compile output in tests for -frewrite-includes

Checking that the created output matches something is nice, but
this should also check whether the output makes sense.

Differential Revision: https://reviews.llvm.org/D63979
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h (diff)clang.src/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h
The file was modified/cfe/trunk/test/Frontend/Inputs/rewrite-includes1.h (diff)clang.src/test/Frontend/Inputs/rewrite-includes1.h
The file was modified/cfe/trunk/test/Frontend/Inputs/rewrite-includes2.h (diff)clang.src/test/Frontend/Inputs/rewrite-includes2.h
The file was modified/cfe/trunk/test/Frontend/Inputs/rewrite-includes3.h (diff)clang.src/test/Frontend/Inputs/rewrite-includes3.h
The file was modified/cfe/trunk/test/Frontend/Inputs/rewrite-includes4.h (diff)clang.src/test/Frontend/Inputs/rewrite-includes4.h
The file was modified/cfe/trunk/test/Frontend/Inputs/rewrite-includes5.h (diff)clang.src/test/Frontend/Inputs/rewrite-includes5.h
The file was modified/cfe/trunk/test/Frontend/Inputs/rewrite-includes6.h (diff)clang.src/test/Frontend/Inputs/rewrite-includes6.h
The file was modified/cfe/trunk/test/Frontend/Inputs/rewrite-includes7.h (diff)clang.src/test/Frontend/Inputs/rewrite-includes7.h
The file was modified/cfe/trunk/test/Frontend/rewrite-includes-cli-include.c (diff)clang.src/test/Frontend/rewrite-includes-cli-include.c
The file was modified/cfe/trunk/test/Frontend/rewrite-includes-conditions.c (diff)clang.src/test/Frontend/rewrite-includes-conditions.c
The file was modified/cfe/trunk/test/Frontend/rewrite-includes.c (diff)clang.src/test/Frontend/rewrite-includes.c
Revision 372249 by paulhoad:
[clang-format][PR41899] PointerAlignment: Left leads to useless space in lambda intializer expression

Summary:
https://bugs.llvm.org/show_bug.cgi?id=41899

```auto lambda = [&a = a]() { a = 2; };```

is formatted as

```auto lambda = [& a = a]() { a = 2; };```

With an extra space if PointerAlignment is set to Left

> The space "& a" looks strange when there is no type in the lambda's intializer expression. This can be worked around with by setting "PointerAlignment: Right", but ideally "PointerAlignment: Left" would not add a space in this case.

Reviewers: klimek, owenpan, krasimir, timwoj

Reviewed By: klimek

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D67718
Change TypePath in RepositoryPath in Workspace
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 372248 by llunak:
make -frewrite-includes also rewrite conditions in #if/#elif

Those conditions may use __has_include, which needs to be rewritten.
The existing code has already tried to rewrite just __has_include,
but it didn't work with macro expansion, so e.g. Qt's
"#define QT_HAS_INCLUDE(x) __has_include(x)" didn't get handled
properly. Since the preprocessor run knows what each condition evaluates
to, just rewrite the entire condition. This of course requires that
the -frewrite-include pass has the same setup as the following
compilation, but that has always been the requirement.

Differential Revision: https://reviews.llvm.org/D63508
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Frontend/Rewrite/InclusionRewriter.cpp (diff)clang.src/lib/Frontend/Rewrite/InclusionRewriter.cpp
The file was added/cfe/trunk/test/Frontend/rewrite-includes-conditions.cclang.src/test/Frontend/rewrite-includes-conditions.c
The file was modified/cfe/trunk/test/Frontend/rewrite-includes.c (diff)clang.src/test/Frontend/rewrite-includes.c
The file was modified/cfe/trunk/test/Modules/preprocess-module.cpp (diff)clang.src/test/Modules/preprocess-module.cpp