1. Jul 26, 2017
  2. Jul 25, 2017
    • Alexey Bataev's avatar
      [OPENMP] Codegen for 'task_reduction' clause. · 3b1b8951
      Alexey Bataev authored
      Added codegen for taskgroup directive with task_reduction clause.
      ```
      <body>
      ```
      The next code is emitted:
      ```
      %struct.kmp_task_red_input_t red_init[n];
      void *td;
      call void @__kmpc_taskgroup(%ident_t id, i32 gtid)
      ...
      red_init[i].shar = &<item>;
      red_init[i].size = sizeof(<item>);
      red_init[i].init = (void*)initializer_function;
      red_init[i].fini = (void*)destructor_function;
      red_init[i].comb = (void*)combiner_function;
      red_init[i].flags = flags;
      ...
      td = call i8* @__kmpc_task_reduction_init(i32 gtid, i32 n, i8*
      (void*)red_init);
      call void @__kmpc_end_taskgroup(%ident_t id, i32 gtid)
      
      void initializer_function(i8* priv) {
        *(<type>*)priv = <red_init>;
        ret void;
      }
      
      void destructor_function(i8* priv) {
        (<type>*)priv->~();
        ret void;
      }
      
      void combiner_function(i8* inout, i8* in) {
        *(<type>*)inout = *(<type>*)inout <red_id> *(<type>*)in;
        ret void;
      }
      ```
      
      llvm-svn: 308979
      3b1b8951
    • Fedor Sergeev's avatar
      [Sparc] invalid adjustments in TLS_LE/TLS_LDO relocations removed · 7856a320
      Fedor Sergeev authored
      Summary:
      Some SPARC TLS relocations were applying nontrivial adjustments
      to zero value, leading to unexpected non-zero values in ELF and then
      Solaris linker failures.
      
      Getting rid of these adjustments.
      
      Fixes PR33825.
      
      Reviewers: rafael, asb, jyknight
      
      Subscribers: joerg, jyknight, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D35567
      
      llvm-svn: 308978
      7856a320
    • Francis Ricci's avatar
      Add address ranges for individual macho sections on darwin · ec4ac0f0
      Francis Ricci authored
      Summary:
      This is a re-upload of the reverted commit r308644. It has changed quite
      a bit to reflect post-commit comments by kcc, so I'm re-uploading as
      a new review.
      
      Reviewers: kubamracek, alekseyshl, kcc
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D35799
      
      llvm-svn: 308977
      ec4ac0f0
    • Philip Pfaffe's avatar
      [IslAst] Untangle IslAst lit-testcases from specifics of the legacy-PM · 85cc5687
      Philip Pfaffe authored
      Summary:
      This consists instances of two changes:
      
      - Accept any order of checks for a specific loop form, that appear in different order in the new vs legacy-PM.
      - Remove checks for specific regions.
      
      Reviewers: grosser
      
      Reviewed By: grosser
      
      Subscribers: pollydev, llvm-commits
      
      Tags: #polly
      
      Differential Revision: https://reviews.llvm.org/D35837
      
      llvm-svn: 308976
      85cc5687
    • Kevin Funk's avatar
      [clang-tidy] Fixup clang-apply-replacements/invalid-files test · fe284e46
      Kevin Funk authored
      llvm-svn: 308975
      fe284e46
    • Kevin Funk's avatar
      [clang-tidy] clang-apply-replacements: Don't insert null entry · bb5cfb5d
      Kevin Funk authored
      Summary:
      [clang-tidy] clang-apply-replacements: Don't insert null entry
      
      Fix crash when running clang-apply-replacements on YML files which
      contain an invalid file path. Make sure we never add a nullptr into the
      map. The previous code started adding nullptr to the map after the first
      warnings via errs() has been emitted.
      
      Backtrace:
      ```
      Starting program:
      /home/kfunk/devel/build/llvm/bin/clang-apply-replacements /tmp/tmpIqtp7m
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library
      "/lib/x86_64-linux-gnu/libthread_db.so.1".
      Described file '.moc/../../../../../../src/qt5.8/qtremoteobjects/src/remoteobjects/qremoteobjectregistrysource_p.h' doesn't exist. Ignoring...
      ...
      
      Program received signal SIGSEGV, Segmentation fault.
      main (argc=<optimized out>, argv=<optimized out>) at /home/kfunk/devel/src/llvm/tools/clang/tools/extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp:262
      (gdb) p FileAndReplacements.first
      $1 = (const clang::FileEntry *) 0x0
      (gdb)
      ```
      
      Added tests.
      
      Before patch:
      
      ```
      ******************** TEST 'Clang Tools :: clang-apply-replacements/invalid-files.cpp' FAILED ********************
      Script:
      --
      mkdir -p /home/kfunk/devel/build/llvm/tools/clang/tools/extra/test/clang-apply-replacements/Output/Inputs/invalid-files
      clang-apply-replacements /home/kfunk/devel/build/llvm/tools/clang/tools/extra/test/clang-apply-replacements/Output/Inputs/invalid-files
      ls -1 /home/kfunk/devel/build/llvm/tools/clang/tools/extra/test/clang-apply-replacements/Output/Inputs/invalid-files | FileCheck /home/kfunk/devel/src/llvm/tools/clang/tools/extra/test/clang-apply-replacements/invalid-files.cpp --check-prefix=YAML
      --
      Exit Code: 139
      
      Command Output (stderr):
      --
      Described file 'idonotexist.h' doesn't exist. Ignoring...
      /home/kfunk/devel/build/llvm/tools/clang/tools/extra/test/clang-apply-replacements/Output/invalid-files.cpp.script: line 4:  9919 Segmentation fault      clang-apply-replacements /home/kfunk/devel/build/llvm/tools/clang/tools/extra/test/clang-apply-   replacements/Output/Inputs/invalid-files
      
      --
      ```
      
      After Patch:
      
      ```
      PASS: Clang Tools :: clang-apply-replacements/invalid-files.cpp (5 of 6)
      ```
      
      Reviewers: alexfh, yawanng
      
      Reviewed By: alexfh
      
      Subscribers: cfe-commits, klimek, JDevlieghere, xazax.hun
      
      Tags: #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D35194
      
      llvm-svn: 308974
      bb5cfb5d
    • Michael Kruse's avatar
      [ScopInfo] Fix assertion for PHIs not in a region stmts entry. · b6317007
      Michael Kruse authored
      A PHI node within a region statement is legal, but does not have
      a MemoryKind::PHI access.
      
      llvm-svn: 308973
      b6317007
    • Andrew V. Tischenko's avatar
      32e9b1ad
    • Siddharth Bhat's avatar
      [PPCGCodeGeneration] Skip arrays with empty extent. · 43f178bb
      Siddharth Bhat authored
      Invariant load hoisted scalars, and arrays whose size we can statically compute
      to be 0 do not need to be allocated as arrays.
      
      Invariant load hoisted scalars are sent to the kernel directly as parameters.
      
      Earlier, we used to allocate `0` bytes of memory for these because our
      computation of size from `PPCGCodeGeneration::getArraySize` would result in `0`.
      
      Now, since we don't invariant loads as arrays in PPCGCodeGeneration, this
      problem does not occur anymore.
      
      Differential Revision: https://reviews.llvm.org/D35795
      
      llvm-svn: 308971
      43f178bb
    • Krasimir Georgiev's avatar
      [clangd] Reuse compile commands during reparse · e4130d52
      Krasimir Georgiev authored
      Summary:
      Previously we always queried the compilation database and discarded the results
      if the file was already opened.
      
      Reviewers: ilya-biryukov
      
      Reviewed By: ilya-biryukov
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D35825
      
      llvm-svn: 308970
      e4130d52
    • Manuel Klimek's avatar
      Fix spelling of FileCheck in test. · 8f2b2f51
      Manuel Klimek authored
      llvm-svn: 308969
      8f2b2f51
    • Chandler Carruth's avatar
      [LIR] Teach LIR to avoid extending the BE count prior to adding one to · 1dc34c6d
      Chandler Carruth authored
      it when safe.
      
      Very often the BE count is the trip count minus one, and the plus one
      here should fold with that minus one. But because the BE count might in
      theory be UINT_MAX or some such, adding one before we extend could in
      some cases wrap to zero and break when we scale things.
      
      This patch checks to see if it would be safe to add one because the
      specific case that would cause this is guarded for prior to entering the
      preheader. This should handle essentially all of the common loop idioms
      coming out of C/C++ code once canonicalized by LLVM.
      
      Before this patch, both forms of loop in the added test cases ended up
      subtracting one from the size, extending it, scaling it up by 8 and then
      adding 8 back onto it. This is really silly, and it turns out made it
      all the way into generated code very often, so this is a surprisingly
      important cleanup to do.
      
      Many thanks to Sanjoy for showing me how to do this with SCEV.
      
      Differential Revision: https://reviews.llvm.org/D35758
      
      llvm-svn: 308968
      1dc34c6d
    • Chandler Carruth's avatar
      [PM] Setup TargetLibraryInfo correctly for the new pass manager. · 9fdd5fa5
      Chandler Carruth authored
      Without this, -fno-builtin and friends doesn't work. Added the obvious
      RUN lines to the test for -fno-builtin and they pass now.
      
      llvm-svn: 308967
      9fdd5fa5
    • Matan Haroush's avatar
      This patch enables the usage of constant Enum identifiers within Microsoft... · 2f21017b
      Matan Haroush authored
      This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements.
      
      Differential Revision:
      https://reviews.llvm.org/D33277
      https://reviews.llvm.org/D33278
      
      llvm-svn: 308966
      2f21017b
    • Matan Haroush's avatar
      This patch enables the usage of constant Enum identifiers within Microsoft... · b4b8d103
      Matan Haroush authored
      This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements.
      
      Differential Revision:
      https://reviews.llvm.org/D33277
      https://reviews.llvm.org/D33278
      
      llvm-svn: 308965
      b4b8d103
    • Michael Zolotukhin's avatar
      [tests] Cleanup vect.omp.persistence.ll test. · cd2255ea
      Michael Zolotukhin authored
      llvm-svn: 308964
      cd2255ea
    • Simon Pilgrim's avatar
      [X86] Add 24-byte memcmp tests (PR33914) · 3459f108
      Simon Pilgrim authored
      llvm-svn: 308963
      3459f108
    • Manuel Klimek's avatar
      Fix incorrect use of current directory to find moved paths in ASTReader. · 1b29b4f9
      Manuel Klimek authored
      CurrentDir was set as the path of the current module, but that can change as
      part of a chain of loaded modules.
      
      When we try to locate a file mentioned in a module that does not exist, we use
      a heuristic to look at the relative path between the original location of the
      module and the file we look for, and use that relatively to the CurrentDir.
      
      This only works if CurrentDir is the same as the (current) path of the module
      file the file was mentioned in; if it is not, we look at the path relatively to
      the wrong directory, and can end up reading random unrelated files that happen
      to have the same name.
      
      This patch fixes this by using the BaseDirectory of the module file the file
      we look for was mentioned in instead of the CurrentDir heuristic.
      
      Differential Revision: https://reviews.llvm.org/D35828
      
      llvm-svn: 308962
      1b29b4f9
    • Artem Dergachev's avatar
      [analyzer] Treat throws as sinks for suppress-on-sink purposes. · e235bd1d
      Artem Dergachev authored
      Because since r308957 the suppress-on-sink feature contains its own
      mini-analysis, it also needs to become aware that C++ unhandled exceptions
      cause sinks. Unfortunately, for now we treat all exceptions as unhandled in
      the analyzer, so suppress-on-sink needs to do the same.
      
      rdar://problem/28157554
      
      Differential Revision: https://reviews.llvm.org/D35674
      
      llvm-svn: 308961
      e235bd1d
    • Francois Pichet's avatar
      Fix endianness bug in DAGCombiner::visitTRUNCATE and visitEXTRACT_VECTOR_ELT · 82bf3de6
      Francois Pichet authored
      Summary:
      Do not assume little endian architecture in DAGCombiner::visitTRUNCATE and DAGCombiner::visitEXTRACT_VECTOR_ELT.
      PR33682
      
      Reviewers: hfinkel, sdardis, RKSimon
      
      Reviewed By: sdardis, RKSimon
      
      Subscribers: uabelho, RKSimon, sdardis, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D34990
      
      llvm-svn: 308960
      82bf3de6