1. Apr 26, 2020
  2. Apr 25, 2020
    • Alexander Belyaev's avatar
      [MLIR] Replace splitBlock() with createBlock in GenericAtomicRMWOp lowering. · f31db760
      Alexander Belyaev authored
      `addArgument()` is not undoable and should not be used in
      ConversionPattern, therefore replacing `splitBlock()` with
      `createBlock()`, that creates a block with specified args.
      
      Differential Revision: https://reviews.llvm.org/D78731
      f31db760
    • Sanjay Patel's avatar
      [x86] use vector instructions to lower even more FP->int->FP casts · 7f4ff782
      Sanjay Patel authored
      This is another enhancement to D77895/D78362
      to avoid a round-trip from XMM->GPR->XMM.
      This time we handle the case of starting/ending with different FP types
      but always with signed i32 as the intermediate value.
      I think this covers all of the faux vector optimization possibilities
      for pre-AVX512.
      
      There is at least 1 other transform mentioned in PR36617:
      https://bugs.llvm.org/show_bug.cgi?id=36617#c19
      ...where we fold an 'fpext' into a preceding 'sitofp'. I think we will
      want to handle that earlier (DAGCombiner or instcombine) because that's
      a target-independent optimization.
      
      Differential Revision: https://reviews.llvm.org/D78758
      7f4ff782
    • Sanjay Patel's avatar
      [InstCombine] generalize canonicalization of masked equality comparisons · 4abab5c5
      Sanjay Patel authored
        (X | MaskC) == C --> (X & ~MaskC) == C ^ MaskC
        (X | MaskC) != C --> (X & ~MaskC) != C ^ MaskC
      
      We have more analyis for 'and' patterns and already lean this way
      in the existing code, so this should be neutral or better in IR.
      
      If this does not do as well in codegen, the problem already exists
      and we should fix that based on target costs/heuristics.
      
      http://volta.cs.utah.edu:8080/z/oP3ecL
      
      define void @src(i8 %x, i8 %OrC, i8 %C, i1* %p0, i1* %p1) {
        %or = or i8 %x, %OrC
        %eq = icmp eq i8 %or, %C
        store i1 %eq, i1* %p0
      
        %ne = icmp ne i8 %or, %C
        store i1 %ne, i1* %p1
        ret void
      }
      
      define void @tgt(i8 %x, i8 %OrC, i8 %C, i1* %p0, i1* %p1) {
        %NotOrC = xor i8 %OrC, -1
        %a = and i8 %x, %NotOrC
        %NewC = xor i8 %C, %OrC
        %eq = icmp eq i8 %a, %NewC
        store i1 %eq, i1* %p0
      
        %ne = icmp ne i8 %a, %NewC
        store i1 %ne, i1* %p1
        ret void
      }
      4abab5c5
    • Florian Hahn's avatar
      [DSE] Add stat for remaining stores after DSE. · 46a04940
      Florian Hahn authored
      Using the existing NumFastStores statistic can be misleading when
      comparing the impact of DSE patches.
      
      For example, consider the case where a store gets removed from a
      function before it is inlined into another function. A less
      powerful DSE might only remove the store from functions it has
      been inlined into, which will result in more stores being removed, but
      no difference in the actual number of stores after DSE.
      
      The new stat provides the absolute number of stores surviving after
      DSE.
      
      Reviewers: dmgreen, bryant, asbirlea, jfb
      
      Reviewed By: asbirlea
      
      Differential Revision: https://reviews.llvm.org/D78830
      46a04940
    • Sanjay Patel's avatar
    • Juneyoung Lee's avatar
      [ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into more constants/instructions · f5677fe7
      Juneyoung Lee authored
      Summary:
      This patch helps isGuaranteedNotToBeUndefOrPoison look into more constants and instructions (bitcast/alloca/gep/fcmp).
      
      To deal with bitcast, Depth is added to isGuaranteedNotToBeUndefOrPoison.
      
      This patch is splitted from https://reviews.llvm.org/D75808.
      
      Checked with Alive2
      
      Reviewers: reames, jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: sanwou01, spatel, llvm-commits, hiraditya
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D76010
      f5677fe7
    • Florian Hahn's avatar
      [ValueLattice] Merging unknown with empty CR is unknown. · 82ce3347
      Florian Hahn authored
      Currently an unknown/undef value is marked as overdefined when merged
      with an empty range. An empty range can occur in unreachable/dead code.
      When merging the new unknown state (= no value known yet) with an empty
      range, there still isn't any information about the value yet and we can
      stay in unknown.
      
      This gives a few nice improvements on the number of instructions removed
      by IPSCCP:
      Same hash: 170 (filtered out)
      Remaining: 67
      Metric: sccp.IPNumInstRemoved
      
      Program                                        base     patch    diff
       test-suite...rks/FreeBench/mason/mason.test     3.00   6.00 100.0%
       test-suite...nchmarks/McCat/18-imp/imp.test     3.00   5.00 66.7%
       test-suite...C/CFP2000/179.art/179.art.test     2.00   3.00 50.0%
       test-suite...ijndael/security-rijndael.test     2.00   3.00 50.0%
       test-suite...ks/Prolangs-C/agrep/agrep.test    40.00  58.00 45.0%
       test-suite...ce/Applications/Burg/burg.test    26.00  37.00 42.3%
       test-suite...cCat/03-testtrie/testtrie.test     3.00   4.00 33.3%
       test-suite...Source/Benchmarks/sim/sim.test    29.00  36.00 24.1%
       test-suite.../Applications/spiff/spiff.test     9.00  11.00 22.2%
       test-suite...s/FreeBench/neural/neural.test     5.00   6.00 20.0%
       test-suite...pplications/treecc/treecc.test    66.00  79.00 19.7%
       test-suite...langs-C/football/football.test    85.00 101.00 18.8%
       test-suite...ce/Benchmarks/PAQ8p/paq8p.test    90.00 105.00 16.7%
       test-suite...oxyApps-C++/miniFE/miniFE.test    37.00  43.00 16.2%
       test-suite...rks/FreeBench/pifft/pifft.test    26.00  30.00 15.4%
       test-suite...lications/sqlite3/sqlite3.test   481.00  548.00  13.9%
       test-suite...marks/7zip/7zip-benchmark.test   4875.00 5522.00 13.3%
       test-suite.../CINT2000/176.gcc/176.gcc.test   1117.00 1197.00  7.2%
       test-suite...0.perlbench/400.perlbench.test   1618.00 1732.00  7.0%
      
      Reviewers: efriedma, nikic, davide
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D78667
      82ce3347
    • Igor Kudrin's avatar
      [LLD][ELF] Implement --discard-* for cases when -r or --emit-relocs are used. · 66e4eb9c
      Igor Kudrin authored
      When discarding local symbols with --discard-all or --discard-locals,
      the ones which are used in relocations should be preserved. LLD used
      the simplest approach and just ignored those switches when -r or
      --emit-relocs was specified.
      
      The patch implements handling the --discard-* switches for the cases
      when relocations are kept by identifying used local symbols and allowing
      removing only unused ones. This makes the behavior of LLD compatible
      with GNU linkers.
      
      Differential Revision: https://reviews.llvm.org/D77807
      66e4eb9c
    • Igor Kudrin's avatar
      [DebugInfo][DWARF64] Fix dumping pre-standard .debug_str_offsets.dwo sections. · d1d5f0b1
      Igor Kudrin authored
      The sizes of offsets in the `.debug_str_offsets.dwo` section depend on
      the format of compilation or type units referencing them: 4 bytes for
      DWARF32 units and 8 bytes for DWARF64 ones. The fix uses parsed units
      to determine the actual size of offsets in the corresponding part of
      the `.debug_str_offsets.dwo` section.
      
      Differential Revision: https://reviews.llvm.org/D78555
      d1d5f0b1
    • Igor Kudrin's avatar
      [llvm-dwp] Refuse DWARFv5 input DWP files. · 575d9ba1
      Igor Kudrin authored
      The library can parse DWARFv5 unit index sections of DWP files, but
      llvm-dwp is not ready to process them. Refuse such input files for now.
      
      Differential Revision: https://reviews.llvm.org/D77143
      575d9ba1
    • Simon Pilgrim's avatar