1. Aug 10, 2023
    • Raghu Maddhipatla's avatar
      [OpenMP] [Flang] [Semantics] Add a missing semantic check for OMP DISTRIBUTE directive. · 9c2d54e9
      Raghu Maddhipatla authored
      Added semantic support for following restriction which applies to OMP DISTRIBUTE directives
      
        - A list item may appear in a firstprivate or lastprivate clause but not both.
      
      Reviewed By: kiranchandramohan
      
      Differential Revision: https://reviews.llvm.org/D157465
      9c2d54e9
    • Richard Dzenis's avatar
      Enable concatenation of predefined identifiers · 66c43fbd
      Richard Dzenis authored
      Predefined identifiers like __FUNCTION__ are treated like string
      literals in MSVC, which means they can be concatentated together with
      an adjacent string literal. Clang now supports this behavior as well,
      in Microsoft extensions mode.
      
      Fixes https://github.com/llvm/llvm-project/issues/63563
      Differential Revision: https://reviews.llvm.org/D153914
      66c43fbd
    • Jon Roelofs's avatar
      Revert "cmake: add missing dependencies on Attributes.inc" · d462f65b
      Jon Roelofs authored
      This reverts commit 30b4351c.
      
      This caused a dependency cycle that the Swift build picked up on:
      
      ```
      CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
        "llvm-tblgen" of type EXECUTABLE
          depends on "LLVMCodeGenTypes" (weak)
          depends on "LLVMTableGenGlobalISel" (weak)
          depends on "intrinsics_gen" (strong)
        "LLVMTableGenGlobalISel" of type STATIC_LIBRARY
          depends on "LLVMCodeGenTypes" (weak)
          depends on "vt_gen" (strong)
        "vt_gen" of type UTILITY
          depends on "llvm-tblgen" (strong)
        "autogen_intrinsics_RISCV" of type UTILITY
          depends on "llvm-tblgen" (strong)
        "intrinsics_gen" of type UTILITY
          depends on "llvm-tblgen" (strong)
          depends on "autogen_intrinsics_RISCV" (strong)
        "LLVMCodeGenTypes" of type STATIC_LIBRARY
          depends on "vt_gen" (strong)
      ```
      
      rdar://113636528
      d462f65b
    • Ben Langmuir's avatar
      [clang][modules] Add -Wsystem-headers-in-module= · dc5cbba3
      Ben Langmuir authored
      Add a way to enable -Wsystem-headers only for a specific module. This is
      useful for validating a module that would otherwise not see system
      header diagnostics without being flooded by diagnostics for unrelated
      headers/modules. It's relatively common for a module to be marked
      [system] but still wish to validate itself explicitly.
      
      rdar://113401565
      
      Differential Revision: https://reviews.llvm.org/D156948
      dc5cbba3
    • Mark de Wever's avatar
      [libc++][modules] Removes the module partitions. · 4d4c70c9
      Mark de Wever authored
      This patch is based on the suggestion by @ChuanqiXu on discourse
      (https://discourse.llvm.org/t/alternatives-to-the-implementation-of-std-modules/71958)
      
      Instead of making a module partition per header every header gets an inc
      file which contains the exports per header. The std module then includes
      all public headers and these inc files. The one file per header is
      useful for testing purposes. The CI tests whether the exports of a
      header's module partition matches the "public" named declarations in the
      header. With one file per header this can still be done.
      
      The patch improves compilation time of files using "import std;" and the
      size of the std module.
      
      A comparision of the compilation speed using a libc++ test
        build/bin/llvm-lit -a -Dstd=c++23 -Denable_modules=std libcxx/test/std/modules/std.pass.cpp
      
      Which boils down to
        import std;
      
        int main(int, char**) {
          std::println("Hello modular world");
          return 0;
        }
      and has -ftime-report enabled
      
      Before
      ===-------------------------------------------------------------------------===
                                Clang front-end time report
      ===-------------------------------------------------------------------------===
        Total Execution Time: 8.6585 seconds (8.6619 wall clock)
      
         ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
         4.5041 ( 57.2%)   0.4264 ( 54.4%)   4.9305 ( 56.9%)   4.9331 ( 57.0%)  Clang front-end timer
         3.2037 ( 40.7%)   0.2408 ( 30.7%)   3.4445 ( 39.8%)   3.4452 ( 39.8%)  Reading modules
         0.1665 (  2.1%)   0.1170 ( 14.9%)   0.2835 (  3.3%)   0.2837 (  3.3%)  Loading .../build/test/__config_module__/CMakeFiles/std.dir/std.pcm
         7.8744 (100.0%)   0.7842 (100.0%)   8.6585 (100.0%)   8.6619 (100.0%)  Total
      
      After
      ===-------------------------------------------------------------------------===
                                Clang front-end time report
      ===-------------------------------------------------------------------------===
        Total Execution Time: 1.2420 seconds (1.2423 wall clock)
      
         ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
         0.8892 ( 84.6%)   0.1698 ( 88.8%)   1.0590 ( 85.3%)   1.0590 ( 85.2%)  Clang front-end timer
         0.1533 ( 14.6%)   0.0168 (  8.8%)   0.1701 ( 13.7%)   0.1704 ( 13.7%)  Reading modules
         0.0082 (  0.8%)   0.0047 (  2.5%)   0.0129 (  1.0%)   0.0129 (  1.0%)  Loading .../build/test/__config_module__/CMakeFiles/std.dir/std.pcm
         1.0507 (100.0%)   0.1913 (100.0%)   1.2420 (100.0%)   1.2423 (100.0%)  Total
      
      Using "include <print>" instead of "import module;"
      ===-------------------------------------------------------------------------===
                                Clang front-end time report
      ===-------------------------------------------------------------------------===
        Total Execution Time: 2.1507 seconds (2.1517 wall clock)
      
         ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
         1.9714 (100.0%)   0.1793 (100.0%)   2.1507 (100.0%)   2.1517 (100.0%)  Clang front-end timer
         1.9714 (100.0%)   0.1793 (100.0%)   2.1507 (100.0%)   2.1517 (100.0%)  Total
      
      It's possible to use the std module in external projects
      (https://libcxx.llvm.org/Modules.html#using-in-external-projects)
      
      Tested this with a private project to validate the size of the generated files:
      
      Before
      $ du -sch std-*
      448M	std-build
      508K	std-src
      120K	std-subbuild
      449M	total
      
      After
      $ du -sch std-*
      29M	std-build
      1004K	std-src
      132K	std-subbuild
      30M	total
      
      Reviewed By: ldionne, #libc
      
      Differential Revision: https://reviews.llvm.org/D156907
      4d4c70c9
    • Valentin Clement's avatar
    • Michael Jones's avatar
      [libc] Fix vfprintf test colliding with fprintf · 8b374310
      Michael Jones authored
      Sometimes the vfprintf test was failing, I suspect that's due to it
      using the same filename as the fprintf test. This patch fixes that
      problem by changing the filename of the vfprintf output file.
      
      Reviewed By: lntue
      
      Differential Revision: https://reviews.llvm.org/D157523
      8b374310
    • Valentin Clement's avatar
      [flang][openacc] Generate the declare register function · ade0aa61
      Valentin Clement authored
      Generate the register function for global declare
      variable. This function is meant to be called after the
      actual data is allocated. Patch to insert the function call
      and attribute will follow.
      
      Depends on D157338
      
      Reviewed By: razvanlupusoru
      
      Differential Revision: https://reviews.llvm.org/D157339
      ade0aa61
    • Michael Jones's avatar
      [libc] Fix final conversion warnings · e328d193
      Michael Jones authored
      This patch fixes the floating point conversion warnings found with
      `-Wconversion` and `-Wno-sign-conversion`. These were the last warnings
      I found, meaning that once this lands https://reviews.llvm.org/D156630
      should be unblocked.
      
      Reviewed By: mcgrathr, lntue
      
      Differential Revision: https://reviews.llvm.org/D157449
      e328d193
    • Jan Svoboda's avatar
      [clang][modules][deps] Create more efficient API for visitation of `ModuleFile` inputs · dcd3a0c9
      Jan Svoboda authored
      The current `ASTReader::visitInputFiles()` function calls into `FileManager` to create `FileEntryRef` objects. This ends up being fairly costly in `clang-scan-deps`, where we mostly only care about file paths.
      
      This patch introduces new `ASTReader` API that gives clients access to just the serialized paths. Since the scanner needs both the as-requested path and the on-disk one (and doesn't want to transform the former into the latter via `FileManager`), this patch starts serializing both of them into the PCM file if they differ.
      
      This increases the size of scanning PCMs by 0.1% and speeds up scanning by 5%.
      
      Reviewed By: benlangmuir, vsapsai
      
      Differential Revision: https://reviews.llvm.org/D157066
      dcd3a0c9
    • Jorge Gorbe Moya's avatar
      [bazel] Add missing dep after 99475f5b · 6556e290
      Jorge Gorbe Moya authored
      6556e290
    • Mark de Wever's avatar
      [libc++][doc] Updates format related release notes. · cf83cfb3
      Mark de Wever authored
      As suggested by @ldionne.
      
      Reviewed By: ldionne, #libc, avogelsgesang
      
      Differential Revision: https://reviews.llvm.org/D156030
      cf83cfb3
    • Jan Svoboda's avatar
      [clang] NFC: Use compile-time option spelling when generating command line · acf57858
      Jan Svoboda authored
      When generating command lines, use the option spelling generated by TableGen (`StringLiteral`) instead of constructing it at runtime. This saves some needless allocations.
      
      Depends on D157029.
      
      Reviewed By: benlangmuir, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D157054
      acf57858
    • Jan Svoboda's avatar
      [llvm] Construct option's prefixed name at compile-time · 501f92d3
      Jan Svoboda authored
      Some Clang command-line handling code could benefit from the option's prefixed name being a `StringLiteral`. This patch changes the `llvm::opt` TableGen backend to generate and emit that into the .inc file.
      
      Depends on D157028.
      
      Reviewed By: MaskRay
      
      Differential Revision: https://reviews.llvm.org/D157029
      501f92d3
    • Fangrui Song's avatar
    • Fangrui Song's avatar
    • Fangrui Song's avatar
    • Slava Zakharin's avatar
      [flang][hlfir] Support passing polymorphic expr for non-polymorphic dummy. · ab340f97
      Slava Zakharin authored
      The actual polymorphic expression argument that is passed to a non-polymorphic
      contiguous dummy has to be made a contiguous entity with the dynamic type
      matching the declared type of the dummy argument.
      The solution is to associate the expression with a temporary of the dynamic
      type of the expression, then rebox the temporary to the declared type
      of the dummy argument, and then, if necessary, make copy-in into another
      temporary that is, finally, a contiguous entity with the required dynamic type.
      
      With this change a single prepared argument may have up to two associated
      clean-ups, so I had to change the clean-ups handling.
      
      Reviewed By: tblah
      
      Differential Revision: https://reviews.llvm.org/D157464
      ab340f97
    • Cyndy Ishida's avatar
      [macho2yaml] Fixup offset for nodes in export trie. · 15cfb449
      Cyndy Ishida authored
      The offset recorded in export trie nodes is used to capture symbol
      information like address and node size. This offset should be relative to the
      root of the trie. This updates to `processExportNode` to follow that
      expectation.
      
      Reviewed By: pete, steven_wu
      
      Differential Revision: https://reviews.llvm.org/D157431
      15cfb449
    • Valentin Clement's avatar
      [mlir] Fix verifier for call debug locations · bbce1fcb
      Valentin Clement authored
      D157096 introduces a new verifier for debug location
      on call operation. `isDeclaration()` is actually not defined
      for `LLVMFuncOp` and default to the interface definition that always
      return `false`. This leads to wrong diagnostic in some case as shown in the added test.
      Use `callee.isExternal()` instead that returns the
      desired information.
      
      We have seen this error being triggered during flang codegen.
      
      Reviewed By: Dinistro, vzakhari
      
      Differential Revision: https://reviews.llvm.org/D157447
      bbce1fcb
  2. Aug 09, 2023