SuccessChanges

Summary

  1. Revert "[BasicAA] Handle two unknown sizes for GEPs" (details)
  2. [AIX] Change the code based on https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20201214/864235.html (details)
  3. [clang-format][NFC] Expand BreakBeforeBraces examples (details)
  4. [DebugInfo] Support Fortran 'use <external module>' statement. (details)
  5. [NFC][InstSimplify] Add miscompiled testcase from D87188/D87197 (details)
  6. [InstSimplify] Don't miscompile `X == 0 ? abs(X) : -abs(X) --> -abs(X)` xform (details)
  7. [InstCombine] Canonicalize SPF to abs intrinsic (details)
  8. [GVNHoist] Remove successorDominate (NFC) (details)
  9. [RISCV] Add intrinsics for vmv.x.s and vmv.s.x (details)
  10. [NFC][InstCombine] Fixup check lines for prof md in select_meta.ll test (details)
Commit a74941da716d29a1d962d17b8112c40a8a45f9e7 by flo
Revert "[BasicAA] Handle two unknown sizes for GEPs"

Temporarily revert commit 8b1c4e310c2f9686cad925ad81d8e2be10a1ef3c.

After 8b1c4e310c2f the compile-time for `MultiSource/Benchmarks/MiBench/consumer-lame`
dramatically increases with -O3 & LTO, causing issues for builders with
that configuration.

I filed PR48553 with a smallish reproducer that shows a 10-100x compile
time increase.
The file was modifiedllvm/test/Analysis/BasicAA/phi-aa.ll
The file was modifiedllvm/test/Analysis/BasicAA/recphi.ll
The file was modifiedllvm/lib/Analysis/BasicAliasAnalysis.cpp
The file was modifiedllvm/test/Transforms/LoopVectorize/ARM/pointer_iv.ll
The file was modifiedllvm/test/Transforms/LoopVersioning/exit-block-dominates-rt-check-block.ll
Commit d551e40f1cff7a63218f34112bd0dddaa2b12dbb by diggerlin
[AIX] Change the code based on https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20201214/864235.html

Summary:

change the code based on the discussion as:
https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20201214/864235.html
The file was modifiedllvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp
Commit 5e5ef5359742c3feb6f41058a356a28c7ab3ea6d by bjoern
[clang-format][NFC] Expand BreakBeforeBraces examples

Differential Revision: https://reviews.llvm.org/D93170
The file was modifiedclang/docs/ClangFormatStyleOptions.rst
The file was modifiedclang/include/clang/Format/Format.h
Commit 5f75dcf5719f8ba2819b73109888175cf92fe253 by chih-ping.chen
[DebugInfo] Support Fortran 'use <external module>' statement.

The main change is to add a 'IsDecl' field to DIModule so
that when IsDecl is set to true, the debug info entry generated
for the module would be marked as a declaration. That way, the debugger
would look up the definition of the module in the gloabl scope.

Please see the comments in llvm/test/DebugInfo/X86/dimodule.ll
for what the debug info entries would look like.

Differential Revision: https://reviews.llvm.org/D93462
The file was addedllvm/test/Bitcode/DIModule-fortran-external-module.ll
The file was modifiedllvm/unittests/IR/MetadataTest.cpp
The file was modifiedllvm/lib/IR/AsmWriter.cpp
The file was modifiedllvm/lib/Bitcode/Reader/MetadataLoader.cpp
The file was modifiedllvm/include/llvm/IR/DebugInfoMetadata.h
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
The file was modifiedllvm/lib/IR/DIBuilder.cpp
The file was addedllvm/test/DebugInfo/X86/dimodule.ll
The file was modifiedllvm/lib/Bitcode/Writer/BitcodeWriter.cpp
The file was modifiedllvm/lib/IR/DebugInfoMetadata.cpp
The file was modifiedllvm/test/Assembler/dimodule.ll
The file was modifiedllvm/lib/AsmParser/LLParser.cpp
The file was modifiedllvm/lib/IR/LLVMContextImpl.h
The file was modifiedllvm/include/llvm/IR/DIBuilder.h
Commit 9b183a1452c7e5091be01661188b7cb04d842a4c by lebedev.ri
[NFC][InstSimplify] Add miscompiled testcase from D87188/D87197

