Changes

Summary

  1. [GlobalISel] Combine (x op 0) -> x for operations with a right identity of 0 (details)
  2. [WebAssembly] Import wasm_simd128.h from Emscripten (details)
  3. Fix crash if base specifier parsing hits an invalid type annotation. (details)
  4. Rename options --cuda-gpu-arch and --no-cuda-gpu-arch (details)
  5. [LegalizeTypes] Add SoftenFloatRes_FREEZE (details)
  6. [GlobalISel] Implement identity transforms for x op x -> x (details)
  7. [gn build] (manually) ort 5074776de47 (details)
  8. [gn build] minor tweaks to sync script (details)
  9. [gn build] re-run "gn format" on all .gn and .gni files (details)
  10. [PowerPC] Don't do the folding if the operand is R0/X0 (details)
Commit 63d70ea6a07131587e09914176551f4437187f78 by Jessica Paquette
[GlobalISel] Combine (x op 0) -> x for operations with a right identity of 0

Implement identity combines for operations like the following:

```
%a = G_SUB %b, 0
```

This can just be replaced with %b.

Over CTMark, this gives some minor size improvements at -O3.

Differential Revision: https://reviews.llvm.org/D76640
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-trivial-arith.mir
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Commit 5074776de478a114ece3f82668aa1363b2f17c92 by tlively
[WebAssembly] Import wasm_simd128.h from Emscripten

Summary:
As the WebAssembly SIMD proposal nears stabilization, there is desire
to use it with toolchains other than Emscripten. Moving the intrinsics
header to clang will make it available to WASI toolchains as well.

Reviewers: aheejin, sunfish

Subscribers: dschuff, mgorny, sbc100, jgravelle-google, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76959
The file was addedclang/lib/Headers/wasm_simd128.h
The file was modifiedclang/lib/Headers/CMakeLists.txt
Commit 330873230071ffc2aebc0fe74db55e7a530c2f1b by richard
Fix crash if base specifier parsing hits an invalid type annotation.

Also change type annotation representation from ParsedType to TypeResult
to make it clearer to consumers that they can represent invalid types.
The file was modifiedclang/lib/Parse/ParseExpr.cpp
The file was modifiedclang/lib/Parse/ParseTemplate.cpp
The file was modifiedclang/lib/Parse/ParseDecl.cpp
The file was modifiedclang/lib/Parse/Parser.cpp
The file was modifiedclang/lib/Parse/ParseObjc.cpp
The file was modifiedclang/include/clang/Sema/DeclSpec.h
The file was modifiedclang/include/clang/Parse/Parser.h
The file was modifiedclang/lib/Parse/ParseExprCXX.cpp
The file was modifiedclang/test/Parser/cxx-class.cpp
The file was modifiedclang/lib/Parse/ParseDeclCXX.cpp
Commit 764f54bb857b0fbc6742f306b09f640e0043791d by Yaxun.Liu
Rename options --cuda-gpu-arch and --no-cuda-gpu-arch

Per discussion

http://lists.llvm.org/pipermail/llvm-dev/2017-February/109930.html

Rename -cuda-gpu-arch and --no-cuda-gpu-arch to
--offload-arch and --no-offload-arch.

The original options will be alias to the new options.

Differential Revision: https://reviews.llvm.org/D76987
The file was modifiedclang/lib/Driver/Driver.cpp
The file was modifiedclang/include/clang/Driver/Options.td
Commit 519f5c37962a8b747bf5e6990256a77281fa1d77 by aqjune
[LegalizeTypes] Add SoftenFloatRes_FREEZE

Summary: This adds SoftenFloatRes_FREEZE.

Reviewers: bkramer, JamesNagurne, craig.topper, efriedma

Reviewed By: craig.topper

Subscribers: AbigailLinden, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76980
The file was addedllvm/test/CodeGen/ARM/freeze-soften.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
Commit d5ee72065b9e5d28f89b1200133e80ce60cb99a0 by Jessica Paquette
[GlobalISel] Implement identity transforms for x op x -> x

When we have

```
a = G_OR x, x
```

or

```
b = G_AND y, y
```

We can drop the G_OR/G_AND and just use x/y respectively.

Also update arm64-fallback.ll because there was an or in there which hits this
transformation.

Differential Revision: https://reviews.llvm.org/D77105
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-binop-same-val.mir
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Commit c26a352f239ee71a77f3ae09a4c738eee164d738 by thakis
[gn build] (manually) ort 5074776de47
The file was modifiedllvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
Commit 4ce375a8f2eed73832b6384cd1ea0b33606db6fe by thakis
[gn build] minor tweaks to sync script

- only complain about duplicate 'sources' lines if they contain
  more than 1 elements each (before, 0 and 1 element lists were
  counted too). In practice, this only has an effect for
  clang/lib/Headers/BUILD.gn

- make the '# NOSORT' diag actually work. This too only affects
  clang/lib/Headers/BUILD.gn.

In aggregate, changes to clang/lib/Headers/BUILD.gn still can't
be auto-merged, but for a slighly better reason.
The file was modifiedllvm/utils/gn/build/sync_source_lists_from_cmake.py
Commit 3f5a5dd295f5655c34feff829b0fd61ab1143710 by thakis
[gn build] re-run "gn format" on all .gn and .gni files
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/MC/AMDGPU/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/targets.gni
Commit 4eeb56d08874e1abe46d7f6d1dd492e717b93a35 by qshanz
[PowerPC] Don't do the folding if the operand is R0/X0

We have this transformation in PowerPC peephole:

Replace instruction:
  renamable $x28 = ADDI8 renamable $x7, -8
  renamable $x28 = ADD8 killed renamable $x28, renamable $x0
  STFD killed renamable $f0, -8, killed renamable $x28 :: (store 8 into %ir._ind_cast99.epil)
with:
  renamable $x28 = ADDI8 renamable $x7, -16
  STFDX killed renamable $f0, $x0, killed $x28 :: (store 8 into %ir._ind_cast99.epil)

It is invalid as the '$x0' in STFDX is constant 0, not register r0.

Reviewed By: Nemanjai

Differential Revision: https://reviews.llvm.org/D77034
The file was modifiedllvm/test/CodeGen/PowerPC/fold-frame-offset-using-rr.mir
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.cpp