1. Mar 01, 2018
  2. Feb 28, 2018
    • Alexey Bataev's avatar
      [DEBUGINFO] Add flag for DWARF2 or less to use sections as references. · 9de940b9
      Alexey Bataev authored
      Summary:
      Some targets does not support labels inside debug sections, but support
      references in form `section +|- offset`. Patch adds initial support
      for this. Also, this patch disables emission of all additional debug
        sections that may have labels inside of it (like pub sections and
        string tables).
      
      Reviewers: probinson, echristo
      
      Subscribers: JDevlieghere, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D43627
      
      llvm-svn: 326328
      9de940b9
    • Alexander Kornienko's avatar
      Rename a few checks from misc- to bugprone-. · a1a29336
      Alexander Kornienko authored
      Summary:
      rename_check.py {misc,bugprone}-forwarding-reference-overload
      rename_check.py {misc,bugprone}-macro-repeated-side-effects
      rename_check.py {misc,bugprone}-lambda-function-name
      rename_check.py {misc,bugprone}-misplaced-widening-cast
      
      Reviewers: hokein, sammccall, aaron.ballman
      
      Reviewed By: aaron.ballman
      
      Subscribers: klimek, cfe-commits, mgorny
      
      Differential Revision: https://reviews.llvm.org/D43867
      
      llvm-svn: 326327
      a1a29336
    • Nicholas Wilson's avatar
      [WebAssembly] Fix copy-paste error in debugging string · 7e4eee98
      Nicholas Wilson authored
      llvm-svn: 326326
      7e4eee98
    • Eric Liu's avatar
      [clangd] A few more fixes for STL header mapping. · 06d41811
      Eric Liu authored
      llvm-svn: 326325
      06d41811
    • Gabor Horvath's avatar
      [analyzer] Fix a compiler warning · 72609324
      Gabor Horvath authored
      llvm-svn: 326324
      72609324
    • Gabor Horvath's avatar
      [analyzer] Support for naive cross translation unit analysis · eb0584be
      Gabor Horvath authored
      The aim of this patch is to be minimal to enable incremental development of
      the feature on the top of the tree. This patch should be an NFC when the
      feature is turned off. It is turned off by default and still considered as
      experimental.
      
      Technical details are available in the EuroLLVM Talk: 
      http://llvm.org/devmtg/2017-03//2017/02/20/accepted-sessions.html#7
      
      Note that the initial prototype was done by A. Sidorin et al.: http://lists.llvm.org/pipermail/cfe-dev/2015-October/045730.html
      
      Contributions to the measurements and the new version of the code: Peter Szecsi, Zoltan Gera, Daniel Krupp, Kareem Khazem.
      
      Differential Revision: https://reviews.llvm.org/D30691
      
      llvm-svn: 326323
      eb0584be
    • Simon Dardis's avatar
      [mips] Begin reworking instruction predicates for ISAs/encodings (1/N) · 4529aac2
      Simon Dardis authored
      The MIPS backend has inconsistent usage of instruction predicates
      for assembly and code generation. The issue arises from supporting three
      encodings, two (MIPS and microMIPS) of which have a near 1:1 instruction
      mapping across ISA revisions and a third encoding with a more restricted
      set of instructions (MIPS16e).
      
      To enforce consistent usage, each of the ISA_* adjectives has (or will
      have) the relevant encoding attached to it along the relevant ISA revision
      where the instruction is defined.
      
      Each instruction, pattern or alias will then have the correct ISA adjective
      attached to it, and the base instruction description classes will have any
      predicates relating to ISA encoding or revision removed.
      
      Pseudo instructions will also be guarded for the encoding or ABI that they are
      supported in.
      
      Finally, the hasStandardEncoding() / inMicroMipsMode() / inMips16Mode() methods
      of MipsSubtarget will be changed such that only one can be true at any one time.
      
      The result of this is that code generation and assembly will produce the
      correct encoding up front, while code generated from pseudo instructions
      and other inserted sequences of instructions will be able to rely on the mapping
      tables to produce the correct encoding. This should fix numerous bugs where
      the result 'happens' to be correct but has edge cases where microMIPS and MIPS
      have subtle differences (e.g. microMIPSR6 using 'j', 'jal' instructions.)
      
      This patch starts the process by changing most of the ISA adjectives to make
      use of the EncodingPredicate member of PredicateControl. Follow on patches
      will annotate instructions with their correct ISA adjective and eliminate
      the usage of "let Predicates = [..]", "let AdditionalPredicates = [..]" and
      "isCodeGenOnly = 1" in the cases where it was used to control instruction
      availability.
      
      Contributions from Nitesh Jain.
      
      Reviewers: atanasyan
      
      Differential Revision: https://reviews.llvm.org/D41434
      
      llvm-svn: 326322
      4529aac2
    • Alexander Kornienko's avatar
      [clang-tidy] Fix 'add_new_check.py --udpate-docs' · 9ac01b07
      Alexander Kornienko authored
      llvm-svn: 326321
      9ac01b07
    • Alexander Ivchenko's avatar
      [GlobalIsel][X86] Support G_INTTOPTR instruction. · c01f7504
      Alexander Ivchenko authored
      Add legalization/selection for x86/x86_64 and
      corresponding tests.
      
      Reviewed By: igorb
      
      Differential Revision: https://reviews.llvm.org/D43622
      
      llvm-svn: 326320
      c01f7504
    • Xin Tong's avatar
      Fix typo. NFC · 256869d8
      Xin Tong authored
      llvm-svn: 326319
      256869d8
    • Xin Tong's avatar
      [MergeICmp] Fix a bug in MergeICmp that can lead to a block being processed more than once. · 8ba674e4
      Xin Tong authored
      Summary:
      Fix a bug in MergeICmp that can lead to a BCECmp block being processed more than once and eventually lead to a broken LLVM module.
      The problem is that if the non-constant value is not produced by the last block, the producer will be processed once when the its parent block
      is processed and second time when the last block is processed.
      
      We end up having 2 same BCECmpBlock in the merge queue. And eventually lead to a broken LLVM module.
      
      Reviewers: courbet, davide
      
      Reviewed By: courbet
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D43825
      
      llvm-svn: 326318
      8ba674e4
    • Klaus Kretzschmar's avatar
      [IR] - Make User construction exception safe · 60f57369
      Klaus Kretzschmar authored
      There are many instruction ctors that call the setName method of the Value base class, which can throw a bad_alloc exception in OOM situations. 
      In such situations special User delete operators are called which are not implemented yet.
      
      Example:
       Lets look at the construction of a CallInst instruction during IR generation:
      
      static CallInst *Create(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args, .. ){
      ...
      
      return new (TotalOps, DescriptorBytes) CallInst(Ty, Func, Args, Bundles, NameStr, InsertBefore);
      
      }
      
      CallInst::CalInst(Value* Func, ...) {
      ...
      Op<-1>() = Func;
      ....
      setName(name); // throws
      ...
      }
      Op<-1>() returns a reference to a Use object of the CallInst instruction and the operator= inserts this use object into the UseList of Func. 
      The same object is removed from that UseList by calling the User::operator delete If the CallInst object is deleted. 
      Since setName can throw a bad_alloc exception (if LLVM_ENABLE_EXCEPTIONS is switched on), the unwind chain runs into assertions ("Constructor throws?") in 
      special User::operator deletes operators:
      
      operator delete(void* Usr, unsigned)
      operator delete(void* Usr, unsigned, bool)
      This situation can be fixed by simlpy calling the User::operator delete(void*) in these unimplemented methods.
      
      To ensure that this additional call succeeds all information that is necessary to calculate the storage pointer from the Usr address 
      must be restored in the special case that a sublass has changed this information, e.g. GlobalVariable can change the NumberOfOperands.
      
      Reviewd by: rnk
      
      Differential Revision: https://reviews.llvm.org/D42731
      
      llvm-svn: 326316
      60f57369
    • David Green's avatar
      [Dominators] Remove verifyDomTree and add some verifying for Post Dom Trees · 7c35de12
      David Green authored
      Removes verifyDomTree, using assert(verify()) everywhere instead, and
      changes verify a little to always run IsSameAsFreshTree first in order
      to print good output when we find errors. Also adds verifyAnalysis for
      PostDomTrees, which will allow checking of PostDomTrees it the same way
      we check DomTrees and MachineDomTrees.
      
      Differential Revision: https://reviews.llvm.org/D41298
      
      llvm-svn: 326315
      7c35de12
    • Alexander Kornienko's avatar
    • Eric Liu's avatar
      [clangd] Prefer the definition of a TagDecl (e.g. class) as CanonicalDeclaration. · cf8601b0
      Eric Liu authored
      Summary:
      Currently, we pick the first declaration of a symbol in a TU, which is considered
      canonical in the clangIndex, as the canonical declaration in clangd. This causes
      forward declarations that might appear in a random header to be used as a
      canonical declaration, which is not desirable for features like go-to-declaration
      or include insertion.
      
      For example, for class X, we would consider the forward declaration in fwd.h to
      be the canonical declaration, while the preferred canonical declaration should
      be the actual definition in x.h.
      ```
      // fwd.h
      class X;  // forward decl
      
      // x.h
      class X {};
      ```
      
      This patch fixes the issue by making symbol collector favor the actual definition of
      a TagDecl (i.e. class/struct/enum/union) found in a header file over the first seen
      declarations in a TU. Other symbol types like functions are not handled because
      using the first seen declarations as canonical declarations is usually a good
      heuristic for them.
      
      Reviewers: sammccall
      
      Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D43823
      
      llvm-svn: 326313
      cf8601b0
    • Joachim Protze's avatar
      [OMPT] Fix inconsistent testcases · 4df80bda
      Joachim Protze authored
      The main change of this patch is to insert {{.*}} in current_address=[[RETURN_ADDRESS_END]].
      This is needed to match any of the alternatively printed addresses.
      
      Additionally, clang-format is applied to the two tests.
      
      Differential Revision: https://reviews.llvm.org/D43115
      
      llvm-svn: 326312
      4df80bda
    • Alexander Ivchenko's avatar
      [GlobalIsel][X86] Support G_PTRTOINT instruction. · 46e07e36
      Alexander Ivchenko authored
      Add legalization/selection for x86/x86_64 and
      corresponding tests.
      
      Reviewed By: igorb
      
      Differential Revision: https://reviews.llvm.org/D43617
      
      llvm-svn: 326311
      46e07e36
    • Eric Liu's avatar
      [clangd] A few minor fixes for STL internal header mapping. · 212e6761
      Eric Liu authored
      llvm-svn: 326310
      212e6761
    • Alex Bradbury's avatar
      [RISCV] Update two tests after r326208 · 1b2a0f43
      Alex Bradbury authored
      llvm-svn: 326309
      1b2a0f43
    • Craig Topper's avatar
      [X86] Don't use EXTRACT_ELEMENT from v1i1 with i8/i32 result type when we need... · 48d5ed26
      Craig Topper authored
      [X86] Don't use EXTRACT_ELEMENT from v1i1 with i8/i32 result type when we need to guarantee zeroes in the upper bits of return.
      
      An extract_element where the result type is larger than the scalar element type is semantically an any_extend of from the scalar element type to the result type. If we expect zeroes in the upper bits of the i8/i32 we need to mae sure those zeroes are explicit in the DAG.
      
      For these cases the best way to accomplish this is use an insert_subvector to pad zeroes to the upper bits of the v1i1 first. We extend to either v16i1(for i32) or v8i1(for i8). Then bitcast that to a scalar and finish with a zero_extend up to i32 if necessary. We can't extend past v16i1 because that's the largest mask size on KNL. But isel is smarter enough to know that a zext of a bitcast from v16i1 to i16 can use a KMOVW instruction. The insert_subvectors will be dropped during isel because we can determine that the producing instruction already zeroed the upper bits of the k-register.
      
      llvm-svn: 326308
      48d5ed26