1. Feb 24, 2017
    • Stanislav Mekhanoshin's avatar
      Correct register pressure calculation in presence of subregs · ce3ddd2d
      Stanislav Mekhanoshin authored
      If a subreg is used in an instruction it counts as a whole superreg
      for the purpose of register pressure calculation. This patch corrects
      improper register pressure calculation by examining operand's lane mask.
      
      Differential Revision: https://reviews.llvm.org/D29835
      
      llvm-svn: 296009
      ce3ddd2d
    • Ahmed Bougacha's avatar
      [ORE] Use const CodeRegions in the remark diagnostics. NFC. · 851125dc
      Ahmed Bougacha authored
      llvm-svn: 296008
      851125dc
    • Ahmed Bougacha's avatar
      [CodeGen] Add a way to SkipDebugLoc in MachineInstr::print(). NFC. · 43192246
      Ahmed Bougacha authored
      llvm-svn: 296007
      43192246
    • Ahmed Bougacha's avatar
      [GlobalISel] Simplify Select type cleanup using a ScopeExit. NFC. · 1b333944
      Ahmed Bougacha authored
      This lets us use more natural early-returns when selection fails.
      
      llvm-svn: 296006
      1b333944
    • Adrian Prantl's avatar
      Revert "Teach the IR verifier to reject conflicting debug info for function arguments." · 29cf0c43
      Adrian Prantl authored
      This reverts commit r295749 while investigating PR32042.
      
      It looks like this check uncovered a problem in the frontend that
      needs to be fixed before the check can be enabled again.
      
      llvm-svn: 296005
      29cf0c43
    • Sanjay Patel's avatar
      [DAG] add convenience function to get -1 constant; NFCI · 4a4fbe16
      Sanjay Patel authored
      llvm-svn: 296004
      4a4fbe16
    • Chad Rosier's avatar
      [Reassociate] Add negated value of negative constant to the Duplicates list. · 95abfa35
      Chad Rosier authored
      In OptimizeAdd, we scan the operand list to see if there are any common factors
      between operands that can be factored out to reduce the number of multiplies
      (e.g., 'A*A+A*B*C+D' -> 'A*(A+B*C)+D'). For each operand of the operand list, we
      only consider unique factors (which is tracked by the Duplicate set). Now if we
      find a factor that is a negative constant, we add the negated value as a factor
      as well, because we can percolate the negate out. However, we mistakenly don't
      add this negated constant to the Duplicates set.
      
      Consider the expression A*2*-2 + B. Obviously, nothing to factor.
      
      For the added value A*2*-2 we over count 2 as a factor without this change,
      which causes the assert reported in PR30256.  The problem is that this code is
      assuming that all the multiply operands of the add are already reassociated.
      This change avoids the issue by making OptimizeAdd tolerate multiplies which
      haven't been completely optimized; this sort of works, but we're doing wasted
      work: we'll end up revisiting the add later anyway.
      
      Another possible approach would be to enforce RPO iteration order more strongly.
      If we have RedoInsts, we process them immediately in RPO order, rather than
      waiting until we've finished processing the whole function. Intuitively, it
      seems like the natural approach: reassociation works on expression trees, so
      the optimization only works in one direction. That said, I'm not sure how
      practical that is given the current Reassociate; the "optimal" form for an
      expression depends on its use list (see all the uses of "user_back()"), so
      Reassociate is really an iterative optimization of sorts, so any changes here
      would probably get messy.
      
      PR30256
      
      Differential Revision: https://reviews.llvm.org/D30228
      
      llvm-svn: 296003
      95abfa35
    • Dehao Chen's avatar
      Use base discriminator in sample pgo profile matching. · 533bc6ea
      Dehao Chen authored
      Summary: The discriminator has been encoded, and only the base discriminator should be used during profile matching.
      
      Reviewers: dblaikie, davidxl
      
      Reviewed By: dblaikie, davidxl
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D30218
      
      llvm-svn: 295999
      533bc6ea
    • Michael Kruse's avatar
      [Support] Remove NonowningIslPtr. NFC. · f4e201e0
      Michael Kruse authored
      NonowningIslPtr<isl_X> was used as types of function parameters when the
      function does not consume the isl object, i.e. an __isl_keep parameter.
      
      The alternatives are:
      
      1. IslPtr<isl_X>
         This has additional calls to isl_X_copy and isl_X_free to
         increase/decrease the reference counter even though not needed. The
         caller already owns a reference to the isl object.
      
      2. const IslPtr<isl_X>&
         This does not change the reference counter, but requires an
         additional load to get the pointer to the isl object (instead of just
         passing the pointer itself).
         Moreover, the compiler cannot rely on the constness of the pointer
         and has to reload the pointer every time it writes to memory (unless
         alias analysis such as TBAA says it is not possible).
      
      The isl C++ bindings currently in development do not have an equivalent
      to NonowningIslPtr and adding one would make the binding more
      complicated and its advantage in performance is small. In order to
      simplify the transition to these C++ bindings, remove NonowningIslPtr.
      Change every former use of it to alternative 2 mentioned aboce
      (const IslPtr<isl_X>&).
      
      llvm-svn: 295998
      f4e201e0
    • Krzysztof Parzyszek's avatar
      [Hexagon] Avoid IMPLICIT_DEFs as new-value producers · 2cfc7a48
      Krzysztof Parzyszek authored
      llvm-svn: 295997
      2cfc7a48
    • Adam Nemet's avatar
      [LazyMachineBFI] Reimplement with getAnalysisIfAvailable · b516cf3f
      Adam Nemet authored
      Since LoopInfo is not available in machine passes as universally as in IR
      passes, using the same approach for OptimizationRemarkEmitter as we did for IR
      will run LoopInfo and DominatorTree unnecessarily.  (LoopInfo is not used
      lazily by ORE.)
      
      To fix this, I am modifying the approach I took in D29836.  LazyMachineBFI now
      uses its client passes including MachineBFI itself that are available or
      otherwise compute them on the fly.
      
      So for example GreedyRegAlloc, since it's already using MBFI, will reuse that
      instance.  On the other hand, AsmPrinter in Justin's patch will generate DT,
      LI and finally BFI on the fly.
      
      (I am of course wondering now if the simplicity of this approach is even
      preferable in IR.  I will do some experiments.)
      
      Testing is provided by an updated version of D29837 which requires Justin's
      patch to bring ORE to the AsmPrinter.
      
      Differential Revision: https://reviews.llvm.org/D30128
      
      llvm-svn: 295996
      b516cf3f
    • Filipe Cabecinhas's avatar
      [test] Use @LINE macro · 3f4181db
      Filipe Cabecinhas authored
      llvm-svn: 295995
      3f4181db
    • Filipe Cabecinhas's avatar
      [AddressSanitizer] Add PS4 offset · 33dd486f
      Filipe Cabecinhas authored
      llvm-svn: 295994
      33dd486f
    • Rafael Espindola's avatar
      Make InputSection a class. NFC. · 774ea7d0
      Rafael Espindola authored
      With the current design an InputSection is basically anything that
      goes directly in a OutputSection. That includes plain input section
      but also synthetic sections, so this should probably not be a
      template.
      
      llvm-svn: 295993
      774ea7d0
    • Sanjay Patel's avatar
      68e4cb3c
    • Sanjay Patel's avatar
      [InstCombine] use 'match' to reduce code; NFCI · adf2ab16
      Sanjay Patel authored
      llvm-svn: 295991
      adf2ab16
    • Jan Vesely's avatar
      AMDGPU/SI: Fix trunc i16 pattern · 70293a04
      Jan Vesely authored
      Hit on ASICs that support 16bit instructions.
      
      Differential Revision: https://reviews.llvm.org/D30281
      
      llvm-svn: 295990
      70293a04
    • Simon Pilgrim's avatar
      Strip trailing whitespace. · 4c0ea9d4
      Simon Pilgrim authored
      llvm-svn: 295989
      4c0ea9d4
    • Manuel Klimek's avatar
      Make clang-include-fixer--insert-line work when the difference is on an empty line · c38cd692
      Manuel Klimek authored
      `clang-include-fixer--insert-line` has an off-by-one error because it
      uses `(goto-char (point-min)) (forward-char chars)`, which is (goto-char
      (1+ chars))`. Because of this, when the first difference was on an empty
      line (i.e. an include was appended to the block of includes), the
      pointer in the `to` buffer would be on the next line.
      
      Also wrapped calls inside another process sentinel inside `with-local-quit`.
      
      Patch by Torsten Marek.
      
      Differential Revision: https://reviews.llvm.org/D30292
      
      llvm-svn: 295988
      c38cd692
  2. Feb 23, 2017