Skip to content
  1. Jan 15, 2020
    • Hideto Ueno's avatar
      [Attributor] AAValueConstantRange: Value range analysis using constant range · 188f9a34
      Hideto Ueno authored
      Summary:
      This patch introduces `AAValueConstantRange`, which answers a possible range for integer value in a specific program point.
      One of the motivations is propagating existing `range` metadata. (I think we need to change the situation that `range` metadata cannot be put to Argument).
      
      The state is a tuple of `ConstantRange` and it is initialized to (known, assumed) = ([-∞, +∞], empty).
      
      Currently, AAValueConstantRange is created in `getAssumedConstant` method when `AAValueSimplify` returns `nullptr`(worst state).
      
      Supported
       - BinaryOperator(add, sub, ...)
       - CmpInst(icmp eq, ...)
       - !range metadata
      
      `AAValueConstantRange` is not intended to extend to polyhedral range value analysis.
      
      Reviewers: jdoerfert, sstefan1
      
      Reviewed By: jdoerfert
      
      Subscribers: phosek, davezarzycki, baziotis, hiraditya, javed.absar, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71620
      188f9a34
  2. Jan 14, 2020
  3. Jan 13, 2020
    • Teresa Johnson's avatar
      [ThinLTO/WPD] Fix index-based WPD for alias vtables · 31441a3e
      Teresa Johnson authored
      Summary:
      A recent fix in D69452 fixed index based WPD in the presence of
      available_externally vtables. It added a cast of the vtable def
      summary to a GlobalVarSummary. However, in some cases one def may be an
      alias, in which case we need to get the base object before casting,
      otherwise we will crash.
      
      Reviewers: evgeny777, steven_wu, aganea
      
      Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, arphaman, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71040
      31441a3e
  4. Jan 09, 2020
  5. Jan 07, 2020
  6. Jan 06, 2020
  7. Jan 04, 2020
    • Alexey Lapshin's avatar
      [Transforms][GlobalSRA] huge array causes long compilation time and huge memory usage. · 831bfcea
      Alexey Lapshin authored
      Summary:
      For artificial cases (huge array, few usages), Global SRA optimization creates
      a lot of redundant data. It creates an instance of GlobalVariable for each array
      element. For huge array, that means huge compilation time and huge memory usage.
      Following example compiles for 10 minutes and requires 40GB of memory.
      
      namespace {
        char LargeBuffer[64 * 1024 * 1024];
      }
      
      int main ( void ) {
      
          LargeBuffer[0] = 0;
      
          printf("\n ");
      
          return LargeBuffer[0] == 0;
      }
      
      The fix is to avoid Global SRA for large arrays.
      
      Reviewers: craig.topper, rnk, efriedma, fhahn
      
      Reviewed By: rnk
      
      Subscribers: xbolva00, lebedev.ri, lkail, merge_guards_bot, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71993
      831bfcea
  8. Jan 03, 2020
  9. Jan 01, 2020
    • Hideto Ueno's avatar
      [Attributor] AAValueConstantRange: Value range analysis using constant range · e9963034
      Hideto Ueno authored
      This patch introduces `AAValueConstantRange`, which answers a possible range for integer value in a specific program point.
      One of the motivations is propagating existing `range` metadata. (I think we need to change the situation that `range` metadata cannot be put to Argument).
      
      The state is a tuple of `ConstantRange` and it is initialized to (known, assumed) = ([-∞, +∞], empty).
      
      Currently, AAValueConstantRange is created when AAValueSimplify cannot
      simplify the value.
      
      Supported
       - BinaryOperator(add, sub, ...)
       - CmpInst(icmp eq, ...)
       - !range metadata
      
      `AAValueConstantRange` is not intended to extend to polyhedral range value analysis.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D71620
      e9963034
  10. Dec 31, 2019
  11. Dec 30, 2019
  12. Dec 29, 2019
    • Hideto Ueno's avatar
      [Attributor] AAUndefinedBehavior: Check for branches on undef value. · ef4febd8
      Hideto Ueno authored
      A branch is considered UB if it depends on an undefined / uninitialized value.
      At this point this handles simple UB branches in the form: `br i1 undef, ...`
      We query `AAValueSimplify` to get a value for the branch condition, so the branch
      can be more complicated than just: `br i1 undef, ...`.
      
      Patch By: Stefanos Baziotis (@baziotis)
      
      Reviewers: jdoerfert, sstefan1, uenoku
      
      Reviewed By: uenoku
      
      Differential Revision: https://reviews.llvm.org/D71799
      ef4febd8
  13. Dec 26, 2019
  14. Dec 25, 2019
    • Hideto Ueno's avatar
      [Attributor] Reach optimistic fixpoint in AAValueSimplify when the value is constant or undef · 1d5d074a
      Hideto Ueno authored
      Summary:
      As discussed in D71799, we have found that it is more useful to reach an optimistic fixpoint in AAValueSimpify when the value is constant or undef.
      
      Reviewers: jdoerfert, sstefan1
      
      Reviewed By: jdoerfert
      
      Subscribers: baziotis, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71852
      1d5d074a
    • Johannes Doerfert's avatar
      [Attributor] UB Attribute now handles all instructions that access memory through a pointer · 5732f56b
      Johannes Doerfert authored
      Summary:
      Follow-up on: https://reviews.llvm.org/D71435
      We basically use `checkForAllInstructions` to loop through all the instructions in a function that access memory through a pointer: load, store, atomicrmw, atomiccmpxchg
      Note that we can now use the `getPointerOperand()` that gets us the pointer operand for an instruction that belongs to the aforementioned set.
      
      Question: This function returns `nullptr` if the instruction is `volatile`. Why?
      Guess:  Because if it is volatile, we don't want to do any transformation to it.
      
      Another subtle point is that I had to add AtomicRMW, AtomicCmpXchg to `initializeInformationCache()`. Following `checkAllInstructions()` path, that
      seemed the most reasonable place to add it and correct the fact that these instructions were ignored (they were not in `OpcodeInstMap` etc.). Is that ok?
      
      Reviewers: jdoerfert, sstefan1
      
      Reviewed By: jdoerfert, sstefan1
      
      Subscribers: hiraditya, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71787
      5732f56b
    • Johannes Doerfert's avatar
      [Attributor] Function level undefined behavior attribute · 58f324a4
      Johannes Doerfert authored
      _Eventually_, this attribute will be assigned to a function if it
      contains undefined behavior. As a first small step, I tried to make it
      loop through the load instructions in a function (eventually, the plan
      is to check if a load instructions causes undefined behavior, because
      e.g. dereferences a null pointer - Also eventually, this won't happen in
      initialize() but in updateImpl()).
      
      Patch By: Stefanos Baziotis (@baziotis)
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D71435
      58f324a4
  15. Dec 22, 2019
  16. Dec 19, 2019
  17. Dec 17, 2019
  18. Dec 14, 2019
  19. Dec 13, 2019
  20. Dec 12, 2019
    • Johannes Doerfert's avatar
      [Attributor][FIX] Do treat byval arguments special · 6abd01e4
      Johannes Doerfert authored
      When we reason about the pointer argument that is byval we actually
      reason about a local copy of the value passed at the call site. This was
      not the case before and we wrongly introduced attributes based on the
      surrounding function.
      
      AAMemoryBehaviorArgument, AAMemoryBehaviorCallSiteArgument and
      AANoCaptureCallSiteArgument are made aware of byval now. The code
      to skip "subsuming positions" for reasoning follows a common pattern and
      we should refactor it. A TODO was added.
      
      Discovered by @efriedma as part of D69748.
      6abd01e4
    • Florian Hahn's avatar
      [Matrix] Add first set of matrix intrinsics and initial lowering pass. · 526244b1
      Florian Hahn authored
      This is the first patch adding an initial set of matrix intrinsics and a
      corresponding lowering pass. This has been discussed on llvm-dev:
      http://lists.llvm.org/pipermail/llvm-dev/2019-October/136240.html
      
      The first patch introduces four new intrinsics (transpose, multiply,
      columnwise load and store) and a LowerMatrixIntrinsics pass, that
      lowers those intrinsics to vector operations.
      
      Matrixes are embedded in a 'flat' vector (e.g. a 4 x 4 float matrix
      embedded in a <16 x float> vector) and the intrinsics take the dimension
      information as parameters. Those parameters need to be ConstantInt.
      For the memory layout, we initially assume column-major, but in the RFC
      we also described how to extend the intrinsics to support row-major as
      well.
      
      For the initial lowering, we split the input of the intrinsics into a
      set of column vectors, transform those column vectors and concatenate
      the result columns to a flat result vector.
      
      This allows us to lower the intrinsics without any shape propagation, as
      mentioned in the RFC. In follow-up patches, we plan to submit the
      following improvements:
       * Shape propagation to eliminate the embedding/splitting for each
         intrinsic.
       * Fused & tiled lowering of multiply and other operations.
       * Optimization remarks highlighting matrix expressions and costs.
       * Generate loops for operations on large matrixes.
       * More general block processing for operation on large vectors,
         exploiting shape information.
      
      We would like to add dedicated transpose, columnwise load and store
      intrinsics, even though they are not strictly necessary. For example, we
      could instead emit a large shufflevector instruction instead of the
      transpose. But we expect that to
        (1) become unwieldy for larger matrixes (even for 16x16 matrixes,
            the resulting shufflevector masks would be huge),
        (2) risk instcombine making small changes, causing us to fail to
            detect the transpose, preventing better lowerings
      
      For the load/store, we are additionally planning on exploiting the
      intrinsics for better alias analysis.
      
      Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor, efriedma, rengolin
      
      Reviewed By: anemet
      
      Differential Revision: https://reviews.llvm.org/D70456
      526244b1
    • Hideto Ueno's avatar
      4ecf2554
Loading