Skip to content
  1. Jan 09, 2019
  2. Jan 08, 2019
  3. Jan 07, 2019
  4. Jan 05, 2019
  5. Jan 04, 2019
    • Joel E. Denny's avatar
      [OpenMP] Refactor const restriction for linear · bae586fb
      Joel E. Denny authored
      As discussed in D56113, this patch refactors the implementation of the
      const restriction for linear to reuse a function introduced by D56113.
      A side effect is that, if a variable has mutable members, this
      diagnostic is now skipped, and the diagnostic for the variable not
      being an integer or pointer is reported instead.
      
      Reviewed By: ABataev
      
      Differential Revision: https://reviews.llvm.org/D56299
      
      llvm-svn: 350441
      bae586fb
    • Joel E. Denny's avatar
      [OpenMP] Refactor const restriction for reductions · d2649292
      Joel E. Denny authored
      As discussed in D56113, this patch refactors the implementation of the
      const restriction for reductions to reuse a function introduced by
      D56113.  A side effect is that diagnostics sometimes now say
      "variable" instead of "list item" when a list item is a variable.
      
      Reviewed By: ABataev
      
      Differential Revision: https://reviews.llvm.org/D56298
      
      llvm-svn: 350440
      d2649292
    • Joel E. Denny's avatar
      [OpenMP] Replace predetermined shared for const variable · e6234d14
      Joel E. Denny authored
      The following appears in OpenMP 3.1 sec. 2.9.1.1 as a predetermined
      data-sharing attribute:
      
      > Variables with const-qualified type having no mutable member are
      > shared.
      
      It does not appear in OpenmP 4.0, 4.5, or 5.0.  This patch removes the
      implementation of that attribute when the requested OpenMP version is
      greater than 3.1.
      
      One effect of that removal is that `default(none)` affects const
      variables without mutable members.
      
      Also, without this patch, if a const variable without mutable members
      was explicitly lastprivate or private, it was an error because it was
      predetermined shared.  Now, clang instead complains that it's const
      without mutable fields, which is a more intelligible diagnostic.  That
      should be fine for all of the above versions because they all have
      something like the following, which is quoted from OpenMP 5.0
      sec. 2.19.3:
      
      > A variable that is privatized must not have a const-qualified type
      > unless it is of class type with a mutable member. This restriction does
      > not apply to the firstprivate clause.
      
      reduction and linear clauses already have separate checks for const
      variables.  Future patches will merge the implementations.
      
      Reviewed By: ABataev
      
      Differential Revision: https://reviews.llvm.org/D56113
      
      llvm-svn: 350439
      e6234d14
    • Peter Collingbourne's avatar
      hwasan: Implement lazy thread initialization for the interceptor ABI. · 87f477b5
      Peter Collingbourne authored
      The problem is similar to D55986 but for threads: a process with the
      interceptor hwasan library loaded might have some threads started by
      instrumented libraries and some by uninstrumented libraries, and we
      need to be able to run instrumented code on the latter.
      
      The solution is to perform per-thread initialization lazily. If a
      function needs to access shadow memory or add itself to the per-thread
      ring buffer its prologue checks to see whether the value in the
      sanitizer TLS slot is null, and if so it calls __hwasan_thread_enter
      and reloads from the TLS slot. The runtime does the same thing if it
      needs to access this data structure.
      
      This change means that the code generator needs to know whether we
      are targeting the interceptor runtime, since we don't want to pay
      the cost of lazy initialization when targeting a platform with native
      hwasan support. A flag -fsanitize-hwaddress-abi={interceptor,platform}
      has been introduced for selecting the runtime ABI to target. The
      default ABI is set to interceptor since it's assumed that it will
      be more common that users will be compiling application code than
      platform code.
      
      Because we can no longer assume that the TLS slot is initialized,
      the pthread_create interceptor is no longer necessary, so it has
      been removed.
      
      Ideally, lazy initialization should only cost one instruction in the
      hot path, but at present the call may cause us to spill arguments
      to the stack, which means more instructions in the hot path (or
      theoretically in the cold path if the spills are moved with shrink
      wrapping). With an appropriately chosen calling convention for
      the per-thread initialization function (TODO) the hot path should
      always need just one instruction and the cold path should need two
      instructions with no spilling required.
      
      Differential Revision: https://reviews.llvm.org/D56038
      
      llvm-svn: 350429
      87f477b5
Loading