1. May 11, 2020
    • Xing GUO's avatar
      1171bef0
    • Fangrui Song's avatar
      [gcov] Implement --stdout -t · f081150c
      Fangrui Song authored
      gcov by default prints to a .gcov file. With --stdout, stdout is used.
      Some summary information is omitted. There is no separator for multiple
      source files.
      f081150c
    • Johannes Doerfert's avatar
      [Attributor] Merge the query set into AbstractAttribute · 3a8740bd
      Johannes Doerfert authored
      The old QuerriedAAs contained two vectors, one for required one for
      optional dependences (=queries). We now use a single vector and encode
      the kind directly in the pointer.
      
      This reduces memory consumption and makes the connection between
      abstract attributes and their dependences clearer.
      
      No functional change is intended, changes in the test are due to
      different order in the query map. Neither the order before nor now is in
      any way special.
      
      ---
      
      Single run of the Attributor module and then CGSCC pass (oldPM)
      for SPASS/clause.c (~10k LLVM-IR loc):
      
      Before:
      ```
      calls to allocation functions: 543734 (329735/s)
      temporary memory allocations: 105895 (64217/s)
      peak heap memory consumption: 19.19MB
      peak RSS (including heaptrack overhead): 102.26MB
      total memory leaked: 269.10KB
      ```
      
      After:
      ```
      calls to allocation functions: 513292 (341511/s)
      temporary memory allocations: 106028 (70544/s)
      peak heap memory consumption: 13.35MB
      peak RSS (including heaptrack overhead): 95.64MB
      total memory leaked: 269.10KB
      ```
      
      Difference:
      ```
      calls to allocation functions: -30442 (208506/s)
      temporary memory allocations: 133 (-910/s)
      peak heap memory consumption: -5.84MB
      peak RSS (including heaptrack overhead): 0B
      total memory leaked: 0B
      ```
      
      ---
      
      Reviewed By: uenoku
      
      Differential Revision: https://reviews.llvm.org/D78729
      3a8740bd
    • QingShan Zhang's avatar
      [DAGCombine] Remove the getNegatibleCost to avoid the out of sync with getNegatedExpression · 3c44c441
      QingShan Zhang authored
      We have the getNegatibleCost/getNegatedExpression to evaluate the cost and negate the expression.
      However, during negating the expression, the cost might change as we are changing the DAG,
      and then, hit the assertion if we negated the wrong expression as the cost is not trustful anymore.
      
      This patch is target to remove the getNegatibleCost to avoid the out of sync with getNegatedExpression,
      and check the cost during negating the expression. It also reduce the duplicated code between
      getNegatibleCost and getNegatedExpression. And fix the crash for the test in D76638
      
      Reviewed By: RKSimon, spatel
      
      Differential Revision: https://reviews.llvm.org/D77319
      3c44c441
    • Muhammad Omair Javaid's avatar
      [LLDB] Decorate tests failing on arm-linux buildbot · 8e63f35f
      Muhammad Omair Javaid authored
      Tests impacted by these decorators fail on arm-linux-gnueabihf.
      
      These have been triaged and appropriate bugs have been filed.
      8e63f35f
    • Muhammad Omair Javaid's avatar
    • Muhammad Omair Javaid's avatar
      XFAIL NativePDB tests on arm-linux · 634b359c
      Muhammad Omair Javaid authored
      NativePDB tests fail on arm-linux buildbot. clang-cl driver crashes with
      -m32 option. Bug files http://llvm.org/pr45867
      634b359c
    • Fangrui Song's avatar
      [X86] Fix combineVectorCompareAndMaskUnaryOp regression after... · f40fc7b8
      Fangrui Song authored
      [X86] Fix combineVectorCompareAndMaskUnaryOp regression after 0e8e7314
      f40fc7b8
    • Lang Hames's avatar
    • Nico Weber's avatar
      c5647992
    • Nico Weber's avatar
      e3a44634
    • Johannes Doerfert's avatar
      [Attributor][FIX] Carefully handle/ignore/forget `argmemonly` · 5e06b251
      Johannes Doerfert authored
      When we have an existing `argmemonly` or `inaccessiblememorargmemonly`
      we used to "know" that information. However, interprocedural constant
      propagation can invalidate these attributes. We now ignore and remove
      these attributes for internal functions (which may be affected by IP
      constant propagation), if we are deriving new attributes for the
      function.
      5e06b251
    • Johannes Doerfert's avatar
      [Attributor] Use "simplify to constant" in genericValueTraversal · 713ee3aa
      Johannes Doerfert authored
      As we replace values with constants interprocedurally, we also need to
      do this "look-through" step during the generic value traversal or we
      would derive properties from replaced values. While this is often not
      problematic, it is when we use the "kind" of a value for reasoning,
      e.g., accesses to arguments allow `argmemonly`.
      713ee3aa
    • Johannes Doerfert's avatar
      [Attributor] Ignore illegal accesses to `null` · 513ac6e9
      Johannes Doerfert authored
      When we categorize a pointer value we bailed at `null` before. If we
      know `null` is not a valid memory location we can ignore it as there
      won't be an access at all.
      513ac6e9
    • Johannes Doerfert's avatar
      [Attributor] Use existing helpers to determine IR facts · 31c03b92
      Johannes Doerfert authored
      We now use getPointerDereferenceableBytes to determine `nonnull` and
      `dereferenceable` facts from the IR. We also use getPointerAlignment in
      AAAlign for the same reason. The latter can interfere with callbacks so
      we do restrict it to non-function-pointers for now.
      31c03b92
    • Johannes Doerfert's avatar
      a9ee8b49
    • Lang Hames's avatar
      [ORC] Share ownership of JITDylibs between ExecutionSession and · 41379f1e
      Lang Hames authored
      MaterializationResponsibility.
      
      MaterializationResponsibility objects provide a connection between a
      materialization process (compiler, jit linker, etc.) and the JIT state held in
      the ExecutionSession and JITDylib objects. Switching to shared ownership
      extends the lifetime of JITDylibs to ensure they remain accessible until all
      materializers targeting them have completed. This will allow (in a follow-up
      patch) JITDylibs to be removed from the ExecutionSession and placed in a
      pending-destruction state while they are kept alive to communicate errors
      to/from any still-runnning materialization processes. The intent is to enable
      JITDylibs to be safely removed even if they have running compiles targeting
      them.
      41379f1e
    • Fangrui Song's avatar
      [gcov] Default coverage version to '407*' and delete CC1 option -coverage-cfg-checksum · 25544ce2
      Fangrui Song authored
      Defaulting to -Xclang -coverage-version='407*' makes .gcno/.gcda
      compatible with gcov [4.7,8)
      
      In addition, delete clang::CodeGenOptionsBase::CoverageExtraChecksum and GCOVOptions::UseCfgChecksum.
      We can infer the information from the version.
      
      With this change, .gcda files produced by `clang --coverage a.o` linked executable can be read by gcov 4.7~7.
      We don't need other -Xclang -coverage* options.
      There may be a mismatching version warning, though.
      
      (Note, GCC r173147 "split checksum into cfg checksum and line checksum"
       made gcov 4.7 incompatible with previous versions.)
      25544ce2
    • Ricky Zhou's avatar
      [examples] Fix llvm.memset prototype in BrainF example. · 6d23f298
      Ricky Zhou authored
      Commit 1e68724d removed the alignment
      argument from the memset intrinsic. Update the BrainF example to match.
      
      Reviewed By: jyknight
      Differential Revision: https://reviews.llvm.org/D79601
      6d23f298
    • Matt Arsenault's avatar
    • Richard Smith's avatar
    • Richard Smith's avatar
      Enforce the C++11 anonymous enum bitfields check even for · 8fc12b86
      Richard Smith authored
      Objective-C++11 and under MS extensions.
      
      This matches the MSVC behavior, and means that Objective-C behaves as a
      set of extensions to the base language, rather than replacing the base
      language rule with a different one.
      8fc12b86
    • Richard Smith's avatar
      Fix typo in enum-base disambiguation. · 2d3f5a62
      Richard Smith authored
      2d3f5a62
    • Martin Storsjö's avatar
      [LLD] [COFF] Fix def file exporting of symbols containing periods · ed0a57f7
      Martin Storsjö authored
      This fixes an accidental breakage of exporting symbols using def
      files, when the symbol name contains a period, since commit
      0ca06f79, mixing up a symbol name containing a period with
      the case of exporting a symbol as a forward to another dll.
      
      Differential Revision: https://reviews.llvm.org/D79619
      ed0a57f7
    • Richard Smith's avatar
      Properly implement 'enum class' parsing. · d6425e2c
      Richard Smith authored
      The 'class' or 'struct' keyword is only permitted as part of either an
      enum definition or a standalone opaque-enum-declaration, not as part of
      an elaborated type specifier. We previously failed to diagnose this, and
      generally didn't properly implement the restrictions on elaborated type
      specifiers for enumeration types.
      
      In passing, also fixed incorrect parsing for enum-bases, which we
      previously parsed as a type-name, but are actually a type-specifier-seq.
      This matters for cases like 'enum E : int *p;', which is valid as a
      Microsoft extension.
      
      Plus some minor parse diagnostic improvements.
      
      Bumped the recently-added ExtWarn for 'enum E : int x;' to be
      DefaultError; this is not an intentional extension, so producing an
      error by default seems appropriate, but the warning flag to disable it
      may still be useful for code written against old Clang. The same
      treatment is given here to the diagnostic for 'enum class E x;', which
      we similarly have incorrectly accepted for many years. These diagnostics
      continue to be suppressed under -fms-extensions and when compiling
      Objective-C code. We will need to decide separately whether Objective-C
      should follow the C++ rules or the (older) MSVC rules.
      d6425e2c
    • Fangrui Song's avatar
      [gcov] Delete CC1 option -coverage-no-function-names-in-data · 13a633b4
      Fangrui Song authored
      rL144865 incorrectly wrote function names for GCOV_TAG_FUNCTION
      (this might be part of the reasons the header says
      "We emit files in a corrupt version of GCOV's "gcda" file format").
      
      rL176173 and rL177475 realized the problem and introduced -coverage-no-function-names-in-data
      to work around the issue. (However, the description is wrong.
      libgcov never writes function names, even before GCC 4.2).
      
      In reality, the linker command line has to look like:
      
      clang --coverage -Xclang -coverage-version='407*' -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data
      
      Failing to pass -coverage-no-function-names-in-data can make gcov 4.7~7
      either produce wrong results (for one gcov-4.9 program, I see "No executable lines")
      or segfault (gcov-7).
      (gcov-8 uses an incompatible format.)
      
      This patch deletes -coverage-no-function-names-in-data and the related
      function names support from libclang_rt.profile
      13a633b4
    • Craig Topper's avatar
      [X86] Add a few more shuffles to hasUndefRegUpdate. · e4c454b0
      Craig Topper authored
      Mostly found by asserting on tests that have undef operands. I'm
      sure this isn't an exhaustive list.
      e4c454b0
    • Tyker's avatar
      [AssumeBundles] Remove non-determinisme from assume builder · 5957e058
      Tyker authored
      Summary:
      The assume builder was non-deterministic when working on unamed values.
      this patch fixes this.
      
      Reviewers: jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: hiraditya, mgrang, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D78616
      5957e058
    • Andrea Di Biagio's avatar
      [MCA][InstrBuilder] Correctly mark reserved resources in initializeUsedResources. · 47b95d7c
      Andrea Di Biagio authored
      This fixes a bug reported by Alex Renda on LLVMDev where mca did not correctly
      mark a resource group as "reserved".
      (See http://lists.llvm.org/pipermail/llvm-dev/2020-May/141485.html).
      
      The issue was caused by a wrong check in function `initializeUsedResources`.
      As a consequence of this, a resource group was left unreserved, and its field
      `NumUnits` incorrectly reported an unrealistic number of consumed resource
      units.
      
      This patch fixes the issue with the handling of reserved resources in the
      InstrBuilder class, and adds a simple test for it.  Ideally, as suggested by
      Andy Trick, most of these problems will disappear if in the future we will
      introduce a (optional) DelayCycles vector for SchedWriteRes.
      47b95d7c
    • Fangrui Song's avatar
      93d5ae3a
    • Fangrui Song's avatar
      [compiler-rt][test] Add feature host-byteorder-big-endian · 415c689d
      Fangrui Song authored
      This is needed to make 5a9b792d "[gcov] Temporarily unsupport host-byteorder-big-endian"
      work.
      415c689d
    • Fangrui Song's avatar
      [gcov] Temporarily unsupport host-byteorder-big-endian · 5a9b792d
      Fangrui Song authored
      llvm-cov gcov does not support host-byteorder-big-endian yet.
      5a9b792d
    • Tyker's avatar
      [AssumeBundles] Prevent generation of some redundant assumes · 821a0f23
      Tyker authored
      Summary: with this patch the assume salvageKnowledge will not generate assume if all knowledge is already available in an assume with valid context. assume bulider can also in some cases update an existing assume with better information.
      
      Reviewers: jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D78014
      821a0f23
    • Fangrui Song's avatar
      [gcov] Don't skip leading zeros when reading a string · 7f22ceea
      Fangrui Song authored
      Even a 2003 version of gcov_read_string does not have the behavior
      described by rL204881. The wrong impression might come from
      libclang_rt.profile (GCDAProfiling.c)'s corrupted output (since the
      initial import rL144865). Note, the corrupted output crashes gcov.
      7f22ceea
    • Fangrui Song's avatar
      [gcov] Fix .gcda decoding and support GCC 8, 9 and 10 · 2d00eb17
      Fangrui Song authored
      GCDAProfiling.c unnecessarily writes function names to .gcda files.
      GCC 4.2 gcc/libgcov.c (now renamed to libgcc/libgcov*) did not write function
      names. gcov-7 (compatible) crashes on .gcda produced by libclang_rt.profile
      rL176173 realized the problem and introduced a mode to remove function
      names.
      
      llvm-cov code apparently takes GCDAProfiling.c output format as truth
      and tries to decode function names.  Additionally, llvm-cov tries to
      decode tags in certain order which does not match libgcov emitted .gcda
      files.
      
      This patch fixes the .gcda decoder and makes it work with GCC 8 and 9
      (10 is compatible with 9). Note, line statistics are broken and not
      fixed by this patch.
      
      Add test/tools/llvm-cov/gcov-{4.7,8,9}.c to test compatibility.
      2d00eb17
    • Florian Hahn's avatar
      [LAA] Move runtime-check generation to Transforms/Utils/loopUtils (NFC) · 8528186b
      Florian Hahn authored
      Currently LAA's uses of ScalarEvolutionExpander blocks moving the
      expander from Analysis to Transforms. Conceptually the expander does not
      fit into Analysis (it is only used for code generation) and
      runtime-check generation also seems to be better suited as a
      transformation utility.
      
      Reviewers: Ayal, anemet
      
      Reviewed By: Ayal
      
      Differential Revision: https://reviews.llvm.org/D78460
      8528186b
  2. May 10, 2020