SuccessChanges

Summary

  1. [SelectionDAG] Resolve PR33978. rL306209 taught SelectionDAG how to add the dereferenceable flag when expanding memcpy and memmove. The fix however contained a nit where the offset + size was constructed as an APInt of PointerSize rather than PointerSizeInBits. This lead to isDereferenceableAndAlignedPointer() get truncated values or values which would be sign extended within that function leading to incorrect results. Thanks to Alex Crichton for reporting the issue! This resolves PR33978. Reviewers: inouehrs Differential Revision: https://reviews.llvm.org/D36236
  2. Removed unused variabled from unit test
  3. [Cloning] Move distinct GlobalVariable debug info metadata in CloneModule Duplicating the distinct Subprogram and CU metadata nodes seems like the incorrect thing to do in CloneModule for GlobalVariable debug info. As it results in the scope of the GlobalVariable DI no longer being consistent with the rest of the module, and the new CU is absent from llvm.dbg.cu. Fixed by adding RF_MoveDistinctMDs to MapMetadata flags for GlobalVariables. Current unit test IR after clone: ``` @gv = global i32 1, comdat($comdat), !dbg !0, !type !5 define private void @f() comdat($comdat) personality void ()* @persfn !dbg !14 { !llvm.dbg.cu = !{!10} !0 = !DIGlobalVariableExpression(var: !1) !1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true) !2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5) !3 = !DIFile(filename: "filename.c", directory: "/file/dir/") !4 = !DISubroutineType(types: !5) !5 = !{} !6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8) !7 = !DIFile(filename: "filename.c", directory: "/file/dir") !8 = !{!0} !9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)") !10 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !11) !11 = !{!12} !12 = !DIGlobalVariableExpression(var: !13) !13 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !14, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true) !14 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !10, variables: !5) ``` Patched IR after clone: ``` @gv = global i32 1, comdat($comdat), !dbg !0, !type !5 define private void @f() comdat($comdat) personality void ()* @persfn !dbg !2 { !llvm.dbg.cu = !{!6} !0 = !DIGlobalVariableExpression(var: !1) !1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true) !2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5) !3 = !DIFile(filename: "filename.c", directory: "/file/dir/") !4 = !DISubroutineType(types: !5) !5 = !{} !6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8) !7 = !DIFile(filename: "filename.c", directory: "/file/dir") !8 = !{!0} !9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)") ``` Reviewers: aprantl, probinson, dblaikie, echristo, loladiro Reviewed By: aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36082
  4. [ARM] GlobalISel: Select simple G_GLOBAL_VALUE instructions Add support in the instruction selector for G_GLOBAL_VALUE for ELF and MachO for the static relocation model. We don't handle Windows yet because that's Thumb-only, and we don't handle Thumb in general at the moment. Support for PIC, ROPI, RWPI and TLS will be added in subsequent commits. Differential Revision: https://reviews.llvm.org/D35883
  5. [X86] SET0 to use XMM registers where possible PR26018 PR32862 Differential Revision: https://reviews.llvm.org/D35965
  6. [SCEV] Re-enable "Cache results of computeExitLimit" The patch rL309080 was reverted because it did not clean up the cache on "forgetValue" method call. This patch re-enables this change, adds the missing check and introduces two new unit tests that make sure that the cache is cleaned properly. Differential Revision: https://reviews.llvm.org/D36087
  7. [globalisel][tablegen] Update a comment to use the name of the constant rather than the value.
Revision 309930 by sdardis:
[SelectionDAG] Resolve PR33978.

rL306209 taught SelectionDAG how to add the dereferenceable flag when
expanding memcpy and memmove. The fix however contained a nit where
the offset + size was constructed as an APInt of PointerSize rather
than PointerSizeInBits.

This lead to isDereferenceableAndAlignedPointer() get truncated values or
values which would be sign extended within that function leading to
incorrect results.

Thanks to Alex Crichton for reporting the issue!

This resolves PR33978.

Reviewers: inouehrs

Differential Revision: https://reviews.llvm.org/D36236
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/CodeGen/MachineInstr.cppllvm.src/lib/CodeGen/MachineInstr.cpp
The file was added/llvm/trunk/test/CodeGen/Mips/pr33978.llllvm.src/test/CodeGen/Mips/pr33978.ll
Revision 309929 by mkazantsev:
Removed unused variabled from unit test
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cppllvm.src/unittests/Analysis/ScalarEvolutionTest.cpp
Revision 309928 by ewancrawford:
[Cloning] Move distinct GlobalVariable debug info metadata in CloneModule

Duplicating the distinct Subprogram and CU metadata nodes seems like the incorrect thing to do in CloneModule for GlobalVariable debug info. As it results in the scope of the GlobalVariable DI no longer being consistent with the rest of the module, and the new CU is absent from llvm.dbg.cu.

Fixed by adding RF_MoveDistinctMDs to MapMetadata flags for GlobalVariables.

