1. Dec 13, 2018
    • Simon Pilgrim's avatar
      Fix Wdocumentation warning. NFCI. · 2ef6c46b
      Simon Pilgrim authored
      llvm-svn: 348958
      2ef6c46b
    • Florian Hahn's avatar
      [ConstantFold] Use getMinSignedBits for APInt in isIndexInRangeOfArrayType. · 81a22d32
      Florian Hahn authored
      Indices for getelementptr can be signed so we should use
      getMinSignedBits instead of getActiveBits here. The function later calls
      getSExtValue to get the int64_t value, which also checks
      getMinSignedBits.
      
      This fixes  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11647.
      
      Reviewers: mssimpso, efriedma, davide
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D55536
      
      llvm-svn: 348957
      81a22d32
    • Simon Pilgrim's avatar
      [X86] Added missing constant pool checks. NFCI. · 5864ab2d
      Simon Pilgrim authored
      So the extra checks in D55600 don't look like a regression.
      
      llvm-svn: 348956
      5864ab2d
    • David Blaikie's avatar
      Update for an llvm-dwarfdump change in output · 84addb90
      David Blaikie authored
      llvm-svn: 348955
      84addb90
    • David Blaikie's avatar
      llvm-dwarfdump: Dump array dimensions in stringified type names · 73066d60
      David Blaikie authored
      llvm-svn: 348954
      73066d60
    • Simon Pilgrim's avatar
      [SelectionDAG] Add a generic isSplatValue function · eb508f8c
      Simon Pilgrim authored
      This patch introduces a generic function to determine whether a given vector type is known to be a splat value for the specified demanded elements, recursing up the DAG looking for BUILD_VECTOR or VECTOR_SHUFFLE splat patterns.
      
      It also keeps track of the elements that are known to be UNDEF - it returns true if all the demanded elements are UNDEF (as this may be useful under some circumstances), so this needs to be handled by the caller.
      
      A wrapper variant is also provided that doesn't take the DemandedElts or UndefElts arguments for cases where we just want to know if the SDValue is a splat or not (with/without UNDEFS).
      
      I had hoped to completely remove the X86 local version of this function, but I'm seeing some regressions in shift/rotate codegen that will take a little longer to fix and I hope to get this in sooner so I can continue work on PR38243 which needs more capable splat detection.
      
      Differential Revision: https://reviews.llvm.org/D55426
      
      llvm-svn: 348953
      eb508f8c
    • Artem Belevich's avatar
      [NVPTX] do not rely on cached subtarget info. · f802b932
      Artem Belevich authored
      If a module has function references, but no functions
      themselves, we may end up never calling runOnMachineFunction
      and therefore would never initialize nvptxSubtarget field
      which would eventually cause a crash.
      
      Instead of relying on nvptxSubtarget being initialized by
      one of the methods, retrieve subtarget info directly.
      
      Differential Revision: https://reviews.llvm.org/D55580
      
      llvm-svn: 348952
      f802b932
    • Greg Clayton's avatar
    • Erich Keane's avatar
      Change CallGraph print to show the fully qualified name · 8e46c4b8
      Erich Keane authored
      CallGraph previously would just show the normal name of a function,
      which gets really confusing when using it on large C++ projects.  This
      patch switches the printName call to a printQualifiedName, so that the
      namespaces are included.
      
      Change-Id: Ie086d863f6b2251be92109ea1b0946825b28b49a
      llvm-svn: 348950
      8e46c4b8
    • Michael Kruse's avatar
      [LV] Fix signed/unsigned comparison warning. · a3e74a1b
      Michael Kruse authored
      llvm-svn: 348949
      a3e74a1b
    • Nico Weber's avatar
      [gn build] Merge r348944 · ff019225
      Nico Weber authored
      llvm-svn: 348948
      ff019225
    • Michael Kruse's avatar
      [docs] Use correct ending quotes. · 82dd71ef
      Michael Kruse authored
      llvm-svn: 348947
      82dd71ef
    • Sanjay Patel's avatar
      [x86] allow 8-bit adds to be promoted by convertToThreeAddress() to form LEA · 44eaa492
      Sanjay Patel authored
      This extends the code that handles 16-bit add promotion to form LEA to also allow 8-bit adds. 
      That allows us to combine add ops with register moves and save some instructions. This is 
      another step towards allowing add truncation in generic DAGCombiner (see D54640).
      
      Differential Revision: https://reviews.llvm.org/D55494
      
      llvm-svn: 348946
      44eaa492
    • Nico Weber's avatar
      [gn build] Add all non-test build files for lld · 7a1ba21f
      Nico Weber authored
      Version.inc.in processing has a potentially interesting part which I've punted
      on for now (LLD_REVISION and LLD_REPOSITORY are set to empty strings for now).
      
      lld now builds in the gn build. But no symlinks to it are created yet, so it
      can't be meaningfully run yet.
      
      Differential Revision: https://reviews.llvm.org/D55593
      
      llvm-svn: 348945
      7a1ba21f
    • Michael Kruse's avatar
      [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. · 72448525
      Michael Kruse authored
      When multiple loop transformation are defined in a loop's metadata, their order of execution is defined by the order of their respective passes in the pass pipeline. For instance, e.g.
      
          #pragma clang loop unroll_and_jam(enable)
          #pragma clang loop distribute(enable)
      
      is the same as
      
          #pragma clang loop distribute(enable)
          #pragma clang loop unroll_and_jam(enable)
      
      and will try to loop-distribute before Unroll-And-Jam because the LoopDistribute pass is scheduled after UnrollAndJam pass. UnrollAndJamPass only supports one inner loop, i.e. it will necessarily fail after loop distribution. It is not possible to specify another execution order. Also,t the order of passes in the pipeline is subject to change between versions of LLVM, optimization options and which pass manager is used.
      
      This patch adds 'followup' attributes to various loop transformation passes. These attributes define which attributes the resulting loop of a transformation should have. For instance,
      
          !0 = !{!0, !1, !2}
          !1 = !{!"llvm.loop.unroll_and_jam.enable"}
          !2 = !{!"llvm.loop.unroll_and_jam.followup_inner", !3}
          !3 = !{!"llvm.loop.distribute.enable"}
      
      defines a loop ID (!0) to be unrolled-and-jammed (!1) and then the attribute !3 to be added to the jammed inner loop, which contains the instruction to distribute the inner loop.
      
      Currently, in both pass managers, pass execution is in a fixed order and UnrollAndJamPass will not execute again after LoopDistribute. We hope to fix this in the future by allowing pass managers to run passes until a fixpoint is reached, use Polly to perform these transformations, or add a loop transformation pass which takes the order issue into account.
      
      For mandatory/forced transformations (e.g. by having been declared by #pragma omp simd), the user must be notified when a transformation could not be performed. It is not possible that the responsible pass emits such a warning because the transformation might be 'hidden' in a followup attribute when it is executed, or it is not present in the pipeline at all. For this reason, this patche introduces a WarnMissedTransformations pass, to warn about orphaned transformations.
      
      Since this changes the user-visible diagnostic message when a transformation is applied, two test cases in the clang repository need to be updated.
      
      To ensure that no other transformation is executed before the intended one, the attribute `llvm.loop.disable_nonforced` can be added which should disable transformation heuristics before the intended transformation is applied. E.g. it would be surprising if a loop is distributed before a #pragma unroll_and_jam is applied.
      
      With more supported code transformations (loop fusion, interchange, stripmining, offloading, etc.), transformations can be used as building blocks for more complex transformations (e.g. stripmining+stripmining+interchange -> tiling).
      
      Reviewed By: hfinkel, dmgreen
      
      Differential Revision: https://reviews.llvm.org/D49281
      Differential Revision: https://reviews.llvm.org/D55288
      
      llvm-svn: 348944
      72448525
    • Steven Wu's avatar
      [Driver] Add support for -fembed-bitcode for assembly file · 098742fa
      Steven Wu authored
      Summary:
      Handle -fembed-bitcode for assembly inputs. When the input file is
      assembly, write a marker as "__LLVM,__asm" section.
      
      Fix llvm.org/pr39659
      
      Reviewers: compnerd, dexonsmith
      
      Reviewed By: compnerd
      
      Subscribers: rjmccall, dblaikie, jkorous, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D55525
      
      llvm-svn: 348943
      098742fa
    • Erich Keane's avatar
      Make clang::CallGraph look into template instantiations · f313ed5b
      Erich Keane authored
      Clang's CallGraph analysis doesn't use the RecursiveASTVisitor's setting
      togo into template instantiations.  The result is that anything wanting
      to do call graph analysis ends up missing any template function calls.
      
      Change-Id: Ib4af44ed59f15d43f37af91622a203146a3c3189
      llvm-svn: 348942
      f313ed5b
    • Zachary Turner's avatar
      [ast] CreateParameterDeclaration should use an appropriate DeclContext. · 6753d2d1
      Zachary Turner authored
      Previously CreateParameterDeclaration was always using the translation
      unit DeclContext.  We would later go and add parameters to the
      FunctionDecl, but internally clang makes a copy when you do this, and
      we'd end up with ParmVarDecl's at the global scope as well as in the
      function scope.
      
      This fixes the issue.  It's hard to say whether this will introduce
      a behavioral change in name lookup, but I know there have been several
      hacks introduced in previous years to deal with collisions between
      various types of variables, so there's a chance that this patch could
      obviate one of those hacks.
      
      Differential Revision: https://reviews.llvm.org/D55571
      
      llvm-svn: 348941
      6753d2d1
    • Wei Mi's avatar
      [SampleFDO] Extend profile-sample-accurate option to cover isFunctionColdInCallGraph · 7da5a08e
      Wei Mi authored
      For SampleFDO, when a callsite doesn't appear in the profile, it will not be marked as cold callsite unless the option -profile-sample-accurate is specified.
      
      But profile-sample-accurate doesn't cover function isFunctionColdInCallGraph which is used to decide whether a function should be put into text.unlikely section, so even if the user knows the profile is accurate and specifies profile-sample-accurate, those functions not appearing in the sample profile are still not be put into text.unlikely section right now.
      
      The patch fixes that.
      
      Differential Revision: https://reviews.llvm.org/D55567
      
      llvm-svn: 348940
      7da5a08e
    • Saleem Abdulrasool's avatar
      Basic: make `int_least64_t` and `int_fast64_t` match on Darwin · d4f7d6a7
      Saleem Abdulrasool authored
      The Darwin targets use `int64_t` and `uint64_t` to define the `int_least64_t`
      and `int_fast64_t` types.  The underlying type is actually a `long long`.  Match
      the types to allow the printf specifiers to work properly and have the compiler
      vended macros match the implementation on the target.
      
      llvm-svn: 348939
      d4f7d6a7
    • Hubert Tong's avatar
      [ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types · 147b7436
      Hubert Tong authored
      Summary:
      `memchr` and `memcmp` operate upon the character units of the object
      representation; that is, the `size_t` parameter expresses the number of
      character units. The constant folding implementation is updated in this
      patch to account for multibyte element types in the arrays passed to
      `memchr`/`memcmp` and, in the case of `memcmp`, to account for the
      possibility that the arrays may have differing element types (even when
      they are byte-sized).
      
      Actual inspection of the object representation is not implemented.
      Comparisons are done only between elements with the same object size;
      that is, `memchr` will fail when inspecting at least one character unit
      of a multibyte element. The integer types are assumed to have two's
      complement representation with 0 for `false`, 1 for `true`, and no
      padding bits.
      
      `memcmp` on multibyte elements will only be able to fold in cases where
      enough elements are equal for the answer to be 0.
      
      Various tests are added to guard against incorrect folding for cases
      that miscompile on some system or other prior to this patch. At the same
      time, the unsigned 32-bit `wchar_t` testing in
      `test/SemaCXX/constexpr-string.cpp` is restored.
      
      Reviewers: rsmith, aaron.ballman, hfinkel
      
      Reviewed By: rsmith
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D55510
      
      llvm-svn: 348938
      147b7436
    • Neil Henning's avatar
      [AMDGPU] Extend the SI Load/Store optimizer to combine more things. · 76504a4c
      Neil Henning authored
      I've extended the load/store optimizer to be able to produce dwordx3
      loads and stores, This change allows many more load/stores to be combined,
      and results in much more optimal code for our hardware.
      
      Differential Revision: https://reviews.llvm.org/D54042
      
      llvm-svn: 348937
      76504a4c
  2. Dec 12, 2018