Skip to content
  1. Jun 09, 2017
    • Erich Keane's avatar
      support operator keywords used in Windows SDK · 33c3d8a9
      Erich Keane authored
      to support operator keywords used in Windows SDK, alter token type when 
      seen in system headers
      
      Hello, I submitted D33505 to address this problem, but the 
      proposal was rejected as too big a hammer.
      This change will allow clang to parse the WindowsSDK header <query.h> 
      which uses the operator name "or" as a field name. Treat cpp operator 
      keywords as ordinary identifiers inside the Microsoft headers, but 
      treat them as usual in the user's program.
      
      Original Submitter: Melanie Blower (mibintc)
      
      Differential Revision: https://reviews.llvm.org/D33782
      
      llvm-svn: 305087
      33c3d8a9
    • Craig Topper's avatar
      [LazyValueInfo] Don't run the more complex predicate handling code for EQ and... · 31ce4ec2
      Craig Topper authored
      [LazyValueInfo] Don't run the more complex predicate handling code for EQ and NE in getPredicateResult
      
      Summary:
      Unless I'm mistaken, the special handling for EQ/NE should cover everything and there is no reason to fallthrough to the more complex code. For that matter I'm not sure there's any reason to special case EQ/NE other than avoiding creating temporary ConstantRanges.
      
      This patch moves the complex code into an else so we only do it when we are handling a predicate other than EQ/NE.
      
      Reviewers: anna, reames, resistor, Farhana
      
      Reviewed By: anna
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D34000
      
      llvm-svn: 305086
      31ce4ec2
    • Krzysztof Parzyszek's avatar
      [Hexagon] Fixes and updates to the selection patterns · 7aca2fd8
      Krzysztof Parzyszek authored
      - Add some missing patterns.
      - Use C4_cmplte in branch patterns.
      - Fix signedness of immediate operand in M2_accii.
      
      llvm-svn: 305085
      7aca2fd8
    • Zvi Rackover's avatar
      SelectionDAG: Remove deleted nodes from legalized set to avoid clash with newly created nodes · 3a2c4b48
      Zvi Rackover authored
      Summary:
      During DAG legalization loop in SelectionDAG::Legalize(),
      bookkeeping of the SDNodes that were already legalized is implemented
      with SmallPtrSet (LegalizedNodes). This kind of set stores only pointers
      to objects, not the objects themselves. Unfortunately, if SDNode is
      deleted during legalization for some reason, LegalizedNodes set is not
      informed about this fact. This wouldn’t be so bad, if SelectionDAG wouldn’t reuse
      space deallocated after deletion of unused nodes, for creation of new
      ones. Because of this, new nodes, created during legalization often can
      have pointers identical to ones that have been previously legalized,
      added to the LegalizedNodes set, and deleted afterwards. This in turn
      causes, that newly created nodes, sharing the same pointer as deleted
      old ones, are present in LegalizedNodes *already at the moment of
      creation*, so we never call Legalize on them.
      The fix facilitates the fact, that DAG notifies listeners about each
      modification. I have registered DAGNodeDeletedListener inside
      SelectionDAG::Legalize, with a callback function that removes any
      pointer of any deleted SDNode from the LegalizedNodes set. With this
      modification, LegalizeNodes set does not contain pointers to nodes that
      were deleted, so newly created nodes can always be inserted to it, even
      if they share pointers with old deleted nodes.
      
      Patch by pawel.szczerbuk@intel.com
      
      The issue this patch addresses causes failures in an out-of-tree target,
      and i was not able to create a reproducer for an in-tree target, hence
      there is no test-case.
      
      Reviewers: delena, spatel, RKSimon, hfinkel, davide, qcolombet
      
      Reviewed By: delena
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D33891
      
      llvm-svn: 305084
      3a2c4b48
    • Simon Dardis's avatar
      Reland "[SelectionDAG] Enable target specific vector scalarization of calls and returns" · 212cccb2
      Simon Dardis authored
      By target hookifying getRegisterType, getNumRegisters, getVectorBreakdown,
      backends can request that LLVM to scalarize vector types for calls
      and returns.
      
      The MIPS vector ABI requires that vector arguments and returns are passed in
      integer registers. With SelectionDAG's new hooks, the MIPS backend can now
      handle LLVM-IR with vector types in calls and returns. E.g.
      'call @foo(<4 x i32> %4)'.
      
      Previously these cases would be scalarized for the MIPS O32/N32/N64 ABI for
      calls and returns if vector types were not legal. If vector types were legal,
      a single 128bit vector argument would be assigned to a single 32 bit / 64 bit
      integer register.
      
      By teaching the MIPS backend to inspect the original types, it can now
      implement the MIPS vector ABI which requires a particular method of
      scalarizing vectors.
      
      Previously, the MIPS backend relied on clang to scalarize types such as "call
      @foo(<4 x float> %a) into "call @foo(i32 inreg %1, i32 inreg %2, i32 inreg %3,
      i32 inreg %4)".
      
      This patch enables the MIPS backend to take either form for vector types.
      
      The previous version of this patch had a "conditional move or jump depends on
      uninitialized value".
      
      Reviewers: zoran.jovanovic, jaydeep, vkalintiris, slthakur
      
      Differential Revision: https://reviews.llvm.org/D27845
      
      llvm-svn: 305083
      212cccb2
    • Roman Lebedev's avatar
      [clang-tidy] readability-function-size: add NestingThreshold param. · a1cee296
      Roman Lebedev authored
      Summary:
      Finds compound statements which create next nesting level after `NestingThreshold` and emits a warning.
      Do note that it warns about each compound statement that breaches the threshold, but not any of it's sub-statements, to have readable warnings.
      
      I was able to find only one coding style referencing nesting:
        - https://www.kernel.org/doc/html/v4.10/process/coding-style.html#indentation
           > In short, 8-char indents make things easier to read, and have the added benefit of warning you when you’re nesting your functions too deep.
      
      This seems too basic, i'm not sure what else to test. Are more tests needed?
      
      Reviewers: alexfh, aaron.ballman, sbenza
      
      Reviewed By: alexfh, aaron.ballman
      
      Subscribers: xazax.hun
      
      Tags: #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D32942
      
      llvm-svn: 305082
      a1cee296
    • Sanjay Patel's avatar
      [SimplifyLibCalls] fix formatting; NFC · 70db4246
      Sanjay Patel authored
      llvm-svn: 305081
      70db4246
    • Sanjay Patel's avatar
      [ValueTracking] fix typo; NFC · fef83e8f
      Sanjay Patel authored
      llvm-svn: 305080
      fef83e8f
    • David Stuttard's avatar
      [AMDGPU] Fix for issue in alloca to vector promotion pass · 82618baa
      David Stuttard authored
      Summary:
      Alloca promotion pass not dealing with non-canonical input
      
      Added some additional checks so the pass simply backs-off forms it can't deal with (non-canonical)
      
      Also added some test cases in non-canonical form to check that it no longer crashes
      
      Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tpr, t-tye
      
      Differential Revision: https://reviews.llvm.org/D31710
      
      llvm-svn: 305079
      82618baa
    • Javed Absar's avatar
      [ARM] Custom machine-scheduler. NFCI. · 9e1ff865
      Javed Absar authored
      This patch creates a customised machine-scheduler for ARM targets,
      so that subsequently DAG mutations etc can be added.
      Reviewed by: hahn, rengolin, rovka. 
      Differential Revision: https://reviews.llvm.org/D34039
      
      llvm-svn: 305078
      9e1ff865
    • Nirav Dave's avatar
      [MC] Fix compiler crash in AsmParser::Lex · 670109d8
      Nirav Dave authored
      When an empty comment is present in an assembly file, the compiler will crash because it checks the first character for '\n' or '\r'.
      The fix consists of also checking if the string is empty before accessing the *front* method of the StringRef.
      A test is included for the x86 target, but this issue is reproducible with other targets as well.
      
      Patch by Alexandru Guduleasa!
      
      Reviewers: niravd, grosbach, llvm-commits
      
      Reviewed By: niravd
      
      Differential Revision: https://reviews.llvm.org/D33993
      
      llvm-svn: 305077
      670109d8
    • Alexey Bataev's avatar
      [DebugInfo] Fix comment, NFC. · 24f71018
      Alexey Bataev authored
      llvm-svn: 305076
      24f71018
    • Alexey Bataev's avatar
      [DebugInfo] Add kind of ImplicitParamDecl for emission of FlagObjectPointer. · 56223237
      Alexey Bataev authored
      Summary:
      If the first parameter of the function is the ImplicitParamDecl, codegen
      automatically marks it as an implicit argument with `this` or `self`
      pointer. Added internal kind of the ImplicitParamDecl to separate
      'this', 'self', 'vtt' and other implicit parameters from other kind of
      parameters.
      
      Reviewers: rjmccall, aaron.ballman
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D33735
      
      llvm-svn: 305075
      56223237
    • Krzysztof Parzyszek's avatar
      [Hexagon] Add LLVM header to HexagonPatterns.td · 78814155
      Krzysztof Parzyszek authored
      llvm-svn: 305074
      78814155
    • George Rimar's avatar
      [ELF] - Simplify gdb-index-empty.s · adaba7ae
      George Rimar authored
      Just simplifies existent test.
      
      Differential revision: https://reviews.llvm.org/D33986
      
      llvm-svn: 305073
      adaba7ae
    • Serge Rogatch's avatar
      [XRay] Fix computation of function size subject to XRay threshold · 85427c0d
      Serge Rogatch authored
      Summary:
      Currently XRay compares its threshold against `Function::size()` . However, `Function::size()` returns the number of basic blocks (as I understand, such as cycle bodies, if/else bodies, switch-case bodies, etc.), rather than the number of instructions.
      
      The name of the parameter `-fxray-instruction-threshold=N`, as well as XRay documentation at http://llvm.org/docs/XRay.html , suggests that instructions should be counted, rather than the number of basic blocks.
      
      I see two options:
      1. Count the number of MachineInstr`s in MachineFunction : this gives better  estimate for the number of assembly instructions on the target. So a user can check in disassembly that the threshold works more or less correctly.
      2. Count the number of Instruction`s in a Function : AFAIK, this gives correct number of IR instructions, which the user can check in IR listing. However, this number may be far (several times for small functions) from the number of assembly instructions finally emitted.
      
      Option 1 is implemented in this patch because I think that having the closer estimate for the number of assembly instructions emitted is more important than to have a clear definition of the metric.
      
      Reviewers: dberris, rengolin
      
      Reviewed By: dberris
      
      Subscribers: llvm-commits, iid_iunknown
      
      Differential Revision: https://reviews.llvm.org/D34027
      
      llvm-svn: 305072
      85427c0d
    • George Rimar's avatar
      [ELF] - Fix build bot. · af845f26
      George Rimar authored
      llvm-svn: 305071
      af845f26
    • Nirav Dave's avatar
      Prevent RemoveDeadNodes from deleted already deleted node. · 43a4d812
      Nirav Dave authored
      This prevents against assertion errors like PR32659 which occur from a
      replacement deleting a node after it's been added to the list argument
      of RemoveDeadNodes. The specific failure from PR32659 does not
      currently happen, but it is still potentially possible. The underlying
      cause is that the callers of the change dfunction builds up a list of
      nodes to delete after having moved their uses and it possible that a
      move of a later node will cause a previously deleted nodes to be
      deleted.
      
      Reviewers: bkramer, spatel, davide
      
      Reviewed By: spatel
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D33731
      
      llvm-svn: 305070
      43a4d812
    • George Rimar's avatar
      [ELF] - Allow producing -r output if only empty archive is given. · 1840901a
      George Rimar authored
      This is used by linux kernel build system.
      
      (https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt "3.2 Built-in object goals")
      
      It has for example next configuration for linking built-in.o files:
      drivers-y	:= $(patsubst %/, %/built-in.o, $(drivers-y))
      drivers-$(CONFIG_PCI)		+= arch/ia64/pci/
      ...
      drivers-$(CONFIG_OPROFILE)	+= arch/ia64/oprofile/
      
      Im most simple case all CONFIG_* options are off. That means linker is called with empty input archive, 
      emulation option and no inputs and expected to generate some relocatable output. 
      ld.bfd is able to do that, we dont.
      
      Patch allows to support this case.
      
      Differential revision: https://reviews.llvm.org/D33937
      
      llvm-svn: 305069
      1840901a
    • Nikolai Bozhenov's avatar
      Revert of r305066 "Reapply Frontend support for Nios2 target" · de57795c
      Nikolai Bozhenov authored
      llvm-svn: 305068
      de57795c
    • Roman Lebedev's avatar
      [clang-tools-extra] ReleaseNotes.rst: test commit: whitespace fix · 739b4839
      Roman Lebedev authored
      llvm-svn: 305067
      739b4839
    • Nikolai Bozhenov's avatar
      Reapply "Frontend support for Nios2 target" · b2de17c7
      Nikolai Bozhenov authored
      Summary:
      - Implements TargetInfo class for Nios2 target.
      - Enables handling of -march and -mcpu options for Nios2 target.
      - Definition of Nios2 builtin functions.
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D33356
      
      Author: belickim <mateusz.belicki@intel.com>
      llvm-svn: 305066
      b2de17c7
    • Peter Smith's avatar
      [ELF] Be more precise about Thumb state bit in ARM thunks · 28285576
      Peter Smith authored
      The symbols generated for Thunks have type STT_FUNC, to permit a thunk to
      be reused via a blx instruction the Thumb bit (0) needs to be set properly.
      
      Differential Revision: https://reviews.llvm.org/D34036
      
      llvm-svn: 305065
      28285576
    • Oliver Stannard's avatar
      [ARM] Add scheduling info for VFMS · ad097355
      Oliver Stannard authored
      The scalar VFMS instructions did not have scheduling information attached (but
      VFMA did), which was causing assertion failures with the Cortex-A57 scheduling
      model and -fp-contract=fast.
      
      Differential Revision: https://reviews.llvm.org/D34040
      
      llvm-svn: 305064
      ad097355
    • NAKAMURA Takumi's avatar
    • Pavel Labath's avatar
      Skip TestNoreturnUnwind on linux+clang+arm · 54d40503
      Pavel Labath authored
      I was over-eager to unable this test in r304976. It still fails in this
      combination, at there does not seem to be anything we can do about it,
      as the generated code does not preserve the link register.
      
      llvm-svn: 305062
      54d40503
    • Erik Verbruggen's avatar
      Speed up preamble loading · efe6fa50
      Erik Verbruggen authored
      Cache filename - SourceLocation pairs to speed up preamble loading and
      global completion. This is especially relevant for windows, where
      preamble loading takes a while.
      
      Patch by Ivan Donchevskii!
      
      Differential Revision: http://reviews.llvm.org/D33493
      
      llvm-svn: 305061
      efe6fa50
    • Siddharth Bhat's avatar
      [Polly] [ScopDetection] Allow passing multiple functions to `-polly-only-func`. · 286c916d
      Siddharth Bhat authored
      - This is useful to run optimisations on only certain functions.
      
      Differential Revision: https://reviews.llvm.org/D33990
      
      llvm-svn: 305060
      286c916d
    • Stefan Maksimovic's avatar
      Test commit: remove whitespace · add20f8f
      Stefan Maksimovic authored
      llvm-svn: 305059
      add20f8f
    • Maxim Ostapenko's avatar
      [asan] Fix ASan internal failure in AllocateFromLocalPool · d8c47ca8
      Maxim Ostapenko authored
      This patch addresses PR 33206. There might be a situation when dynamic ASan runtime initializes later
      than shared library which has malloc in static constructor (rtld doesn't provide an order of shared libs initialization).
      In this case ASan hasn't yet initialized interceptors, but already intercepts malloc.
      If malloc is too big to be handled by static local pool, ASan will die with error: 
      Sanitizer CHECK failed: lib/asan/asan_malloc_linux.cc:40 ((allocated_for_dlsym)) < ((kDlsymAllocPoolSize)) (1036, 1024)
      
      Patch by Denis Khalikov.
      
      Differential Revision: https://reviews.llvm.org/D33784
      
      llvm-svn: 305058
      d8c47ca8
    • Alexander Kornienko's avatar
    • David Blaikie's avatar
      bugpoint: disabling symbolication of bugpoint-executed programs · 4a60d370
      David Blaikie authored
      Initial implementation - needs similar work/testing for other tools
      bugpoint invokes (llc, lli I think, maybe more).
      
      Alternatively (as suggested by chandlerc@) an environment variable could
      be used. This would allow the option to pass transparently through user
      scripts, pass to compilers if they happened to be LLVM-ish, etc.
      
      I worry a bit about using cl::opt in the crash handling code - LLVM
      might crash early, perhaps before the cl::opt is properly initialized?
      Or at least before arguments have been parsed?
      
       - should be OK since it defaults to "pretty", so if the crash is very
       early in opt parsing, etc, then crash reports will still be symbolized.
      
      I shyed away from doing this with an environment variable when I
      realized that would require copying the existing environment and
      appending the env variable of interest. But it seems there's no existing
      LLVM API for accessing the environment (even the Support tests for
      process launching have their own ifdefs for getting the environment). It
      could be added, but seemed like a higher bar/untested codepath to
      actually add environment variables.
      
      Most importantly, this reduces the runtime of test/BugPoint/metadata.ll
      in a split-dwarf Debug build from 1m34s to 6.5s by avoiding a lot of
      symbolication. (this wasn't a problem for non-split-dwarf builds only
      because the executable was too large to map into memory (due to bugpoint
      setting a 400MB memory (including address space - not sure why? Going to
      remove that) limit on the child process) so symbolication would fail
      fast & wouldn't spend all that time parsing DWARF, etc)
      
      Reviewers: chandlerc, dannyb
      
      Differential Revision: https://reviews.llvm.org/D33804
      
      llvm-svn: 305056
      4a60d370
    • Serguei Katkov's avatar
      [IndVars] Add an option to be able to disable LFTR · 38414b57
      Serguei Katkov authored
      This change adds an option disable-lftr to be able to disable Linear Function Test Replace optimization.
      By default option is off so current behavior is not changed.
      
      Reviewers: reames, sanjoy, wmi, andreadb, apilipenko
      Reviewed By: sanjoy
      Subscribers: llvm-commits
      Differential Revision: https://reviews.llvm.org/D33979
      
      llvm-svn: 305055
      38414b57
    • George Rimar's avatar
      [ELF] - Fix build bot. · b4b7b74b
      George Rimar authored
      SyntheticSections.cpp:1773:29: error: chosen constructor is explicit in copy-initialization
              CuVectors.push_back({});
                                  ^~
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/set:428:14: note: constructor declared here
          explicit set(const value_compare& __comp = value_compare())
                   ^
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:702:59: note: passing argument to parameter '__x' here
          _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
      
      llvm-svn: 305054
      b4b7b74b
    • George Burgess IV's avatar
      [LoopVectorize] Don't preserve nsw/nuw flags on shrunken ops. · a20352e1
      George Burgess IV authored
      If we're shrinking a binary operation, it may be the case that the new
      operations wraps where the old didn't. If this happens, the behavior
      should be well-defined. So, we can't always carry wrapping flags with us
      when we shrink operations.
      
      If we do, we get incorrect optimizations in cases like:
      
      void foo(const unsigned char *from, unsigned char *to, int n) {
        for (int i = 0; i < n; i++)
          to[i] = from[i] - 128;
      }
      
      which gets optimized to:
      
      void foo(const unsigned char *from, unsigned char *to, int n) {
        for (int i = 0; i < n; i++)
          to[i] = from[i] | 128;
      }
      
      Because:
      - InstCombine turned `sub i32 %from.i, 128` into
        `add nuw nsw i32 %from.i, 128`.
      - LoopVectorize vectorized the add to be `add nuw nsw <16 x i8>` with a
        vector full of `i8 128`s
      - InstCombine took advantage of the fact that the newly-shrunken add
        "couldn't wrap", and changed the `add` to an `or`.
      
      InstCombine seems happy to figure out whether we can add nuw/nsw on its
      own, so I just decided to drop the flags. There are already a number of
      places in LoopVectorize where we rely on InstCombine to clean up.
      
      llvm-svn: 305053
      a20352e1
    • David Blaikie's avatar
      Inliner: Don't touch indirect calls · cb9327b0
      David Blaikie authored
      Other comments/implications are that this isn't intended behavior (nor
      perserved/reimplemented in the new inliner) & complicates fixing the
      'inlining' of trivially dead calls without consulting the cost function
      first.
      
      llvm-svn: 305052
      cb9327b0
    • Rui Ueyama's avatar
      Fix -Wunused-variable. · 365d4d00
      Rui Ueyama authored
      llvm-svn: 305051
      365d4d00
    • Craig Topper's avatar
      [llvm-pdbdump] Fix -Wpessimizing-move warnings. · 84166788
      Craig Topper authored
      llvm-svn: 305050
      84166788
    • Craig Topper's avatar
      [InstCombine] Pass a proper context instruction to all of the calls into InstSimplify · a4205622
      Craig Topper authored
      Summary: This matches the behavior we already had for compares and makes us consistent everywhere.
      
      Reviewers: dberlin, hfinkel, spatel
      
      Reviewed By: dberlin
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D33604
      
      llvm-svn: 305049
      a4205622
    • Rui Ueyama's avatar
      Simplify. NFC. · f08b38cb
      Rui Ueyama authored
      llvm-svn: 305048
      f08b38cb
Loading