Skip to content
  1. Feb 07, 2017
  2. Feb 06, 2017
    • Jonathan Coe's avatar
      [clang-tidy] safety-no-assembler · 3032d3c3
      Jonathan Coe authored
      Summary:
      Add a new clang-tidy module for safety-critical checks.
      
      Include a check for inline assembler.
      
      Reviewers: Prazek, dtarditi, malcolm.parsons, alexfh, aaron.ballman, idlecode
      
      Reviewed By: idlecode
      
      Subscribers: idlecode, JonasToth, Eugene.Zelenko, mgorny, JDevlieghere, cfe-commits
      
      Tags: #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D29267
      
      llvm-svn: 294255
      3032d3c3
    • Simon Pilgrim's avatar
      [X86][SSE] Tests showing the lowering of float/double complex multiplications... · a93c7738
      Simon Pilgrim authored
      [X86][SSE] Tests showing the lowering of float/double complex multiplications with fastmath (PR31866)
      
      llvm-svn: 294254
      a93c7738
    • Rui Ueyama's avatar
      Change the return type of getImplicitAddend to signed integer. · 640724c1
      Rui Ueyama authored
      If relocations don't have addends, addends are embedded in operands.
      getImplicitAddend is a function to read addends. Addends can be
      negative numbers, so the return type of the function should be a
      signed integer type.
      
      llvm-svn: 294253
      640724c1
    • Rafael Espindola's avatar
      Handle symbol assignments before the first section switch. · 06f4743a
      Rafael Espindola authored
      We now create a dummy section with index 1 before processing the
      linker script.
      
      Thanks to George Rimar for finding the bug and providing the initial
      testcase.
      
      llvm-svn: 294252
      06f4743a
    • Paul Robinson's avatar
      Merge DebugLoc on combined stores; in this case, when combining stores · 383c5c22
      Paul Robinson authored
      from the end of two blocks, merge instead of arbitrarily picking one.
      
      Differential Revision: http://reviews.llvm.org/D29504
      
      llvm-svn: 294251
      383c5c22
    • Taewook Oh's avatar
      [GVNHoist] Merge DebugLoc metadata on hoisted instructions · 44a856f7
      Taewook Oh authored
      Summary:
      When instructions are hoisted, current implementation keeps DebugLoc metadata of the instruction that chosen as Repl (and its GEP operand if Repl is a load or a store). However, DebugLoc metadata should be updated to the 'merged' location across all hoisted instructions. See the following example code:
      
      
      ```
        1:  typedef struct {
        2:    int a[10];
        3:  } S1;
        4: 
        5:  extern S1 *s1[10];
        6: 
        7:  void foo(int x, int y, int i) {
        8:    if (y)
        9:      s1[i]->a[i] = x + y;
       10:    else
       11:      s1[i]->a[i] = x;
       12:  }
      ```
      
      Below is LLVM IR representation of the program before gvn-hoist:
      
      
      ```
      %struct.S1 = type { [10 x i32] }
      @s1 = external local_unnamed_addr global [10 x %struct.S1*], align 16
      
      define void @foo(i32 %x, i32 %y, i32 %i) !dbg !4 {
      entry:
        %tobool = icmp ne i32 %y, 0, !dbg !8
        br i1 %tobool, label %if.then, label %if.else, !dbg !10
      
      if.then:                                          ; preds = %entry
        %add = add nsw i32 %x, %y, !dbg !11
        %idxprom = sext i32 %i to i64, !dbg !12
        %arrayidx = getelementptr inbounds [10 x %struct.S1*], [10 x %struct.S1*]* @s1, i64 0, i64 %idxprom, !dbg !12
        %0 = load %struct.S1*, %struct.S1** %arrayidx, align 8, !dbg !12, !tbaa !13
        %a = getelementptr inbounds %struct.S1, %struct.S1* %0, i32 0, i32 0, !dbg !17
        br label %if.end, !dbg !12
      
      if.else:                                          ; preds = %entry
        %idxprom3 = sext i32 %i to i64, !dbg !18
        %arrayidx4 = getelementptr inbounds [10 x %struct.S1*], [10 x %struct.S1*]* @s1, i64 0, i64 %idxprom3, !dbg !18
        %1 = load %struct.S1*, %struct.S1** %arrayidx4, align 8, !dbg !18, !tbaa !13
        %a5 = getelementptr inbounds %struct.S1, %struct.S1* %1, i32 0, i32 0, !dbg !19
        br label %if.end
      
      if.end:                                           ; preds = %if.else, %if.then
        %a5.sink = phi [10 x i32]* [ %a5, %if.else ], [ %a, %if.then ]
        %.sink = phi i32 [ %x, %if.else ], [ %add, %if.then ]
        %idxprom6 = sext i32 %i to i64
        %arrayidx7 = getelementptr inbounds [10 x i32], [10 x i32]* %a5.sink, i64 0, i64 %idxprom6
        store i32 %.sink, i32* %arrayidx7, align 4, !tbaa !20
        ret void, !dbg !22
      }
      
      ```
      where
      
      
      ```
      !11 = !DILocation(line: 9, column: 18, scope: !9)
      !12 = !DILocation(line: 9, column: 5, scope: !9)
      !18 = !DILocation(line: 11, column: 5, scope: !9)
      !19 = !DILocation(line: 11, column: 9, scope: !9)
      ```
      
      . And below is after gvn-hoist:
      
      
      ```
      define void @foo(i32 %x, i32 %y, i32 %i) !dbg !4 {
      entry:
        %tobool = icmp ne i32 %y, 0, !dbg !8
        %idxprom = sext i32 %i to i64, !dbg !10
        %0 = getelementptr inbounds [10 x %struct.S1*], [10 x %struct.S1*]* @s1, i64 0, i64 %idxprom, !dbg !10
        %1 = load %struct.S1*, %struct.S1** %0, align 8, !dbg !10, !tbaa !11
        br i1 %tobool, label %if.then, label %if.else, !dbg !15
      
      if.then:                                          ; preds = %entry
        %add = add nsw i32 %x, %y, !dbg !16
        %arrayidx = getelementptr inbounds [10 x %struct.S1*], [10 x %struct.S1*]* @s1, i64 0, i64 %idxprom, !dbg !10
        %a = getelementptr inbounds %struct.S1, %struct.S1* %1, i32 0, i32 0, !dbg !17
        br label %if.end, !dbg !10
      
      if.else:                                          ; preds = %entry
        %arrayidx4 = getelementptr inbounds [10 x %struct.S1*], [10 x %struct.S1*]* @s1, i64 0, i64 %idxprom, !dbg !18
        %a5 = getelementptr inbounds %struct.S1, %struct.S1* %1, i32 0, i32 0, !dbg !19
        br label %if.end
      
      if.end:                                           ; preds = %if.else, %if.then
        %a5.sink = phi [10 x i32]* [ %a5, %if.else ], [ %a, %if.then ]
        %.sink = phi i32 [ %x, %if.else ], [ %add, %if.then ]
        %arrayidx7 = getelementptr inbounds [10 x i32], [10 x i32]* %a5.sink, i64 0, i64 %idxprom
        store i32 %.sink, i32* %arrayidx7, align 4, !tbaa !20
        ret void, !dbg !22
      }
      
      ```
      As you see, loads and their GEPs have been hosited from if.then/if.else block to entry block. However, DebugLoc metadata of these new instructions are still same as the instructions in if.then block, as they are moved/cloned from if.then block. This may result incorrect stepping and imprecise sample profile result.
      
      Reviewers: majnemer, pcc, sebpop
      
      Reviewed By: sebpop
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D29377
      
      llvm-svn: 294250
      44a856f7
    • Tim Northover's avatar
      GlobalISel: fall back gracefully when we can't map an operand's size. · 6f2db57d
      Tim Northover authored
      AArch64 was asserting when it was asked to provide a register-bank of a size it
      couldn't deal with (in this case an s128 IMPLICIT_DEF). But we want a robust
      fallback path so this isn't allowed.
      
      llvm-svn: 294248
      6f2db57d
    • Tim Northover's avatar
      GlobalISel: legalize G_INSERT instructions · 0e6afbdd
      Tim Northover authored
      We don't handle all cases yet (see arm64-fallback.ll for an example), but this
      is enough to cover most common C++ code so it's a good place to start.
      
      llvm-svn: 294247
      0e6afbdd
    • Eugene Zelenko's avatar
      [X86] Fix some Include What You Use warnings; other minor fixes (NFC). · 90562dfb
      Eugene Zelenko authored
      This is preparation to reduce MCExpr.h dependencies.(vlsj-clangbuild)[622]
      
      llvm-svn: 294246
      90562dfb
    • Michael Kuperstein's avatar
      [SLP] Revert "Allow using of extra values in horizontal reductions." · 7a86bb25
      Michael Kuperstein authored
      This breaks when one of the extra values is also a scalar that
      participates in the same vectorization tree which we'll end up
      reducing.
      
      llvm-svn: 294245
      7a86bb25
    • Pavel Labath's avatar
      Remove verbose category in the kdp channel · 250858a0
      Pavel Labath authored
      llvm-svn: 294244
      250858a0
    • Pavel Labath's avatar
      Switch PlatformLinux to LLDB_LOG · 0e92fbb5
      Pavel Labath authored
      llvm-svn: 294243
      0e92fbb5
    • Chandler Carruth's avatar
      [SCEV] Scale back the test added in r294181 as it goes quadratic in · cd07efc7
      Chandler Carruth authored
      SCEV.
      
      This test was immediately the slowest test in 'check-llvm' even in an
      optimized build and was driving up the total test time by 50% for me.
      
      Sanjoy has filed a PR about the quadratic behavior in SCEV but it is
      also concerning that the test still passes given that r294181 added
      a threshold at 32 to SCEV. I've followed up on the original patch to
      figure out how this test should work long-term, but for now I want to
      get check-llvm to be fast again.
      
      llvm-svn: 294241
      cd07efc7
    • Peter Collingbourne's avatar
      IR: Consider two DISubprograms to be odr-equal if they have the same template parameters. · e69e73c7
      Peter Collingbourne authored
      In ValueMapper we create new operands for MDNodes and
      rely on MDNode::replaceWithUniqued to create a new MDNode
      with the specified operands. However this doesn't always
      actually happen correctly for DISubprograms because when we
      uniquify the new node, we only odr-compare it with existing nodes
      (MDNodeSubsetEqualImpl<DISubprogram>::isDeclarationOfODRMember). Although
      the TemplateParameters field can refer to a distinct DICompileUnit via
      DITemplateTypeParameter::type -> DICompositeType::scope -> DISubprogram::unit,
      it is not currently included in the odr comparison. As a result, we can end
      up getting our original DISubprogram back, which means we will have a cloned
      module referring to the DICompileUnit in the original module, which causes
      a verification error.
      
      The fix I implemented was to consider TemplateParameters to be one of the
      odr-equal properties. But I'm a little uncomfortable with this. In general it
      seems unsound to rely on distinct MDNodes never being reachable from nodes
      which we only check odr-equality of. My only long term suggestion would be
      to separate odr-uniquing from full uniquing.
      
      Differential Revision: https://reviews.llvm.org/D29240
      
      llvm-svn: 294240
      e69e73c7
    • Kostya Serebryany's avatar
      [libFuzzer] make code less clever to avoid fallthrough in switch (and in turn... · c24ec323
      Kostya Serebryany authored
      [libFuzzer] make code less clever to avoid fallthrough in switch (and in turn avoid compiler warnings). NFC. Suggested by Christian Holler.
      
      llvm-svn: 294239
      c24ec323
    • Rui Ueyama's avatar
      Attempt to fix a flakey test. · a5ed3226
      Rui Ueyama authored
      I believe that the test is flakey because the order of stdout
      and stderr is not deterministic.
      
      llvm-svn: 294238
      a5ed3226
    • Kevin Enderby's avatar
      Fix a bug in llvm-obdump(1) with the -macho and -info-plist options · 418659fe
      Kevin Enderby authored
      which caused it to print more than the (__TEXT,__info_plist) if that
      section did not end with a null.
      
      rdar://27378808
      
      llvm-svn: 294236
      418659fe
    • Chandler Carruth's avatar
      a80cfb30
    • Rui Ueyama's avatar
      Add an option to use the MSVC linker to link LTO-generated object files. · 1e0b158d
      Rui Ueyama authored
      This patch defines a new command line option, /MSVCLTO, to LLD.
      If that option is given, LLD invokes link.exe to link LTO-generated
      object files. This is hacky but useful because link.exe can create
      PDB files.
      
      Differential Revision: https://reviews.llvm.org/D29526
      
      llvm-svn: 294234
      1e0b158d
    • David Blaikie's avatar
      Get function start line number from DWARF info · efc4eba8
      David Blaikie authored
      DWARF info contains info about the line number at which a function starts (DW_AT_decl_line).
      
      This patch creates a function to look up the start line number for a function, and returns it in
      DILineInfo when looking up debug info for a particular address.
      
      Patch by Simon Que!
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D27962
      
      llvm-svn: 294231
      efc4eba8
    • Jon Chesterfield's avatar
      [TableGen] Use less stack in DAGISelMatcherOpt · 1b4eed4c
      Jon Chesterfield authored
      Refactor a helper function, FactorNodes, to search for a push node in constant space. This resolves a problem in a not-yet-upstreamed backend where a recursive pattern blew the call stack (at a depth of 255) under a debug build of tablegen. No functional change so no new test coverage. The change is minimal to avoid disturbing existing behaviour.
      
      Differential Revision: https://reviews.llvm.org/D29080
      
      llvm-svn: 294230
      1b4eed4c
    • Jon Chesterfield's avatar
      Revert r294228 · 3746deb9
      Jon Chesterfield authored
      llvm-svn: 294229
      3746deb9
    • Jon Chesterfield's avatar
      Test commit access · 88f524a6
      Jon Chesterfield authored
      llvm-svn: 294228
      88f524a6
    • Chandler Carruth's avatar
      [PM/LCG] Remove the lazy RefSCC formation from the LazyCallGraph during · 2e0fe3e6
      Chandler Carruth authored
      iteration.
      
      The lazy formation of RefSCCs isn't really the most important part of
      the laziness here -- that has to do with walking the functions
      themselves -- and isn't essential to maintain. Originally, there were
      incremental update algorithms that relied on updates happening
      predominantly near the most recent RefSCC formed, but those have been
      replaced with ones that have much tighter general case bounds at this
      point. We do still perform asserts that only scale well due to this
      incrementality, but those are easy to place behind EXPENSIVE_CHECKS.
      
      Removing this simplifies the entire analysis by having a single up-front
      step that builds all of the RefSCCs in a direct Tarjan walk. We can even
      easily replace this with other or better algorithms at will and with
      much less confusion now that there is no iterator-based incremental
      logic involved. This removes a lot of complexity from LCG.
      
      Another advantage of moving in this direction is that it simplifies
      testing the system substantially as we no longer have to worry about
      observing and mutating the graph half-way through the RefSCC formation.
      
      We still need a somewhat special iterator for RefSCCs because we want
      the iterator to remain stable in the face of graph updates. However,
      this now merely involves relative indexing to the current RefSCC's
      position in the sequence which isn't too hard.
      
      Differential Revision: https://reviews.llvm.org/D29381
      
      llvm-svn: 294227
      2e0fe3e6
    • Krzysztof Parzyszek's avatar
      [Hexagon] Update MCTargetDesc · 8cdfe8ec
      Krzysztof Parzyszek authored
      Changes include:
      - Updates to the instruction descriptor flags.
      - Improvements to the packet shuffler and checker.
      - Updates to the handling of certain relocations.
      - Better handling of duplex instructions.
      
      llvm-svn: 294226
      8cdfe8ec
    • Charles Li's avatar
      [Lit Test] Make tests C++11 compatible - Microsoft diagnostics · 11d0b8df
      Charles Li authored
      Differential Revision: https://reviews.llvm.org/D29520
      
      llvm-svn: 294225
      11d0b8df
    • Pavel Labath's avatar
      Remove the verbose category in the gdb-remote channel · e8a7b984
      Pavel Labath authored
      replace by LLDB_LOGV
      
      llvm-svn: 294224
      e8a7b984
    • Pavel Labath's avatar
      Remove the verbose category in the posix channel · aafe053c
      Pavel Labath authored
      replace by LLDB_LOGV
      
      llvm-svn: 294223
      aafe053c
    • Pavel Labath's avatar
      Fix darwin build (error.PutToLog fallout) · 2f8d5739
      Pavel Labath authored
      llvm-svn: 294222
      2f8d5739
    • Pavel Labath's avatar
      Fix darwin build (llvm::once_flag fallout) · 60199c1a
      Pavel Labath authored
      llvm-svn: 294221
      60199c1a
    • Pavel Labath's avatar
      Remove the verbose category in the dwarf channel · 62c3545e
      Pavel Labath authored
      llvm-svn: 294219
      62c3545e
    • Simon Pilgrim's avatar
    • Pavel Labath's avatar
      Really fix build on non-windows platforms :) · 0c7687b1
      Pavel Labath authored
      llvm-svn: 294215
      0c7687b1
Loading