Skip to content
  1. Apr 09, 2019
  2. Apr 08, 2019
    • Adrian Prantl's avatar
      Fix a stack buffer overflow found by ASAN. · 1a0c0ffa
      Adrian Prantl authored
      llvm::StringRef host_and_port is not guaranteed to be null-terminated.
      Generally, it is not safe at all to convert a StringRef into a char *
      by calling data() on it.
      
      <rdar://problem/49698580>
      
      llvm-svn: 357948
      1a0c0ffa
    • Lang Hames's avatar
      [RuntimeDyld] Decouple RuntimeDyldChecker from RuntimeDyld. · 941f247d
      Lang Hames authored
      This will allow RuntimeDyldChecker (and rtdyld-check tests) to test a new JIT
      linker: JITLink (https://reviews.llvm.org/D58704).
      
      llvm-svn: 357947
      941f247d
    • Louis Dionne's avatar
      [libc++] Remove install_name and compatibility_version on OS X · fecbf591
      Louis Dionne authored
      CMake already specifies those, and we never actually want those to be
      used. In fact, r357811 re-ordered those flags in a way that the
      explicitly-provided install_name was overriding the CMake-provided
      install_name (instead of the other way around). This caused the dylib
      to be considered a system dylib, and hence the explicitly provided rpath
      to be ignored. This, in turn, caused some unit tests to start linking
      against the system libc++.dylib instead of the freshly-built one.
      Specifically, the unit tests that started linking against the system
      dylib are those that didn't specify a DYLD_LIBRARY_PATH, such as
      last_write_time.sh.cpp.
      
      llvm-svn: 357946
      fecbf591
    • Shoaib Meenai's avatar
      [BinaryFormat] Update Mach-O ARM64E CPU subtype and dumping · 867131a9
      Shoaib Meenai authored
      The new value is taken from <mach/machine.h> in the MacOSX10.14 SDK from
      Xcode 10.1. Update llvm-objdump and llvm-readobj accordingly.
      
      Differential Revision: https://reviews.llvm.org/D58636
      
      llvm-svn: 357945
      867131a9
    • Eric Fiselier's avatar
      Make reads and writes of the guard variable atomic. · 62c2b5ac
      Eric Fiselier authored
      The read of the guard variable by the caller is atomic,
      and doesn't happen under a mutex.
      
      Our internal reads and writes were non-atomic, because they happened
      under a mutex.
      
      The writes should always be atomic since they can be observed outside
      of the lock.
      
      Making the reads atomic is not strictly necessary under the current
      global mutex approach, but will be under implementations that use a
      futex (which I plan to land shortly). However, they should add little
      additional cost.
      
      llvm-svn: 357944
      62c2b5ac
    • Sanjay Patel's avatar
      [InstCombine] peek through fdiv to find a squared sqrt · 773e04c8
      Sanjay Patel authored
      A more general canonicalization between fdiv and fmul would not
      handle this case because that would have to be limited by uses
      to prevent 2 values from becoming 3 values:
      (x/y) * (x/y) --> (x*x) / (y*y)
      
      (But we probably should still have that limited -- but more general --
      canonicalization independently of this change.)
      
      llvm-svn: 357943
      773e04c8
    • Simon Pilgrim's avatar
      [TargetLowering] SimplifyDemandedBits - use DemandedElts in bitcast handling · 9f74df7d
      Simon Pilgrim authored
      Be more selective in the SimplifyDemandedBits -> SimplifyDemandedVectorElts bitcast call based on the demanded elts.
      
      llvm-svn: 357942
      9f74df7d
    • Chandler Carruth's avatar
      Move the builtin headers to use the new license file header. · 4cf5743b
      Chandler Carruth authored
      Summary:
      These all had somewhat custom file headers with different text from the
      ones I searched for previously, and so I missed them. Thanks to Hal and
      Kristina and others who prompted me to fix this, and sorry it took so
      long.
      
      Reviewers: hfinkel
      
      Subscribers: mcrosier, javed.absar, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D60406
      
      llvm-svn: 357941
      4cf5743b
    • Shafik Yaghmour's avatar
      [ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using... · d4263123
      Shafik Yaghmour authored
      [ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using Name instead of SearchName
      
      Summary:
      https://reviews.llvm.org/D51633 added error handling to the ASTNodeImporter::VisitEnumDecl(...) for the conflicting names case. This could lead to erroneous return of an error in that case since we should have been using SearchName. Name may be empty in the case where we find the name via getTypedefNameForAnonDecl(...).
      
      Differential Revision: https://reviews.llvm.org/D59665
      
      llvm-svn: 357940
      d4263123
    • Sanjay Patel's avatar
      [InstCombine] add extra-use tests for fmul+sqrt; NFC · bf1417d7
      Sanjay Patel authored
      llvm-svn: 357939
      bf1417d7
    • Nikita Popov's avatar
      [InstCombine] Add more tests for signed saturing math overflow; NFC · 15abd74d
      Nikita Popov authored
      Overflow conditions for sadd.sat and ssub.sat which can be determined
      based on constant ranges, but not necessarily known bits.
      
      llvm-svn: 357938
      15abd74d
    • David Goldman's avatar
      Clean up ObjCPropertyDecl printing · fa8185c5
      David Goldman authored
      Summary:
      - `@property(attr, attr2)` instead of `@property ( attr,attr2 )`.
      - Change priority of attributes (see code/comments inline).
      - Support for printing weak and unsafe_unretained attributes.
      
      Subscribers: arphaman, jfb, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57965
      
      llvm-svn: 357937
      fa8185c5
    • Nico Weber's avatar
      llvm-undname: Fix more crashes and asserts on invalid inputs · 63b97d2a
      Nico Weber authored
      For functions whose callers don't check that enough input is present,
      add checks at the start of the function that enough input is there and
      set Error otherwise.
      
      For functions that return AST objects, return nullptr instead of
      incomplete AST objects with nullptr fields if an error occurred during
      the function.
      
      Introduce a new function demangleDeclarator() for the sequence
      demangleFullyQualifiedSymbolName(); demangleEncodedSymbol() and
      use it in the two places that had this sequence. Let this new function
      check that ConversionOperatorIdentifiers have a valid TargetType.
      
      Some of the bad inputs found by oss-fuzz, others by inspection.
      
      Differential Revision: https://reviews.llvm.org/D60354
      
      llvm-svn: 357936
      63b97d2a
    • Craig Topper's avatar
      [X86] Fix a couple lowering functions that called ReplaceAllUsesOfValueWith... · 3a4c2192
      Craig Topper authored
      [X86] Fix a couple lowering functions that called ReplaceAllUsesOfValueWith for the newly created code and then return SDValue(). Use MERGE_VALUES instead.
      
      Returning SDValue() makes the caller think custom lowering was unsuccessful and then it will fall back to trying to expand the original node. This expanded code will end up with no users and end up being pruned later. But it was useless unnecessary work to create it.
      
      Instead return a MERGE_VALUES with all the results so the caller knows something changed. The caller can handle the replacements.
      
      For one of the cases I had to use UNDEF has a dummy value for a result we know is unused. This should get pruned later.
      
      llvm-svn: 357935
      3a4c2192
    • Adrian Prantl's avatar
      Add LLVM IR debug info support for Fortran COMMON blocks · 6ed5706a
      Adrian Prantl authored
          COMMON blocks are a feature of Fortran that has no direct analog in C languages, but they are similar to data sections in assembly language programming. A COMMON block is a named area of memory that holds a collection of variables. Fortran subprograms may map the COMMON block memory area to their own, possibly distinct, non-empty list of variables. A Fortran COMMON block might look like the following example.
      
          COMMON /ALPHA/ I, J
      
          For this construct, the compiler generates a new scope-like DI construct (!DICommonBlock) into which variables (see I, J above) can be placed. As the common block implies a range of storage with global lifetime, the !DICommonBlock refers to a !DIGlobalVariable. The Fortran variable that comprise the COMMON block are also linked via metadata to offsets within the global variable that stands for the entire common block.
      
          @alpha_ = common global %alphabytes_ zeroinitializer, align 64, !dbg !27, !dbg !30, !dbg !33
          !14 = distinct !DISubprogram(…)
          !20 = distinct !DICommonBlock(scope: !14, declaration: !25, name: "alpha")
          !25 = distinct !DIGlobalVariable(scope: !20, name: "common alpha", type: !24)
          !27 = !DIGlobalVariableExpression(var: !25, expr: !DIExpression())
          !29 = distinct !DIGlobalVariable(scope: !20, name: "i", file: !3, type: !28)
          !30 = !DIGlobalVariableExpression(var: !29, expr: !DIExpression())
          !31 = distinct !DIGlobalVariable(scope: !20, name: "j", file: !3, type: !28)
          !32 = !DIExpression(DW_OP_plus_uconst, 4)
          !33 = !DIGlobalVariableExpression(var: !31, expr: !32)
      
          The DWARF generated for this is as follows.
      
          DW_TAG_common_block:
          DW_AT_name: alpha
          DW_AT_location: @alpha_+0
          DW_TAG_variable:
          DW_AT_name: common alpha
          DW_AT_type: array of 8 bytes
          DW_AT_location: @alpha_+0
          DW_TAG_variable:
          DW_AT_name: i
          DW_AT_type: integer*4
          DW_AT_location: @Alpha+0
          DW_TAG_variable:
          DW_AT_name: j
          DW_AT_type: integer*4
          DW_AT_location: @Alpha+4
      
      Patch by Eric Schweitz!
      
      Differential Revision: https://reviews.llvm.org/D54327
      
      llvm-svn: 357934
      6ed5706a
    • Alexey Bataev's avatar
      [OPENMP] Sync __kmpc_alloc/_kmpc_free function with the runtime. · 6cf7b715
      Alexey Bataev authored
      Functions __kmpc_alloc/__kmpc_free are updated with the new interfaces.
      Patch synchronizes the compiler with the runtime.
      
      llvm-svn: 357933
      6cf7b715
    • Steven Wu's avatar
      Revert [ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbols · f41e70d6
      Steven Wu authored
      This reverts r357931 (git commit 8b70a5c1)
      
      llvm-svn: 357932
      f41e70d6
    • Steven Wu's avatar
      [ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbols · 8b70a5c1
      Steven Wu authored
      Summary:
      ThinLTOCodeGenerator currently does not preserve llvm.used symbols and
      it can internalize them. In order to pass the necessary information to the
      legacy ThinLTOCodeGenerator, the input to the code generator is
      rewritten to be based on lto::InputFile.
      
      This fixes: PR41236
      rdar://problem/49293439
      
      Reviewers: tejohnson, pcc, dexonsmith
      
      Reviewed By: tejohnson
      
      Subscribers: mehdi_amini, inglorion, eraman, hiraditya, jkorous, dang, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60226
      
      llvm-svn: 357931
      8b70a5c1
    • Brian M. Rzycki's avatar
      [JumpThreading] Fix incorrect fold conditional after indirectbr/callbr · 887865c1
      Brian M. Rzycki authored
      Fixes bug 40992: https://bugs.llvm.org/show_bug.cgi?id=40992
      
      There is potential for miscompiled code emitted from JumpThreading when
      analyzing a block with one or more indirectbr or callbr predecessors. The
      ProcessThreadableEdges() function incorrectly folds conditional branches
      into an unconditional branch.
      
      This patch prevents incorrect branch folding without fully pessimizing
      other potential threading opportunities through the same basic block.
      
      This IR shape was manually fed in via opt and is unclear if clang and the
      full pass pipeline will ever emit similar code shapes.
      
      Thanks to Matthias Liedtke for the bug report and simplified IR example.
      
      Differential Revision: https://reviews.llvm.org/D60284
      
      llvm-svn: 357930
      887865c1
    • Jonathan Peyton's avatar
      [OpenMP] Implement 5.0 memory management · ebf1830b
      Jonathan Peyton authored
      * Replace HBWMALLOC API with more general MEMKIND API, new functions
        and variables added.
      * Have libmemkind.so loaded when accessible.
      * Redirect memspaces to default one except for high bandwidth which
        is processed separately.
      * Ignore some allocator traits e.g., sync_hint, access, pinned, while
        others are processed normally e.g., alignment, pool_size, fallback,
        fb_data, partition.
      * Add tests for memory management
      
      Patch by Andrey Churbanov
      
      Differential Revision: https://reviews.llvm.org/D59783
      
      llvm-svn: 357929
      ebf1830b
    • Amy Huang's avatar
      [MS] Add metadata for __declspec(allocator) · e7bd735b
      Amy Huang authored
      Summary:
      Emit !heapallocsite in the metadata for calls to functions marked with
      __declspec(allocator). Eventually this will be emitted as S_HEAPALLOCSITE debug
      info in codeview.
      
      Reviewers: rnk
      
      Subscribers: jfb, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D60237
      
      llvm-svn: 357928
      e7bd735b
    • Jonathan Peyton's avatar
      [OpenMP] Clean up load balancing dynamic mode · feac33eb
      Jonathan Peyton authored
      This patch cleans up the bookkeeping code for the load balancing dynamic mode.
      
      When a thread is moved to or from the thread pool, the th_active_in_pool flag
      and the __kmp_thread_pool_active_nth global counter are both updated. This
      removes the need for the corrective code in the main wait loop. Another global
      counter, __kmp_thread_pool_nth, was removed completely, as it was only used for
      debugging, but was not under KMP_DEBUG.
      
      Patch by Terry Wilmarth
      
      Differential Revision: https://reviews.llvm.org/D59508
      
      llvm-svn: 357927
      feac33eb
    • Peter Collingbourne's avatar
      ELF: Move verneed tracking data structures out of VersionNeedSection. · d3e20705
      Peter Collingbourne authored
      For partitions I intend to use the same set of version indexes in
      each partition for simplicity. Since each partition will need its own
      VersionNeedSection this will require moving the verneed tracking out of
      VersionNeedSection. The way I've done this is to move most of the tracking
      into SharedFile. What will eventually become the per-partition tracking
      still lives in VersionNeedSection.
      
      As a bonus the code gets a little simpler and more consistent with how we
      handle verdef.
      
      Differential Revision: https://reviews.llvm.org/D60307
      
      llvm-svn: 357926
      d3e20705
    • Peter Collingbourne's avatar
      ELF: De-template SharedFile. NFCI. · cc1618e6
      Peter Collingbourne authored
      Differential Revision: https://reviews.llvm.org/D60305
      
      llvm-svn: 357925
      cc1618e6
    • Craig Topper's avatar
      [X86] Add some fp to integer conversion intrinsics to... · 1b62c758
      Craig Topper authored
      [X86] Add some fp to integer conversion intrinsics to Sema::CheckX86BuiltinRoundingOrSAE so their rounding controls will be checked.
      
      If we don't check this in the frontend we'll get an isel error in the backend later. This is far less friendly to users.
      
      llvm-svn: 357924
      1b62c758
    • Alexey Bataev's avatar
      [OPENMP][NVPTX]Fixed processing of memory management directives. · 1db9bfeb
      Alexey Bataev authored
      Added special processing of the memory management directives/clauses for
      NVPTX target. For private locals, omp_default_mem_alloc and
      omp_thread_mem_alloc result in allocation in local memory.
      omp_const_mem_alloc allocates const memory, omp_teams_mem_alloc
      allocates shared memory, and omp_cgroup_mem_alloc and
      omp_large_cap_mem_alloc allocate global memory.
      
      llvm-svn: 357923
      1db9bfeb
    • Alexander Kornienko's avatar
      Remove a bogus sed option in test. · 10d6008f
      Alexander Kornienko authored
      llvm-svn: 357922
      10d6008f
Loading