SuccessChanges

Summary

  1. llvm-reduce: Avoid use-after-free when removing a branch instruction Found my msan buildbot & pointed out by Nico Weber - thanks Nico!
  2. [Object] Extend MachOUniversalBinary::getObjectForArch Make the method MachOUniversalBinary::getObjectForArch return MachOUniversalBinary::ObjectForArch and add helper methods MachOUniversalBinary::getMachOObjectForArch, MachOUniversalBinary::getArchiveForArch for those who explicitly expect to get a MachOObjectFile or an Archive. Differential revision: https://reviews.llvm.org/D67700 Test plan: make check-all
  3. [utils] Add minimal support for MIR inputs to update_llc_test_checks.py update_{llc,mir}_test_checks.py applicability is determined by the output (assembly or MIR), not the input, which makes update_llc_test_checks.py the right tool to generate tests that start at MIR and stop at the final assembly. This commit adds the minimal support for this path. Main limitation that remains: - MIR has to have LLVM IR section, and the CHECK lines will be inserted into the LLVM IR functions that correspond to the MIR functions. Running ../utils/update_llc_test_checks.py --llc-binary ./bin/llc on a slightly modified ../test/CodeGen/X86/bad-tls-fold.mir produces the following diff: +# NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +# RUN: llc %s -o - | FileCheck %s --- | target triple = "x86_64-unknown-linux-gnu" @@ -6,17 +7,31 @@ @i = external thread_local global i32 define i32 @or() { + ; CHECK-LABEL: or: + ; CHECK: # %bb.0: # %entry + ; CHECK-NEXT: movq {{.*}}(%rip), %rax + ; CHECK-NEXT: orq $7, %rax + ; CHECK-NEXT: movq i@{{.*}}(%rip), %rcx + ; CHECK-NEXT: orq %rax, %rcx + ; CHECK-NEXT: movl %fs:(%rcx), %eax + ; CHECK-NEXT: retq entry: ret i32 undef } - define i32 @and() { + ; CHECK-LABEL: and: + ; CHECK: # %bb.0: # %entry + ; CHECK-NEXT: movq {{.*}}(%rip), %rax + ; CHECK-NEXT: orq $7, %rax + ; CHECK-NEXT: movq i@{{.*}}(%rip), %rcx + ; CHECK-NEXT: andq %rax, %rcx + ; CHECK-NEXT: movl %fs:(%rcx), %eax + ; CHECK-NEXT: retq entry: ret i32 undef } ... (not applied)
  4. [utils] Amend update_llc_test_checks.py to non-llc tooling, NFC Very minor change aiming to make it easier to extend the script downstream to support non-llc, but llc-like tools. The main objective is to decrease the probability of merge conflicts.
Revision 372280 by dblaikie:
llvm-reduce: Avoid use-after-free when removing a branch instruction

Found my msan buildbot & pointed out by Nico Weber - thanks Nico!
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp (diff)llvm.src/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
Revision 372278 by alexshap:
[Object] Extend MachOUniversalBinary::getObjectForArch

Make the method MachOUniversalBinary::getObjectForArch return MachOUniversalBinary::ObjectForArch
and add helper methods MachOUniversalBinary::getMachOObjectForArch, MachOUniversalBinary::getArchiveForArch
for those who explicitly expect to get a MachOObjectFile or an Archive.

Differential revision: https://reviews.llvm.org/D67700

Test plan: make check-all
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/Object/MachOUniversal.h (diff)llvm.src/include/llvm/Object/MachOUniversal.h
The file was modified/llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp (diff)llvm.src/lib/DebugInfo/Symbolize/Symbolize.cpp
The file was modified/llvm/trunk/lib/Object/MachOUniversal.cpp (diff)llvm.src/lib/Object/MachOUniversal.cpp
The file was modified/llvm/trunk/lib/Object/Object.cpp (diff)llvm.src/lib/Object/Object.cpp
The file was modified/llvm/trunk/lib/ProfileData/Coverage/CoverageMappingReader.cpp (diff)llvm.src/lib/ProfileData/Coverage/CoverageMappingReader.cpp
The file was modified/llvm/trunk/tools/llvm-lipo/llvm-lipo.cpp (diff)llvm.src/tools/llvm-lipo/llvm-lipo.cpp
The file was modified/llvm/trunk/tools/llvm-objdump/MachODump.cpp (diff)llvm.src/tools/llvm-objdump/MachODump.cpp
Revision 372277 by rtereshin:
[utils] Add minimal support for MIR inputs to update_llc_test_checks.py

update_{llc,mir}_test_checks.py applicability is determined by the
output (assembly or MIR), not the input, which makes
update_llc_test_checks.py the right tool to generate tests that start at
MIR and stop at the final assembly.

This commit adds the minimal support for this path. Main limitation that
remains:

- MIR has to have LLVM IR section, and the CHECK lines will be inserted
  into the LLVM IR functions that correspond to the MIR functions.

Running
  ../utils/update_llc_test_checks.py --llc-binary ./bin/llc
on a slightly modified  ../test/CodeGen/X86/bad-tls-fold.mir

produces the following diff:

+# NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+# RUN: llc %s -o - | FileCheck %s
--- |
   target triple = "x86_64-unknown-linux-gnu"

@@ -6,17 +7,31 @@
   @i = external thread_local global i32

   define i32 @or() {
+  ; CHECK-LABEL: or:
+  ; CHECK:       # %bb.0: # %entry
+  ; CHECK-NEXT:    movq {{.*}}(%rip), %rax
+  ; CHECK-NEXT:    orq $7, %rax
+  ; CHECK-NEXT:    movq i@{{.*}}(%rip), %rcx
+  ; CHECK-NEXT:    orq %rax, %rcx
+  ; CHECK-NEXT:    movl %fs:(%rcx), %eax
+  ; CHECK-NEXT:    retq
   entry:
     ret i32 undef
   }
-
   define i32 @and() {
+  ; CHECK-LABEL: and:
+  ; CHECK:       # %bb.0: # %entry
+  ; CHECK-NEXT:    movq {{.*}}(%rip), %rax
+  ; CHECK-NEXT:    orq $7, %rax
+  ; CHECK-NEXT:    movq i@{{.*}}(%rip), %rcx
+  ; CHECK-NEXT:    andq %rax, %rcx
+  ; CHECK-NEXT:    movl %fs:(%rcx), %eax
+  ; CHECK-NEXT:    retq
   entry:
     ret i32 undef
   }
...

(not applied)
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/utils/update_llc_test_checks.py (diff)llvm.src/utils/update_llc_test_checks.py
Revision 372276 by rtereshin:
[utils] Amend update_llc_test_checks.py to non-llc tooling, NFC

Very minor change aiming to make it easier to extend the script
downstream to support non-llc, but llc-like tools. The main objective is
to decrease the probability of merge conflicts.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/utils/update_llc_test_checks.py (diff)llvm.src/utils/update_llc_test_checks.py