Skip to content
  1. Dec 12, 2017
  2. Dec 11, 2017
    • Matt Arsenault's avatar
      LSR: Check more intrinsic pointer operands · 3e268cc0
      Matt Arsenault authored
      llvm-svn: 320424
      3e268cc0
    • Hans Wennborg's avatar
      Revert r320407 "[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast." · 27d1c00c
      Hans Wennborg authored
      The tests fail (opt asserts) on Windows.
      
      > Summary:
      > If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
      > &V2)))), bitcast)`, but the load is used in other instructions, it leads
      > to looping in InstCombiner. Patch adds additional check that all users
      > of the load instructions are stores and then replaces all uses of load
      > instruction by the new one with new type.
      >
      > Reviewers: RKSimon, spatel, majnemer
      >
      > Subscribers: llvm-commits
      >
      > Differential Revision: https://reviews.llvm.org/D41072
      
      llvm-svn: 320421
      27d1c00c
    • Adrian Prantl's avatar
      ASAN: Provide reliable debug info for local variables at -O0. · 3c6c14d1
      Adrian Prantl authored
      The function stack poisioner conditionally stores local variables
      either in an alloca or in malloc'ated memory, which has the
      unfortunate side-effect, that the actual address of the variable is
      only materialized when the variable is accessed, which means that
      those variables are mostly invisible to the debugger even when
      compiling without optimizations.
      
      This patch stores the address of the local stack base into an alloca,
      which can be referred to by the debug info and is available throughout
      the function. This adds one extra pointer-sized alloca to each stack
      frame (but mem2reg can optimize it away again when optimizations are
      enabled, yielding roughly the same debug info quality as before in
      optimized code).
      
      rdar://problem/30433661
      
      Differential Revision: https://reviews.llvm.org/D41034
      
      llvm-svn: 320415
      3c6c14d1
    • Alexey Bataev's avatar
      [InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast. · ec128ace
      Alexey Bataev authored
      Summary:
      If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
      &V2)))), bitcast)`, but the load is used in other instructions, it leads
      to looping in InstCombiner. Patch adds additional check that all users
      of the load instructions are stores and then replaces all uses of load
      instruction by the new one with new type.
      
      Reviewers: RKSimon, spatel, majnemer
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41072
      
      llvm-svn: 320407
      ec128ace
    • Alexander Potapenko's avatar
      [MSan] Hotfix compilation · 3c934e48
      Alexander Potapenko authored
      For some reason the override directives got removed in r320373.
      I suspect this to be an unwanted effect of clang-format.
      
      llvm-svn: 320381
      3c934e48
    • Alexander Potapenko's avatar
      [MSan] introduce getShadowOriginPtr(). NFC. · c07e6a0e
      Alexander Potapenko authored
      This patch introduces getShadowOriginPtr(), a method that obtains both the shadow and origin pointers for an address as a Value pair.
      The existing callers of getShadowPtr() and getOriginPtr() are updated to use getShadowOriginPtr().
      
      The rationale for this change is to simplify KMSAN instrumentation implementation.
      In KMSAN origins tracking is always enabled, and there's no direct mapping between the app memory and the shadow/origin pages.
      Both the shadow and the origin pointer for a given address are obtained by calling a single runtime hook from the instrumentation,
      therefore it's easier to work with those pointers together.
      
      Reviewed at https://reviews.llvm.org/D40835.
      
      llvm-svn: 320373
      c07e6a0e
  3. Dec 10, 2017
  4. Dec 09, 2017
  5. Dec 08, 2017
    • Adrian Prantl's avatar
      Generalize llvm::replaceDbgDeclare and actually support the use-case that · d1317017
      Adrian Prantl authored
      is mentioned in the documentation (inserting a deref before the plus_uconst).
      
      llvm-svn: 320203
      d1317017
    • Florian Hahn's avatar
      [CodeExtractor] Add debug locations for new call and branch instrs. · e5089e2e
      Florian Hahn authored
      Summary:
      If a partially inlined function has debug info, we have to add debug
      locations to the call instruction calling the outlined function.
      We use the debug location of the first instruction in the outlined
      function, as the introduced call transfers control to this statement and
      there is no other equivalent line in the source code.
      
      We also use the same debug location for the branch instruction added
      to jump from artificial entry block for the outlined function, which just
      jumps to the first actual basic block of the outlined function.
      
      Reviewers: davide, aprantl, rriddle, dblaikie, danielcdh, wmi
      
      Reviewed By: aprantl, rriddle, danielcdh
      
      Subscribers: eraman, JDevlieghere, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D40413
      
      llvm-svn: 320199
      e5089e2e
    • Xinliang David Li's avatar
      Revert r320104: infinite loop profiling bug fix · d91057bf
      Xinliang David Li authored
      Causes unexpected memory issue with New PM this time.
      The new PM invalidates BPI but not BFI, leaving the
      reference to BPI from BFI invalid.
      
      Abandon this patch.  There is a more general solution
      which also handles runtime infinite loop (but not statically).
      
      llvm-svn: 320180
      d91057bf
    • Brian M. Rzycki's avatar
      [JumpThreading] Minor comment cleanup. NFC. (test commit) · 0eae123d
      Brian M. Rzycki authored
      llvm-svn: 320179
      0eae123d
    • Alexey Bataev's avatar
      [InstCombine] PR35354: Convert store(bitcast, load bitcast (select (Cond, &V1,... · ec95c6cc
      Alexey Bataev authored
      [InstCombine] PR35354: Convert store(bitcast, load bitcast (select (Cond, &V1, &V2))  --> store (, load (select(Cond, load &V1, load &V2)))
      
      Summary:
      If we have the code like this:
      ```
      float a, b;
      a = std::max(a ,b);
      ```
      it is converted into something like this:
      ```
      %call = call dereferenceable(4) float* @_ZSt3maxIfERKT_S2_S2_(float* nonnull dereferenceable(4) %a.addr, float* nonnull dereferenceable(4) %b.addr)
      %1 = bitcast float* %call to i32*
      %2 = load i32, i32* %1, align 4
      %3 = bitcast float* %a.addr to i32*
      store i32 %2, i32* %3, align 4
      ```
      After inlinning this code is converted to the next:
      ```
      %1 = load float, float* %a.addr
      %2 = load float, float* %b.addr
      %cmp.i = fcmp fast olt float %1, %2
      %__b.__a.i = select i1 %cmp.i, float* %a.addr, float* %b.addr
      %3 = bitcast float* %__b.__a.i to i32*
      %4 = load i32, i32* %3, align 4
      %5 = bitcast float* %arrayidx to i32*
      store i32 %4, i32* %5, align 4
      
      ```
      This pattern is not recognized as minmax pattern.
      Patch solves this problem by converting sequence
      ```
      store (bitcast, (load bitcast (select ((cmp V1, V2), &V1, &V2))))
      ```
      to a sequence
      ```
      store (,load (select((cmp V1, V2), &V1, &V2)))
      ```
      After this the code is recognized as minmax pattern.
      
      Reviewers: RKSimon, spatel
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D40304
      
      llvm-svn: 320157
      ec95c6cc
  6. Dec 07, 2017
  7. Dec 06, 2017
Loading