Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Apr 27, 2015
  1. @alexey-bataev

    [OPENMP] Codegen for 'taskwait' directive.

    alexey-bataev authored
    Emit the following code for 'taskwait' directive within tied task:
    call i32 @__kmpc_omp_taskwait(<loc>, i32 <thread_id>);
    Differential Revision: http://reviews.llvm.org/D9245
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235836 91177308-0d34-0410-b5e6-96231b3b80d8
  2. @alexey-bataev

    [OPENMP] Codegen for 'reduction' clause in 'sections' directive.

    alexey-bataev authored
    Emit a code for reduction clause. Next code should be emitted for reductions:
    
    static kmp_critical_name lock = { 0 };
    
    void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
        *(Type0*)lhs[0] = ReductionOperation0(*(Type0*)lhs[0], *(Type0*)rhs[0]);
          ...
            *(Type<n>-1*)lhs[<n>-1] =
              ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
                *(Type<n>-1*)rhs[<n>-1]);
    }
    
    ...
    void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n>-1]};
    switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
    case 1:
      <LHSExprs>[0] = ReductionOperation0(*<LHSExprs>[0], *<RHSExprs>[0]);
      ...
      <LHSExprs>[<n>-1] = ReductionOperation<n>-1(*<LHSExprs>[<n>-1], *<RHSExprs>[<n>-1]);
      __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
      break;
    case 2:
      Atomic(<LHSExprs>[0] = ReductionOperation0(*<LHSExprs>[0], *<RHSExprs>[0]));
      ...
      Atomic(<LHSExprs>[<n>-1] = ReductionOperation<n>-1(*<LHSExprs>[<n>-1], *<RHSExprs>[<n>-1]));
      break;
    default:;
    }
    Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.
    If sections directive has only single section, then original shared variables are used instead with barrier at the end of the directive.
    Differential Revision: http://reviews.llvm.org/D9242
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235835 91177308-0d34-0410-b5e6-96231b3b80d8
  3. @alexey-bataev

    [OPENMP] Codegen for 'lastprivate' clause in 'sections' directive.

    alexey-bataev authored
    #pragma omp sections lastprivate(<var>)
    <BODY>;
    This construct is translated into something like:
    
    <last_iter> = alloca i32
    <init for lastprivates>;
    <last_iter> = 0
    ; No initializer for simple variables or a default constructor is called for objects.
    ; For arrays perform element by element initialization by the call of the default constructor.
    ...
    OMP_FOR_START(...,<last_iter>, ..); sets <last_iter> to 1 if this is the last iteration.
    <BODY>
    ...
    OMP_FOR_END
    if (<last_iter> != 0) {
      <final copy for lastprivate>; Update original variable with the lastprivate value.
    }
    call __kmpc_cancel_barrier() ; an implicit barrier to avoid possible data race.
    If there is only one section, there is no special code generation, original shared variables are used + barrier is emitted at the end of the directive.
    Differential Revision: http://reviews.llvm.org/D9240
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235834 91177308-0d34-0410-b5e6-96231b3b80d8
  4. @alexey-bataev

    [OPENMP] Codegen for 'private' clause in 'sections' directive.

    alexey-bataev authored
    If there are 2 or more sections in a 'section' directive the following code is generated:
    
    <default init for privates>
    @__kmpc_for_static_init_4();
    <BODY for sections directive>
    @__kmpc_for_static_fini()
    If there is only one section, the following code is generated:
    
    if (@__kmpc_single()) {
      <default init for privates>
      @__kmpc_end_single();
    }
    Differential Revision: http://reviews.llvm.org/D9239
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235833 91177308-0d34-0410-b5e6-96231b3b80d8
  5. @alexey-bataev

    [OPENMP] Codegen for 'private' clause in 'single' directive.

    alexey-bataev authored
    Emit the following code for 'single' directive with 'private' clause:
    
    if (@__kmpc_single()) {
      <default init for privates>
      @__kmpc_end_single();
    }
    Differential Revision: http://reviews.llvm.org/D9238
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235832 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Apr 26, 2015
  1. @majnemer

    [Sema] Do not permit binding a reference to a compound literal

    majnemer authored
    We could probably make this work if we cared enough.  However, we are
    far outside any language rules at this point.
    
    This fixes PR21834.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235818 91177308-0d34-0410-b5e6-96231b3b80d8
  2. @majnemer

    [Sema] Don't allow unverified bitfields in FieldDecls

    majnemer authored
    VerifyBitField must be called if we are to form a bitfield FieldDecl.
    We will not verify the bitfield if the decl is known to be malformed in
    other ways; pretend that we don't have a bitfield if this happens.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235816 91177308-0d34-0410-b5e6-96231b3b80d8
  3. @rjmccall

    Correctly handle zero-sized but non-empty base classes in IRGen.

    rjmccall authored
    Fixes rdar://20621065.
    
    A more elegant fix would preclude this case by defining the
    rules such that zero-size classes are always formally empty.
    I believe the only extensions which create zero-size classes
    right now are flexible arrays and zero-length arrays; it's
    not abstractly unreasonable to say that those don't count
    as members for the purposes of emptiness, just as zero-width
    bitfields don't count.  But that's an ABI-affecting change
    and requires further discussion; in the meantime, let's not
    assert / miscompile.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235815 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Apr 25, 2015
  1. @dcci

    [Sema] Check if a builtin is FunctionPrototype().

    dcci authored
    Don't assume it's always is. This prevents a crash in Sema while
    trying to merge return type for a builtin w/out function prototype.
     
    PR:		23086
    Differential Revision:	http://reviews.llvm.org/D9235
    Reviewed by:	rsmith
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235806 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Apr 24, 2015
  1. @bogner

    InstrProf: Fix coverage maps for conditional operators

    bogner authored
    This fixes a crash when we're emitting coverage and a macro appears
    between two binary conditional operators, ie, "foo ?: MACRO ?: bar",
    and fixes the interaction of macros and conditional operators in
    general.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235793 91177308-0d34-0410-b5e6-96231b3b80d8
  2. @nico

    clang-cl: Don't look up absolute paths in %LIB%.

    nico authored
    Before this patch, passing a non-existent absolute path to clang-cl would cause
    stat'ing of impossible paths. For example, `clang-cl -c d:\adsfasdf.txt` would
    cause a stat of
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIBd:\asdfadsf.cc
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235787 91177308-0d34-0410-b5e6-96231b3b80d8
  3. [opaque pointer type] Update test cases now that the type for an invo…

    David Blaikie authored
    …ke is just a function type, not a pointer-to-function type
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235756 91177308-0d34-0410-b5e6-96231b3b80d8
  4. @alexey-bataev

    [OPENMP] Codegen for 'firstprivate' clause in 'single' directive.

    alexey-bataev authored
    Emit the following code for 'single' directive with 'firtstprivate' clause:
    
    if (@__kmpc_single()) {
      <init for firstprivates>
      @__kmpc_end_single();
    }
    @__kmpc_cancel_barrier(); // To avoid data race in firstprivate init
    Differential Revision: http://reviews.llvm.org/D9223
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235694 91177308-0d34-0410-b5e6-96231b3b80d8
  5. @alexey-bataev

    [OPENMP] Do not emit implicit barrier for single directive with 'copy…

    alexey-bataev authored
    …private' clause(s).
    
    Runtime function for 'copyprivate' directive generates implicit barriers, so no need to emit it.
    Differential Revision: http://reviews.llvm.org/D9215
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235692 91177308-0d34-0410-b5e6-96231b3b80d8
  6. @alexey-bataev

    [OPENMP] Codegen for 'firstprivate' clause in 'sections' directive.

    alexey-bataev authored
    If there are 2 or more sections in a 'section' directive the following code is generated:
    
    <init for firstprivates>
    @__kmpc_cancel_barrier();// To avoid data race in firstprivate init
    @__kmpc_for_static_init_4();
    <BODY for sections directive>
    @__kmpc_for_static_fini()
    If there is only one section, the following code is generated:
    
    if (@__kmpc_single()) {
      <init for firstprivates>
      @__kmpc_end_single();
    }
    @__kmpc_cancel_barrier(); // To avoid data race in firstprivate init
    Differential Revision: http://reviews.llvm.org/D9214
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235691 91177308-0d34-0410-b5e6-96231b3b80d8
  7. @majnemer

    [MS ABI] Fix the preferred alignment of member pointers

    majnemer authored
    Member pointers in the MS ABI have different alignment depending on
    whether they were created on the stack or live in a record.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235681 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Apr 23, 2015
  1. @zygoloid

    [modules] Properly attribute macros to modules if they're in a file t…

    zygoloid authored
    …extually included into a file in the module.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235661 91177308-0d34-0410-b5e6-96231b3b80d8
  2. Don't emit lifetime markers when msan is enabled

    Reid Kleckner authored
    In r235553, Clang started emitting lifetime markers more often. This
    caused false negative in MSan, because MSan only poisons all allocas
    once at function entry. Eventually, MSan should poison allocas at
    lifetime start and probably also lifetime end, but until then, let's not
    emit markers that aren't going to be useful.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235613 91177308-0d34-0410-b5e6-96231b3b80d8
  3. @AaronBallman

    Extend format specifier checking to include field function pointers i…

    AaronBallman authored
    …n addition to variable function pointers. Addresses PR21082.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235606 91177308-0d34-0410-b5e6-96231b3b80d8
  4. @AaronBallman
  5. @alexey-bataev
  6. @majnemer

    [MS ABI] Add support for mangling VLA types

    majnemer authored
    Treat a VLA type like an incomplete array type.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235575 91177308-0d34-0410-b5e6-96231b3b80d8
  7. @alexey-bataev

    [OPENMP] Codegen for 'atomic capture'.

    alexey-bataev authored
    Adds codegen for 'atomic capture' constructs with the following forms of expressions/statements:
    
    v = x binop= expr;
    v = x++;
    v = ++x;
    v = x--;
    v = --x;
    v = x = x binop expr;
    v = x = expr binop x;
    {v = x; x = binop= expr;}
    {v = x; x++;}
    {v = x; ++x;}
    {v = x; x--;}
    {v = x; --x;}
    {x = x binop expr; v = x;}
    {x binop= expr; v = x;}
    {x++; v = x;}
    {++x; v = x;}
    {x--; v = x;}
    {--x; v = x;}
    {x = x binop expr; v = x;}
    {x = expr binop x; v = x;}
    {v = x; x = expr;}
    If x and expr are integer and binop is associative or x is a LHS in a RHS of the assignment expression, and atomics are allowed for type of x on the target platform atomicrmw instruction is emitted.
    Otherwise compare-and-swap sequence is emitted.
    Update of 'v' is not required to be be atomic with respect to the read or write of the 'x'.
    
    bb:
    ...
    atomic load <x>
    cont:
    <expected> = phi [ <x>, label %bb ], [ <new_failed>, %cont ]
    <desired> = <expected> binop <expr>
    <res> = cmpxchg atomic &<x>, desired, expected
    <new_failed> = <res>.field1;
    br <res>field2, label %exit, label %cont
    exit:
    atomic store <old/new x>, <v>
    ...
    Differential Revision: http://reviews.llvm.org/D9049
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235573 91177308-0d34-0410-b5e6-96231b3b80d8
  8. @majnemer

    [MS ABI] Treat ConstantArrayType like IncompleteArrayType in args

    majnemer authored
    Type backreferences for arguments use the DecayedType's original type.
    Because of this, arguments with the same canonical type with the same
    mangling would not backreference each other if one was a
    ConstantArrayType while the other was an IncompleteArrayType.  Solve
    this by canonicalizing the ConstantArrayType to a suitable
    IncompleteArrayType.
    
    This fixes PR23325.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235572 91177308-0d34-0410-b5e6-96231b3b80d8
  9. @vonosmas

    Unify the way we report overflow in increment/decrement operator.

    vonosmas authored
    Summary:
    Make sure signed overflow in "x--" is checked with
    llvm.ssub.with.overflow intrinsic and is reported as:
      "-2147483648 - 1 cannot be represented in type 'int'"
    instead of:
      "-2147483648 + -1 cannot be represented in type 'int'"
    , like we do for unsigned overflow.
    
    Test Plan: clang + compiler-rt regression test suite
    
    Reviewers: rsmith
    
    Subscribers: cfe-commits
    
    Differential Revision: http://reviews.llvm.org/D8236
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235568 91177308-0d34-0410-b5e6-96231b3b80d8
  10. @bogner

    InstrProf: Fix a shadowing error that would break length of profile n…

    bogner authored
    …ames
    
    We try to use the member variable "FuncName" here, but we've also used
    that name as a parameter. This ends with us getting the length of the
    function name wrong when we generate the coverage data.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235565 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Apr 22, 2015
  1. [WinEH] Don't emit an exceptional cleanup for llvm.eh.endcatch

    Reid Kleckner authored
    These extra endcatch markers aren't helping identify regions to outline,
    so let's get rid of them.  LLVM outlines (more or less) from begincatch
    to endcatch.  Any unwind edge from an enclosed invoke is a transition to
    a new exception handler, which has it's own outlining markers.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235562 91177308-0d34-0410-b5e6-96231b3b80d8
  2. Fix another test broken by r235537

    Reid Kleckner authored
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235555 91177308-0d34-0410-b5e6-96231b3b80d8
  3. @majnemer

    Revert "Revert r234581, it might have caused a few miscompiles in Chr…

    majnemer authored
    …omium."
    
    This reverts commit r234700.  It turns out that the lifetime markers
    were not the cause of Chromium failing but a bug which was uncovered by
    optimizations exposed by the markers.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235553 91177308-0d34-0410-b5e6-96231b3b80d8
  4. Fix test failure caused by r235537. It does not run on Windows due to…

    Reid Kleckner authored
    … REQUIRES: shell
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235551 91177308-0d34-0410-b5e6-96231b3b80d8
  5. Set normal LLVM function attributes on global initializer functions

    Reid Kleckner authored
    Otherwise -fno-omit-frame-pointer and other flags like it aren't
    applied.
    
    Basic idea taken from Gao's patch, thanks!
    
    Differential Revision: http://reviews.llvm.org/D9203
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235537 91177308-0d34-0410-b5e6-96231b3b80d8
  6. @alexey-bataev

    [OPENMP] Codegen for 'if' clause in 'task' directive.

    alexey-bataev authored
    If condition evaluates to true, the code executes task by calling @__kmpc_omp_task() runtime function.
    If condition evaluates to false, the code executes serial version of the code by executing the following code:
    
    call void @__kmpc_omp_task_begin_if0(<loc>, <threadid>, <task_t_ptr, returned by @__kmpc_omp_task_alloc()>);
    proxy_task_entry(<gtid>, <task_t_ptr, returned by @__kmpc_omp_task_alloc()>);
    call void @__kmpc_omp_task_complete_if0(<loc>, <threadid>, <task_t_ptr, returned by @__kmpc_omp_task_alloc()>);
    Also it checks if the condition is constant and if it is constant it evaluates its value and then generates either parallel version of the code (if the condition evaluates to true), or the serial version of the code (if the condition evaluates to false).
    Differential Revision: http://reviews.llvm.org/D9143
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235507 91177308-0d34-0410-b5e6-96231b3b80d8
  7. @alexey-bataev

    [OPENMP] Codegen for 'reduction' clause in 'for' directive.

    alexey-bataev authored
    Emit a code for reduction clause. Next code should be emitted for reductions:
    
    static kmp_critical_name lock = { 0 };
    
    void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
        *(Type0*)lhs[0] = ReductionOperation0(*(Type0*)lhs[0], *(Type0*)rhs[0]);
          ...
            *(Type<n>-1*)lhs[<n>-1] =
              ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
                *(Type<n>-1*)rhs[<n>-1]);
    }
    
     ...
      void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n>-1]};
       switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
          case 1:
            <LHSExprs>[0] = ReductionOperation0(*<LHSExprs>[0], *<RHSExprs>[0]);
              ...
                <LHSExprs>[<n>-1] = ReductionOperation<n>-1(*<LHSExprs>[<n>-1], *<RHSExprs>[<n>-1]);
                 __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
                  break;
                   case 2:
                     Atomic(<LHSExprs>[0] = ReductionOperation0(*<LHSExprs>[0], *<RHSExprs>[0]));
                       ...
                         Atomic(<LHSExprs>[<n>-1] = ReductionOperation<n>-1(*<LHSExprs>[<n>-1], *<RHSExprs>[<n>-1]));
                          break;
                           default:;
                            }
                            Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.
    Differential Revision: http://reviews.llvm.org/D9139
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235506 91177308-0d34-0410-b5e6-96231b3b80d8
  8. @alexey-bataev

    [OPENMP] Codegen for 'private' clause in 'for' directive.

    alexey-bataev authored
    This patch generates helper variables which used as a private copies of the corresponding original variables inside an OpenMP 'for' directive. These generated variables are initialized by default (with the default constructor, if any). In OpenMP region references to original variables are replaced by the references to these private helper variables.
    Differential Revision: http://reviews.llvm.org/D9106
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235503 91177308-0d34-0410-b5e6-96231b3b80d8
  9. @alexey-bataev
Something went wrong with that request. Please try again.