1. Sep 24, 2020
    • Fangrui Song's avatar
      Revert D87970 "[ThinLTO] Avoid temporaries when loading global decl attachment metadata" · 01b9deba
      Fangrui Song authored
      This reverts commit ab1b4810.
      
      It caused an issue in llvm::lto::thinBackend for a -fsanitize=cfi build.
      
      ```
      AbbrevNo is 0 => "Invalid abbrev number"
      0  llvm::BitstreamCursor::getAbbrev (this=0x9db4c8, AbbrevID=4) at llvm/include/llvm/Bitstream/BitstreamReader.h:528
      1  0x00007f5f777a6eb4 in llvm::BitstreamCursor::readRecord (this=0x9db4c8, AbbrevID=4, Vals=llvm::SmallVector of Size 0, Capacity 64, Blob=0x7ffcd0e26558) at
      usr/local/google/home/maskray/llvm/llvm/lib/Bitstream/Reader/BitstreamReader.cpp:228
      2  0x00007f5f796bf633 in llvm::MetadataLoader::MetadataLoaderImpl::lazyLoadOneMetadata (this=0x9db3a0, ID=188, Placeholders=...) at /usr/local/google/home/mas
      ray/llvm/llvm/lib/Bitcode/Reader/MetadataLoader.cpp:1091
      3  0x00007f5f796c2527 in llvm::MetadataLoader::MetadataLoaderImpl::getMetadataFwdRefOrLoad (this=0x9db3a0, ID=188) at llvm
      lib/Bitcode/Reader/MetadataLoader.cpp:668
      4  0x00007f5f796bfff3 in llvm::MetadataLoader::getMetadataFwdRefOrLoad (this=0xd31580, Idx=188) at llvm/lib/Bitcode/Reader
      MetadataLoader.cpp:2290
      5  0x00007f5f79638265 in (anonymous namespace)::BitcodeReader::parseFunctionBody (this=0xd312e0, F=0x9de758) at llvm/lib/B
      tcode/Reader/BitcodeReader.cpp:3938
      6  0x00007f5f79635d32 in (anonymous namespace)::BitcodeReader::materialize (this=0xd312e0, GV=0x9de758) at llvm/lib/Bitcod
      /Reader/BitcodeReader.cpp:5408
      7  0x00007f5f7f8dbe3e in llvm::Module::materialize (this=0x9b92c0, GV=0x9de758) at llvm/lib/IR/Module.cpp:442
      8  0x00007f5f7f7f8fbe in llvm::GlobalValue::materialize (this=0x9de758) at llvm/lib/IR/Globals.cpp:50
      9  0x00007f5f83b9b5f5 in llvm::FunctionImporter::importFunctions (this=0x7ffcd0e2a730, DestModule=..., ImportList=...) at
      llvm/lib/Transforms/IPO/FunctionImport.cpp:1182
      ```
      01b9deba
    • Krzysztof Parzyszek's avatar
      [EarlyCSE] Fix crash with expensive checks after D87691 · e976fb1e
      Krzysztof Parzyszek authored
      D87691 reordered some checks, which turned out to be unsafe. More
      specifically, when examining a store instruction, the check against
      getOrCreateResult should be done before attempting to call
      isSameMemGeneration. Otherwise a crash in MSSA walker can occur.
      
      This patch restores the order of these calls to what it was originally.
      e976fb1e
    • Mircea Trofin's avatar
      Add REQUIRES to embed-bitcode-noopt.ll · 27192879
      Mircea Trofin authored
      27192879
    • Vinicius Tinti's avatar
      [Support/Path] Add path::is_absolute_gnu · 577adda5
      Vinicius Tinti authored
      Implements IS_ABSOLUTE_PATH from GNU tools.
      
      C++17 is_absolute behavior is different the from the behavior defined by GNU
      tools.
      
      According to cppreference.com, C++17 states: "An absolute path is a path
      that unambiguously identifies the location of a file without reference
      to an additional starting location."
      
      In other words, the rules are:
       1. POSIX style paths with nonempty root directory are absolute.
       2. Windows style paths with nonempty root name and root directory are
          absolute.
       3. No other paths are absolute.
      
      GNU rules are:
       1. Paths starting with a path separator are absolute.
       2. Windows style paths are also absolute if they start with a character
          followed by ':'.
       3. No other paths are absolute.
      
      On Windows style the path "C:\Users\Default" has "C:" as root name and "\"
      as root directory.
      
      Hence "C:" on Windows is absolute under GNU rules and not absolute under
      C++17 because it has no root directory. Likewise "/" and "\" on Windows are
      absolute under GNU and are not absolute under C++17 due to empty root name.
      
      Related to PR46368.
      
      Differential Revision: https://reviews.llvm.org/D87667
      577adda5
    • Dmitry Antipov's avatar
      Add optimal thread strategy · 68358081
      Dmitry Antipov authored
      Add an optimal thread strategy to execute specified amount of tasks.
      This strategy should prevent us from creating too many threads if we
      occasionaly have an unexpectedly small amount of tasks.
      
      Differential Revision: https://reviews.llvm.org/D87765
      68358081
    • Mircea Trofin's avatar
      [clang]Test ensuring -fembed-bitcode passed to cc1 captures pre-opt bitcode. · 437358be
      Mircea Trofin authored
      This is important to not regress because it allows us to capture pre-optimization
      bitcode and options, and replay the full optimization pipeline.
      
      Differential Revision: https://reviews.llvm.org/D88114
      437358be
    • Guozhi Wei's avatar
      [MBFIWrapper] Add a new function getBlockProfileCount · fd75ad86
      Guozhi Wei authored
      MBFIWrapper keeps track of block frequencies of newly created blocks and
      modified blocks, modified block frequencies should also impact block profile
      count. This class doesn't provide interface getBlockProfileCount, users can only
      use the underlying MBFI to query profile count, the underlying MBFI doesn't know
      the modifications made in MBFIWrapper, so it either provides stale profile count
      for modified block or simply crashes on new blocks.
      
      So this patch add function getBlockProfileCount to class MBFIWrapper to handle
      new blocks or modified blocks.
      
      Differential Revision: https://reviews.llvm.org/D87802
      fd75ad86
    • Stella Laurenzo's avatar
      NFC: Remove dangling dep on MLIRStandardOps. · 63998649
      Stella Laurenzo authored
      Was inadvertently left out of D88155.
      63998649
    • David Greene's avatar
      [UpdateTestChecks] Remove bug-exposing test · b8779337
      David Greene authored
      Remove RISCV codegen tests for --include-generated-funcs because apparently
      MachineOutliner has a bug on that target that is exposed by expensive-checks.
      b8779337
    • Stella Laurenzo's avatar
      Remove MLIR C-API explicit registration of standard ops. · b522f09d
      Stella Laurenzo authored
      * Added mlirRegisterAllDialects() to the python API until a more complete registration design emerges for it.
      
      Differential Revision: https://reviews.llvm.org/D88155
      b522f09d
    • Rahul Joshi's avatar
      [MLIR][NFC] Adopt use of BlockRange in place of ArrayRef<Block *> · a6ae6950
      Rahul Joshi authored
      - Use BlockRange in ODS generated builders as well as other places throughout the code
      
      Differential Revision: https://reviews.llvm.org/D87955
      a6ae6950
    • Mehdi Amini's avatar
      f6aceb72
    • Aaron Ballman's avatar
      Improve dynamic AST matching diagnostics for conversion errors · 819ff6b9
      Aaron Ballman authored
      Currently, when marshaling a dynamic AST matchers, we check for the type
      and value validity of matcher arguments at the same time for some matchers.
      For instance, when marshaling hasAttr("foo"), the argument is first type
      checked to ensure it's a string and then checked to see if that string can
      locate an attribute with that name. Similar happens for other enumeration
      conversions like cast kinds or unary operator kinds. If the type is
      correct but the value cannot be looked up, we make a best-effort attempt
      to find a nearby name that the user might have meant, but if one cannot
      be found, we throw our hands up and claim the types don't match.
      
      This has an unfortunate behavior that when the user enters something of
      the correct type but a best guess cannot be located, you get confusing
      error messages like:
      Incorrect type for arg 1. (Expected = string) != (Actual = String).
      
      This patch splits the argument check into two parts: if the types don't
      match, give a type diagnostic. If the type matches but the value cannot
      be converted, give a best guess diagnostic or a value could not be
      located diagnostic. This addresses PR47057.
      819ff6b9
    • Rahul Joshi's avatar
      [MLIR][NFC] Adopt use of TypeRange in build() methods. · 08e4f078
      Rahul Joshi authored
      - Use TypeRange instead of ArrayRef<Type> where possible.
      - Change some of the custom builders to also use TypeRange
      
      Differential Revision: https://reviews.llvm.org/D87944
      08e4f078
    • Rahul Joshi's avatar
      [MLIR] Change default builders generated by TableGen to use TypeRange for result types · 97446066
      Rahul Joshi authored
      - Change the default builders to use TypeRange instead of ArrayRef<Type>
      - Custom builders defined in LinalgStructuredOps now conflict with the default
        separate param ones, but the default collective params one is still needed. Resolve
        this by replicating the collective param builder as a custom builder and skipping
        the generation of default builders for these ops.
      
      Differential Revision: https://reviews.llvm.org/D87926
      97446066
  2. Sep 23, 2020