Current unit test IR after clone:
```
@gv = global i32 1, comdat($comdat), !dbg !0, !type !5

define private void @f() comdat($comdat) personality void ()* @persfn !dbg !14 {

!llvm.dbg.cu = !{!10}

!0 = !DIGlobalVariableExpression(var: !1)
!1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
!3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
!7 = !DIFile(filename: "filename.c", directory: "/file/dir")
!8 = !{!0}
!9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
!10 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !11)
!11 = !{!12}
!12 = !DIGlobalVariableExpression(var: !13)
!13 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !14, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!14 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !10, variables: !5)
```

Patched IR after clone:
```
@gv = global i32 1, comdat($comdat), !dbg !0, !type !5

define private void @f() comdat($comdat) personality void ()* @persfn !dbg !2 {

!llvm.dbg.cu = !{!6}

!0 = !DIGlobalVariableExpression(var: !1)
!1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
!3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
!7 = !DIFile(filename: "filename.c", directory: "/file/dir")
!8 = !{!0}
!9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
```

Reviewers: aprantl, probinson, dblaikie, echristo, loladiro
Reviewed By: aprantl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36082
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/Utils/CloneModule.cppllvm.src/lib/Transforms/Utils/CloneModule.cpp
The file was modified/llvm/trunk/unittests/Transforms/Utils/Cloning.cppllvm.src/unittests/Transforms/Utils/Cloning.cpp
Revision 309927 by rovka:
[ARM] GlobalISel: Select simple G_GLOBAL_VALUE instructions

Add support in the instruction selector for G_GLOBAL_VALUE for ELF and
MachO for the static relocation model. We don't handle Windows yet
because that's Thumb-only, and we don't handle Thumb in general at the
moment.

Support for PIC, ROPI, RWPI and TLS will be added in subsequent commits.

Differential Revision: https://reviews.llvm.org/D35883
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/ARM/ARMInstructionSelector.cppllvm.src/lib/Target/ARM/ARMInstructionSelector.cpp
The file was added/llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-instruction-select-globals.mirllvm.src/test/CodeGen/ARM/GlobalISel/arm-instruction-select-globals.mir
The file was added/llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-isel-globals.llllvm.src/test/CodeGen/ARM/GlobalISel/arm-isel-globals.ll
The file was modified/llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-unsupported.llllvm.src/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll
Revision 309926 by dinar:
[X86] SET0 to use XMM registers where possible PR26018 PR32862