Thanks to Dave Green for producing an actionable reproducer!
It is (obviously) a miscompile:
```
----------------------------------------
define i32 @select_abs_of_abs_eq_wrong(i32 %x, i32 %y) {
%0:
  %abs = abs i32 %x, 0
  %neg = sub i32 0, %abs
  %cmp = icmp eq i32 %y, 0
  %sel = select i1 %cmp, i32 %neg, i32 %abs
  ret i32 %sel
}
=>
define i32 @select_abs_of_abs_eq_wrong(i32 %x, i32 %y) {
%0:
  %abs = abs i32 %x, 0
  ret i32 %abs
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
i32 %x = #xe0000000 (3758096384, -536870912)
i32 %y = #x00000000 (0)

Source:
i32 %abs = #x20000000 (536870912)
i32 %neg = #xe0000000 (3758096384, -536870912)
i1 %cmp = #x1 (1)
i32 %sel = #xe0000000 (3758096384, -536870912)

Target:
i32 %abs = #x20000000 (536870912)
Source value: #xe0000000 (3758096384, -536870912)
Target value: #x20000000 (536870912)

Alive2: Transform doesn't verify!

```
The file was modifiedllvm/test/Transforms/InstSimplify/abs_intrinsic.ll
Commit e9289dc25f7923abff9ac762bd3f6819c0605f20 by lebedev.ri
[InstSimplify] Don't miscompile `X == 0 ? abs(X) : -abs(X) --> -abs(X)` xform

The transform wasn't checking that the LHS of the comparison
*is* the `X` in question...
This is the miscompile that was holding up D87188.

Thanks to Dave Green for producing an actionable reproducer!
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
The file was modifiedllvm/test/Transforms/InstSimplify/abs_intrinsic.ll
Commit 897c985e1e21927b2870f964bb07ff293bd74407 by lebedev.ri
[InstCombine] Canonicalize SPF to abs intrinsic

This patch enables canonicalization of SPF_ABS and SPF_ABS
to the abs intrinsic.

This is a recommit, the original try was
05d4c4ebc2fb006b8a2bd05b24c6aba10dd2eef8,
but it was reverted due to an apparent miscompile,
which since then has just been fixed by the previous commit.

Differential Revision: https://reviews.llvm.org/D87188
The file was modifiedllvm/test/Transforms/InstCombine/select_meta.ll
The file was modifiedllvm/test/Transforms/PhaseOrdering/X86/vector-reductions.ll
The file was modifiedllvm/test/Transforms/PhaseOrdering/min-max-abs-cse.ll
The file was modifiedllvm/test/Transforms/InstCombine/call-callconv.ll
The file was modifiedllvm/test/Transforms/InstCombine/abs_abs.ll
The file was modifiedllvm/test/Transforms/InstCombine/icmp.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
The file was modifiedllvm/test/Transforms/InstCombine/max-of-nots.ll
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll
The file was modifiedclang/test/CodeGen/builtins-wasm.c
The file was modifiedllvm/test/Transforms/InstCombine/abs-1.ll
The file was modifiedllvm/test/Transforms/InstCombine/cttz-abs.ll
Commit 5ac37725df32c5d01460cbe221bd2a7481763c9d by kazu
[GVNHoist] Remove successorDominate (NFC)

The function was introduced on Aug 25, 2016 in commit
5f0d0e60d11b8d2e48aacf31a82762280f9a8712.

Its last use was removed on Sep 13, 2017 in commit
dfa8741c9693c344477c842a25ee0cb6a6f59fcd.
The file was modifiedllvm/lib/Transforms/Scalar/GVNHoist.cpp
Commit 86d282baede58f675ea6df8d64bfee582b6679b7 by craig.topper
[RISCV] Add intrinsics for vmv.x.s and vmv.s.x

This adds intrinsics for vmv.x.s and vmv.s.x.

I've used stricter type constraints on these intrinsics than what we've been doing on the arithmetic intrinsics so far. This will allow us to not need to pass the scalar type to the Intrinsic::getDeclaration call when creating these intrinsics.

A custom ISD is used for vmv.x.s in order to implement the change in computeNumSignBitsForTargetNode which can remove sign extends on the result.

I also modified the MC layer description of these instructions to show the tied source/dest operand. This is different than what we do for masked instructions where we drop the tied source operand when converting to MC. But it is a more accurate description of the instruction. We can't do this for masked instructions since we use the same MC instruction for masked and unmasked. Tools like llvm-mca operate in the MC layer and rely on ins/outs and Uses/Defs for analysis so I don't know if we'll be able to maintain the current behavior for masked instructions. So I went with the accurate description here since it was easy.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D93365
The file was addedllvm/test/CodeGen/RISCV/rvv/vmv.s.x-rv32.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
The file was modifiedllvm/include/llvm/IR/IntrinsicsRISCV.td
The file was addedllvm/test/CodeGen/RISCV/rvv/vmv.s.x-rv64.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vmv.x.s-rv64.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vmv.x.s-rv32.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.h
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoV.td
Commit 0e94ba9d40d931fc1c647347302f39d24bd88d96 by lebedev.ri
[NFC][InstCombine] Fixup check lines for prof md in select_meta.ll test
The file was modifiedllvm/test/Transforms/InstCombine/select_meta.ll