Skip to content
  1. Dec 11, 2018
    • Heejin Ahn's avatar
      [WebAssembly] TargetStreamer cleanup (NFC) · 21d45a2c
      Heejin Ahn authored
      Summary:
      - Unify mixed argument names (`Symbol` and `Sym`) to `Sym`
      - Changed `MCSymbolWasm*` argument of `emit***` functions to `const
        MCSymbolWasm*`. It seems not very intuitive that emit function in the
        streamer modifies symbol contents.
      - Moved empty function bodies to the header
      - clang-format
      
      Reviewers: aardappel, dschuff, sbc100
      
      Subscribers: jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D55347
      
      llvm-svn: 348816
      21d45a2c
    • Aditya Nandakumar's avatar
      [GISel]: Refactor MachineIRBuilder to allow passing additional parameters to build Instrs · cef44a23
      Aditya Nandakumar authored
      https://reviews.llvm.org/D55294
      
      Previously MachineIRBuilder::buildInstr used to accept variadic
      arguments for sources (which were either unsigned or
      MachineInstrBuilder). While this worked well in common cases, it doesn't
      allow us to build instructions that have multiple destinations.
      Additionally passing in other optional parameters in the end (such as
      flags) is not possible trivially. Also a trivial call such as
      
      B.buildInstr(Opc, Reg1, Reg2, Reg3)
      can be interpreted differently based on the opcode (2defs + 1 src for
      unmerge vs 1 def + 2srcs).
      This patch refactors the buildInstr to
      
      buildInstr(Opc, ArrayRef<DstOps>, ArrayRef<SrcOps>)
      where DstOps and SrcOps are typed unions that know how to add itself to
      MachineInstrBuilder.
      After this patch, most invocations would look like
      
      B.buildInstr(Opc, {s32, DstReg}, {SrcRegs..., SrcMIBs..});
      Now all the other calls (such as buildAdd, buildSub etc) forward to
      buildInstr. It also makes it possible to build instructions with
      multiple defs.
      Additionally in a subsequent patch, we should make it possible to add
      flags directly while building instructions.
      Additionally, the main buildInstr method is now virtual and other
      builders now only have to override buildInstr (for say constant
      folding/cseing) is straightforward.
      
      Also attached here (https://reviews.llvm.org/F7675680) is a clang-tidy
      patch that should upgrade the API calls if necessary.
      
      llvm-svn: 348815
      cef44a23
    • David Blaikie's avatar
      Follow-up fix to r348811 for null Errors (which is the case for end iterators) · a041679d
      David Blaikie authored
      Not sure how I missed that in my testing, but obvious enough - this
      causes segfaults when attempting to dereference the Error in end
      iterators.
      
      llvm-svn: 348814
      a041679d
    • Zachary Turner's avatar
      Fix undefined behavior in Variable.h · 9d76e420
      Zachary Turner authored
      m_loc_is_constant_data was uninitialized, so unless someone
      explicitly called SetLocIsConstantData(), this would be UB.
      
      I think every existing call-site would always call the proper
      function to initialize the value, so there were no existing
      bugs, but I encountered this when I tried to use it without
      calling this function and encountered this.
      
      llvm-svn: 348813
      9d76e420
    • Eric Fiselier's avatar
      Add a version of std::function that includes a few optimizations in ABI V2. · 08e231dd
      Eric Fiselier authored
      Patch by Jordan Soyke (jsoyke@google.com)
      Reviewed as D55045
      
      The result of running the benchmarks and comparing them can be found
      here: https://gist.github.com/EricWF/a77fd42ec87fc98da8039e26d0349498
      
      llvm-svn: 348812
      08e231dd
    • David Blaikie's avatar
      llvm-objcopy: Improve/simplify llvm::Error handling during notes iteration · ba005aa4
      David Blaikie authored
      Using an Error as an out parameter from an indirect operation like
      iteration as described in the documentation (
      http://llvm.org/docs/ProgrammersManual.html#building-fallible-iterators-and-iterator-ranges
      ) seems to be a little fussy - so here's /one/ possible solution, though
      I'm not sure it's the right one.
      
      Alternatively such APIs may be better off being switched to a standard
      algorithm style, where they take a lambda to do the iteration work that
      is then called back into (eg: "Error e = obj.for_each_note([](const
      Note& N) { ... });"). This would be safer than having an unwritten
      assumption that the user of such an iteration cannot return early from
      the inside of the function - and must always exit through the gift
      shop... I mean error checking. (even though it's guaranteed that if
      you're mid-way through processing an iteration, it's not in an  error
      state).
      
      Alternatively we'd need some other (the super untrustworthy/thing we've
      generally tried to avoid) error handling primitive that actually clears
      the error state entirely so it's safe to ignore.
      
      Fleshed this solution out a bit further during review - it now relies on
      op==/op!= comparison as the equivalent to "if (Err)" testing the Error.
      So just like an Error must be checked (even if it's in a success state),
      the Error hiding in the iterator must be checked after each increment
      (including by comparison with another iterator - perhaps this could be
      constrained to only checking if the iterator is compared to the end
      iterator? Not sure it's too important).
      
      So now even just creating the iterator and not incrementing it at all
      should still assert because the Error has not been checked.
      
      Reviewers: lhames, jakehehrlich
      
      Differential Revision: https://reviews.llvm.org/D55235
      
      llvm-svn: 348811
      ba005aa4
    • Shafik Yaghmour's avatar
    • Matt Arsenault's avatar
      Update test for instcombine change · 6242a39d
      Matt Arsenault authored
      llvm-svn: 348809
      6242a39d
  2. Dec 10, 2018
Loading