Differential Revision: https://reviews.llvm.org/D35965
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/X86/X86InstrInfo.cppllvm.src/lib/Target/X86/X86InstrInfo.cpp
The file was modified/llvm/trunk/test/CodeGen/X86/avx-intrinsics-x86.llllvm.src/test/CodeGen/X86/avx-intrinsics-x86.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx2-vbroadcast.llllvm.src/test/CodeGen/X86/avx2-vbroadcast.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-arith.llllvm.src/test/CodeGen/X86/avx512-arith.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-build-vector.llllvm.src/test/CodeGen/X86/avx512-build-vector.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-cvt.llllvm.src/test/CodeGen/X86/avx512-cvt.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-gather-scatter-intrin.llllvm.src/test/CodeGen/X86/avx512-gather-scatter-intrin.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-intrinsics.llllvm.src/test/CodeGen/X86/avx512-intrinsics.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-mask-op.llllvm.src/test/CodeGen/X86/avx512-mask-op.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-masked-memop-64-32.llllvm.src/test/CodeGen/X86/avx512-masked-memop-64-32.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-mov.llllvm.src/test/CodeGen/X86/avx512-mov.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-select.llllvm.src/test/CodeGen/X86/avx512-select.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-skx-insert-subvec.llllvm.src/test/CodeGen/X86/avx512-skx-insert-subvec.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-vbroadcast.llllvm.src/test/CodeGen/X86/avx512-vbroadcast.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-vbroadcasti128.llllvm.src/test/CodeGen/X86/avx512-vbroadcasti128.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-vselect-crash.llllvm.src/test/CodeGen/X86/avx512-vselect-crash.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512-vselect.llllvm.src/test/CodeGen/X86/avx512-vselect.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512bw-mov.llllvm.src/test/CodeGen/X86/avx512bw-mov.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512bwvl-mov.llllvm.src/test/CodeGen/X86/avx512bwvl-mov.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512ifma-intrinsics.llllvm.src/test/CodeGen/X86/avx512ifma-intrinsics.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512ifmavl-intrinsics.llllvm.src/test/CodeGen/X86/avx512ifmavl-intrinsics.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512vbmi-intrinsics.llllvm.src/test/CodeGen/X86/avx512vbmi-intrinsics.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512vbmivl-intrinsics.llllvm.src/test/CodeGen/X86/avx512vbmivl-intrinsics.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512vl-arith.llllvm.src/test/CodeGen/X86/avx512vl-arith.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512vl-intrinsics.llllvm.src/test/CodeGen/X86/avx512vl-intrinsics.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512vl-mov.llllvm.src/test/CodeGen/X86/avx512vl-mov.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512vl-vbroadcast.llllvm.src/test/CodeGen/X86/avx512vl-vbroadcast.ll
The file was modified/llvm/trunk/test/CodeGen/X86/avx512vl-vec-masked-cmp.llllvm.src/test/CodeGen/X86/avx512vl-vec-masked-cmp.ll
The file was modified/llvm/trunk/test/CodeGen/X86/compress_expand.llllvm.src/test/CodeGen/X86/compress_expand.ll
The file was modified/llvm/trunk/test/CodeGen/X86/fma_patterns.llllvm.src/test/CodeGen/X86/fma_patterns.ll
The file was modified/llvm/trunk/test/CodeGen/X86/fma_patterns_wide.llllvm.src/test/CodeGen/X86/fma_patterns_wide.ll
The file was modified/llvm/trunk/test/CodeGen/X86/madd.llllvm.src/test/CodeGen/X86/madd.ll
The file was modified/llvm/trunk/test/CodeGen/X86/masked_gather_scatter.llllvm.src/test/CodeGen/X86/masked_gather_scatter.ll
The file was modified/llvm/trunk/test/CodeGen/X86/masked_memop.llllvm.src/test/CodeGen/X86/masked_memop.ll
The file was modified/llvm/trunk/test/CodeGen/X86/merge-consecutive-loads-512.llllvm.src/test/CodeGen/X86/merge-consecutive-loads-512.ll
The file was modified/llvm/trunk/test/CodeGen/X86/nontemporal-2.llllvm.src/test/CodeGen/X86/nontemporal-2.ll
The file was modified/llvm/trunk/test/CodeGen/X86/nontemporal-loads.llllvm.src/test/CodeGen/X86/nontemporal-loads.ll
The file was modified/llvm/trunk/test/CodeGen/X86/sad.llllvm.src/test/CodeGen/X86/sad.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-lzcnt-256.llllvm.src/test/CodeGen/X86/vector-lzcnt-256.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-lzcnt-512.llllvm.src/test/CodeGen/X86/vector-lzcnt-512.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-popcnt-512.llllvm.src/test/CodeGen/X86/vector-popcnt-512.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shift-ashr-512.llllvm.src/test/CodeGen/X86/vector-shift-ashr-512.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-256-v16.llllvm.src/test/CodeGen/X86/vector-shuffle-256-v16.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-256-v32.llllvm.src/test/CodeGen/X86/vector-shuffle-256-v32.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-256-v4.llllvm.src/test/CodeGen/X86/vector-shuffle-256-v4.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-512-v16.llllvm.src/test/CodeGen/X86/vector-shuffle-512-v16.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-512-v64.llllvm.src/test/CodeGen/X86/vector-shuffle-512-v64.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-512-v8.llllvm.src/test/CodeGen/X86/vector-shuffle-512-v8.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-avx512.llllvm.src/test/CodeGen/X86/vector-shuffle-avx512.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-avx512bw.llllvm.src/test/CodeGen/X86/vector-shuffle-combining-avx512bw.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-shuffle-v1.llllvm.src/test/CodeGen/X86/vector-shuffle-v1.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-tzcnt-256.llllvm.src/test/CodeGen/X86/vector-tzcnt-256.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vector-tzcnt-512.llllvm.src/test/CodeGen/X86/vector-tzcnt-512.ll
The file was modified/llvm/trunk/test/CodeGen/X86/vselect-pcmp.llllvm.src/test/CodeGen/X86/vselect-pcmp.ll
Revision 309925 by mkazantsev:
[SCEV] Re-enable "Cache results of computeExitLimit"

The patch rL309080 was reverted because it did not clean up the cache on "forgetValue"
method call. This patch re-enables this change, adds the missing check and introduces
two new unit tests that make sure that the cache is cleaned properly.

Differential Revision: https://reviews.llvm.org/D36087
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/Analysis/ScalarEvolution.hllvm.src/include/llvm/Analysis/ScalarEvolution.h
The file was modified/llvm/trunk/lib/Analysis/ScalarEvolution.cppllvm.src/lib/Analysis/ScalarEvolution.cpp
The file was added/llvm/trunk/test/Analysis/ScalarEvolution/cache_loop_exit_limit.llllvm.src/test/Analysis/ScalarEvolution/cache_loop_exit_limit.ll
The file was modified/llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cppllvm.src/unittests/Analysis/ScalarEvolutionTest.cpp
Revision 309924 by dsanders:
[globalisel][tablegen] Update a comment to use the name of the constant rather than the value.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/CodeGen/GlobalISel/InstructionSelector.hllvm.src/include/llvm/CodeGen/GlobalISel/InstructionSelector.h