1. Mar 24, 2020
  2. Mar 23, 2020
    • Chris Lattner's avatar
      Add support for custom op parser/printer hooks to know about result names. · 596da62d
      Chris Lattner authored
      Summary:
      This allows the custom parser/printer hooks to do interesting things with
      the SSA names.  This patch:
      
       - Adds a new 'getResultName' method to OpAsmParser that allows a parser
         implementation to get information about its result names, along with
         a getNumResults() method that allows op parser impls to know how many
         results are expected.
       - Adds a OpAsmPrinter::printOperand overload that takes an explicit stream.
       - Adds a test.string_attr_pretty_name operation that uses these hooks to
         do fancy things with the result name.
      
      Reviewers: rriddle!
      
      Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D76205
      596da62d
    • Reid Kleckner's avatar
      [Win64] Insert int3 into trailing empty BBs · 5ff5ddd0
      Reid Kleckner authored
      Otherwise, the Win64 unwinder considers direct branches to such empty
      trailing BBs to be a branch out of the function. It treats such a branch
      as a tail call, which can only be part of an epilogue. If the unwinder
      misclassifies such a branch as part of the epilogue, it will fail to
      unwind the stack further. This can lead to bad stack traces, or failure
      to handle exceptions properly. This is described in
      https://llvm.org/PR45064#c4, and by the comment at the top of the
      X86AvoidTrailingCallPass.cpp file.
      
      It should be safe to insert int3 for such blocks. An empty trailing BB
      that reaches this pass is pretty much guaranteed to be unreachable.  If
      a program executed such a block, it would fall off the end of the
      function.
      
      Most of the complexity in this patch comes from threading through the
      "EHFuncletEntry" boolean on the MIRParser and registering the pass so we
      can stop and start codegen around it. I used an MIR test because we
      should teach LLVM to optimize away these branches as a follow-up.
      
      Reviewed By: hans
      
      Differential Revision: https://reviews.llvm.org/D76531
      5ff5ddd0
    • Sanjay Patel's avatar
      [Analysis] simplify code for scaleShuffleMask · ebf83c36
      Sanjay Patel authored
      This is NFC-ish. The results should be identical, but perf is hopefully
      better with the fast-path for no scaling. Added a unit test for that.
      
      The code is adapted from what used to be the DAGCombiner equivalent
      function before D76508 (rG0eeee83d).
      ebf83c36