Skip to content
Snippets Groups Projects
  1. Oct 06, 2017
  2. Oct 05, 2017
    • Peter Collingbourne's avatar
      ModuleUtils: Stop using comdat members to generate unique module ids. · 715bcfe0
      Peter Collingbourne authored
      It is possible for two modules to define the same set of external
      symbols without causing a duplicate symbol error at link time,
      as long as each of the symbols is a comdat member. So we cannot
      use them as part of a unique id for the module.
      
      Differential Revision: https://reviews.llvm.org/D38602
      
      llvm-svn: 315026
      715bcfe0
    • Reid Kleckner's avatar
      [X86] Extract CATCHRET handling from emitEpilogue, NFC · 67694190
      Reid Kleckner authored
      llvm-svn: 315023
      67694190
    • Derek Schuff's avatar
      [WebAssembly] Add the rest of the atomic loads · 885dc592
      Derek Schuff authored
      Add extending loads and constant offset patterns
      A bit more refactoring of the tablegen to make the patterns fairly nice and
      uniform between the regular and atomic loads.
      
      Differential Revision: https://reviews.llvm.org/D38523
      
      llvm-svn: 315022
      885dc592
    • Sanjay Patel's avatar
      [InstCombine] improve folds for icmp gt/lt (shr X, C1), C2 · 7ac2db6a
      Sanjay Patel authored
      We can always eliminate the shift in: icmp gt/lt (shr X, C1), C2 --> icmp gt/lt X, C'
      This patch was supposed to just be an efficiency improvement because we were doing this 3-step process to fold:
      
      IC: Visiting:   %c = icmp ugt i4 %s, 1
      IC: ADD:   %s = lshr i4 %x, 1
      IC: ADD:   %1 = udiv i4 %x, 2
      IC: Old =   %c = icmp ugt i4 %1, 1
          New =   <badref> = icmp uge i4 %x, 4
      IC: ADD:   %c = icmp uge i4 %x, 4
      IC: ERASE   %2 = icmp ugt i4 %1, 1
      IC: Visiting:   %c = icmp uge i4 %x, 4
      IC: Old =   %c = icmp uge i4 %x, 4
          New =   <badref> = icmp ugt i4 %x, 3
      IC: ADD:   %c = icmp ugt i4 %x, 3
      IC: ERASE   %2 = icmp uge i4 %x, 4
      IC: Visiting:   %c = icmp ugt i4 %x, 3
      IC: DCE:   %1 = udiv i4 %x, 2
      IC: ERASE   %1 = udiv i4 %x, 2
      IC: DCE:   %s = lshr i4 %x, 1
      IC: ERASE   %s = lshr i4 %x, 1
      IC: Visiting:   ret i1 %c
      
      When we could go directly to canonical icmp form:
      
      IC: Visiting:   %c = icmp ugt i4 %s, 1
      IC: Old =   %c = icmp ugt i4 %s, 1
          New =   <badref> = icmp ugt i4 %x, 3
      IC: ADD:   %c = icmp ugt i4 %x, 3
      IC: ERASE   %1 = icmp ugt i4 %s, 1
      IC: ADD:   %s = lshr i4 %x, 1
      IC: DCE:   %s = lshr i4 %x, 1
      IC: ERASE   %s = lshr i4 %x, 1
      IC: Visiting:   %c = icmp ugt i4 %x, 3
      
      ...but then I noticed that the folds were incomplete too:
      https://godbolt.org/g/aB2hLE
      
      Here are attempts to prove the logic with Alive:
      https://rise4fun.com/Alive/92o
      
      Name: lshr_ult
      Pre: ((C2 << C1) u>> C1) == C2
      %sh = lshr i8 %x, C1
      %r = icmp ult i8 %sh, C2
        =>
      %r = icmp ult i8 %x, (C2 << C1)
      
      Name: ashr_slt
      Pre: ((C2 << C1) >> C1) == C2
      %sh = ashr i8 %x, C1
      %r = icmp slt i8 %sh, C2
        =>
      %r = icmp slt i8 %x, (C2 << C1)
      
      Name: lshr_ugt
      Pre: (((C2+1) << C1) u>> C1) == (C2+1)
      %sh = lshr i8 %x, C1
      %r = icmp ugt i8 %sh, C2
        =>
      %r = icmp ugt i8 %x, ((C2+1) << C1) - 1
      
      Name: ashr_sgt
      Pre: (C2 != 127) && ((C2+1) << C1 != -128) && (((C2+1) << C1) >> C1) == (C2+1)
      %sh = ashr i8 %x, C1
      %r = icmp sgt i8 %sh, C2
        =>
      %r = icmp sgt i8 %x, ((C2+1) << C1) - 1
      
      Name: ashr_exact_sgt
      Pre: ((C2 << C1) >> C1) == C2
      %sh = ashr exact i8 %x, C1
      %r = icmp sgt i8 %sh, C2
        =>
      %r = icmp sgt i8 %x, (C2 << C1)
      
      Name: ashr_exact_slt
      Pre: ((C2 << C1) >> C1) == C2
      %sh = ashr exact i8 %x, C1
      %r = icmp slt i8 %sh, C2
        =>
      %r = icmp slt i8 %x, (C2 << C1)
      
      Name: lshr_exact_ugt
      Pre: ((C2 << C1) u>> C1) == C2
      %sh = lshr exact i8 %x, C1
      %r = icmp ugt i8 %sh, C2
        =>
      %r = icmp ugt i8 %x, (C2 << C1)
      
      Name: lshr_exact_ult
      Pre: ((C2 << C1) u>> C1) == C2
      %sh = lshr exact i8 %x, C1
      %r = icmp ult i8 %sh, C2
        =>
      %r = icmp ult i8 %x, (C2 << C1)
      
      We did something similar for 'shl' in D28406.
      
      Differential Revision: https://reviews.llvm.org/D38514
      
      llvm-svn: 315021
      7ac2db6a
    • Krzysztof Parzyszek's avatar
    • Francis Ricci's avatar
      [dsymutil] Fix typo in swift-ast.test · 6ae88262
      Francis Ricci authored
      llvm-svn: 315017
      6ae88262
    • Dehao Chen's avatar
      Annotate VP prof on indirect call if it is ICPed in the profiled binary. · 16f01fb1
      Dehao Chen authored
      Summary: In SamplePGO, when an indirect call is promoted in the profiled binary, before profile annotation, it will be promoted and inlined. For the original indirect call, the current implementation will not mark VP profile on it. This is an issue when profile becomes stale. This patch annotates VP prof on indirect calls during annotation.
      
      Reviewers: tejohnson
      
      Reviewed By: tejohnson
      
      Subscribers: sanjoy, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D38477
      
      llvm-svn: 315016
      16f01fb1
    • Francis Ricci's avatar
      [llvm-dsymutil] Add support for __swift_ast MachO DWARF section · 2b513b5c
      Francis Ricci authored
      Summary:
      Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging,
      and which contains a byte-for-byte dump of the swiftmodule file.
      Add this feature to llvm-dsymutil.
      
      Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of
      `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil
      (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the
      __swift_ast section).
      
      Reviewers: aprantl, friss
      
      Subscribers: llvm-commits, JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D38504
      
      llvm-svn: 315014
      2b513b5c
    • Krzysztof Parzyszek's avatar
      [Hexagon] Give uniform names to functions changing addressing modes, NFC · 7ae3ae9e
      Krzysztof Parzyszek authored
      The new format is changeAddrMode_xx_yy, where xx is the current mode,
      and yy is the new one.
      
      Old name:               New name:
      getBaseWithImmOffset    changeAddrMode_abs_io
      getAbsoluteForm         changeAddrMode_io_abs
      getBaseWithRegOffset    changeAddrMode_io_rr
      xformRegToImmOffset     changeAddrMode_rr_io
      getBaseWithLongOffset   changeAddrMode_rr_ur
      getRegShlForm           changeAddrMode_ur_rr
      
      llvm-svn: 315013
      7ae3ae9e
    • Rafael Espindola's avatar
      Added phdr upper bound checks to ElfObject. · 42eb1f2b
      Rafael Espindola authored
      Ensure the program_headers call will fail correctly if the program
      headers are larger than the underlying buffer.
      
      Patch by Parker Thompson!
      
      llvm-svn: 315012
      42eb1f2b
    • Francis Ricci's avatar
      Revert "[llvm-dsymutil] Add support for __swift_ast MachO DWARF section" · 5f689d0d
      Francis Ricci authored
      This reverts commit r315004, because of a failing test on non-apple platforms
      
      llvm-svn: 315009
      5f689d0d
    • Francis Ricci's avatar
      [dsymutil] Fix unused variable warning · 4407767f
      Francis Ricci authored
      llvm-svn: 315006
      4407767f
    • Francis Ricci's avatar
      [llvm-dsymutil] Add support for __swift_ast MachO DWARF section · 77672776
      Francis Ricci authored
      Summary:
      Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging,
      and which contains a byte-for-byte dump of the swiftmodule file.
      Add this feature to llvm-dsymutil.
      
      Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of
      `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil
      (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the
      __swift_ast section).
      
      Reviewers: aprantl, friss
      
      Subscribers: llvm-commits, JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D38504
      
      llvm-svn: 315004
      77672776
Loading