Skip to content
  1. Jan 31, 2022
  2. Jan 30, 2022
    • Mircea Trofin's avatar
      [mlgo][regalloc] Fix register masking · a8a7bf92
      Mircea Trofin authored
      If AllocationOrder has less than 32 elements, we were treating the extra
      positions as if they were valid. This was detected by a subsequent
      assert. The fix also tightens the asserts.
      a8a7bf92
    • Markus Böck's avatar
      [Support][NFC] Fix generic `ChildrenGetterTy` of `IDFCalculatorBase` · e0b11c76
      Markus Böck authored
      Both IDFCalculatorBase and its accompanying DominatorTreeBase only supports pointer nodes. The template argument is the block type itself and any uses of GraphTraits is therefore done via a pointer to the node type.
      However, the ChildrenGetterTy type of IDFCalculatorBase has a use on just the node type instead of a pointer to the node type. Various parts of the monorepo has worked around this issue by providing specializations of GraphTraits for the node type directly, or not been affected by using specializations instead of the generic case. These are unnecessary however and instead the generic code should be fixed instead.
      
      An example from within Tree is eg. A use of IDFCalculatorBase in InstrRefBasedImpl.cpp. It basically instantiates a IDFCalculatorBase<MachineBasicBlock, false> but due to the bug above then goes on to specialize GraphTraits<MachineBasicBlock> although GraphTraits<MachineBasicBlock*> exists (and should be used instead).
      
      Similar dead code exists in clang which defines redundant GraphTraits to work around this bug.
      
      This patch fixes both the original issue and removes the dead code that was used to work around the issue.
      
      Differential Revision: https://reviews.llvm.org/D118386
      e0b11c76
    • Kazu Hirata's avatar
      [CodeGen] Use default member initialization (NFC) · 2bea207d
      Kazu Hirata authored
      Identified with modernize-use-default-member-init.
      2bea207d
  3. Jan 29, 2022
  4. Jan 28, 2022
    • Fangrui Song's avatar
      [lld] Add module name to LTO inline asm diagnostic · 33b38339
      Fangrui Song authored
      Close #52781: for LTO, the inline asm diagnostic uses `<inline asm>` as the file
      name (lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp) and it is unclear which
      module has the issue.
      
      With this patch, we will see the module name (say `asm.o`) before `<inline asm>` with ThinLTO.
      
      ```
      % clang -flto=thin -c asm.c && myld.lld asm.o -e f
      ld.lld: error: asm.o <inline asm>:1:2: invalid instruction mnemonic 'invalid'
              invalid
              ^~~~~~~
      ```
      
      For regular LTO, unfortunately the original module name is lost and we only get
      ld-temp.o.
      
      Reviewed By: #lld-macho, ychen, Jez Ng
      
      Differential Revision: https://reviews.llvm.org/D118434
      33b38339
    • Cullen Rhodes's avatar
      [DAGCombiner] Fix invalid size request in combineRepeatedFPDivisors · 5d089d9a
      Cullen Rhodes authored
      If we have a vector FP division with a splatted divisor, use
      getVectorMinNumElements when scaling the num of uses by splat factor.
      
      For AArch64 the combine kicks in for the <vscale x 4 x float> case since it's
      above the fdiv threshold (3) when scaling num uses by splat factor, but the
      codegen is worse (splat + vector fdiv + vector fmul) than the <vscale x 2 x
      double> case (splat + vector fdiv).
      
      If the combine could be converted into a scalar FP division by
      scalarizeBinOpOfSplats it may be cheaper, but it looks like this is predicated
      on the isExtractVecEltCheap TLI function which is implemented for x86 but not
      AArch64. Perhaps for now combineRepeatedFPDivisors should only scale num uses
      by splat if the division can be converted into scalar op.
      
      Reviewed By: sdesmalen
      
      Differential Revision: https://reviews.llvm.org/D118343
      5d089d9a
    • Jeremy Morse's avatar
      [MVerifier] Don't check liveness of any debug instruction operands · 76fd78b4
      Jeremy Morse authored
      Shiny new DBG_PHI instruction usually have physical registers as operands
      -- however, the machine verifier checks to see whether they're live, and
      occasionally this fails. There's a filter for DBG_VALUE instructions to not
      get verified in this way: expand it to exempt all debug instructions from
      liveness checking, which means DBG_PHIs get treated like DBG_VALUEs.
      
      This also future proofs against us adding new debug instructions.
      
      Differential Revision: https://reviews.llvm.org/D117891
      76fd78b4
    • Martin Storsjö's avatar
      [CodeGen] Emit COFF symbol type for function aliases · f7d2afba
      Martin Storsjö authored
      On the level of the generated object files, both symbols (both
      original and alias) are generally indistinguishable - both are
      regular defined symbols. But previously, only the original
      function had the COFF ComplexType set to IMAGE_SYM_DTYPE_FUNCTION,
      while the symbol created via an alias had the type set to
      IMAGE_SYM_DTYPE_NULL.
      
      This matches what GCC does, which emits directives for setting the
      COFF symbol type for this kind of alias symbol too.
      
      This makes a difference when GNU ld.bfd exports symbols without
      dllexport directives or a def file - it seems to decide between
      function or data exports based on the COFF symbol type. This means
      that functions created via aliases, like some C++ constructors,
      are exported as data symbols (missing the thunk for calling without
      dllimport).
      
      The hasnt been an issue when doing the same with LLD, as LLD decides
      between function or data export based on the flags of the section
      that the symbol points at.
      
      This should fix the root cause of
      https://github.com/msys2/MINGW-packages/issues/10547.
      
      Differential Revision: https://reviews.llvm.org/D118328
      f7d2afba
    • Ellis Hoag's avatar
      [InstrProf] Add single byte coverage mode · 11d30742
      Ellis Hoag authored
      Use the llvm flag `-pgo-function-entry-coverage` to create single byte "counters" to track functions coverage. This mode has significantly less size overhead in both code and data because
        * We mark a function as "covered" with a store instead of an increment which generally requires fewer assembly instructions
        * We use a single byte per function rather than 8 bytes per block
      
      The trade off of course is that this mode only tells you if a function has been covered. This is useful, for example, to detect dead code.
      
      When combined with debug info correlation [0] we are able to create an instrumented Clang binary that is only 150M (the vanilla Clang binary is 143M). That is an overhead of 7M (4.9%) compared to the default instrumentation (without value profiling) which has an overhead of 31M (21.7%).
      
      [0] https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4
      
      Reviewed By: kyulee
      
      Differential Revision: https://reviews.llvm.org/D116180
      11d30742
  5. Jan 27, 2022
    • Simon Pilgrim's avatar
      [DAG] SelectionDAG::getNode(N1,N2) - detect N2 constant vector splats as well as scalars · fdd3e2c9
      Simon Pilgrim authored
      We already perform some basic folds (add/sub with zero etc.) on scalar types, this patch adds some basic support for constant splats as well in a few cases (we can add more with future test coverage).
      
      In the cases I've enabled, we can handle buildvector implicit truncation as we're not creating new constant nodes from the vector types - we're just returning existing nodes. This allows us to get a number of extra cases in the aarch64 tests.
      
      I haven't enabled support for undefs in buildvector splats, as we're often checking for zero/allones patterns that return the original constant and we shouldn't be returning undef elements in some of these cases - we can enable this later if we're OK with creating new constants.
      
      Differential Revision: https://reviews.llvm.org/D118264
      fdd3e2c9
    • Fraser Cormack's avatar
      [SelectionDAG][VP] Provide expansion for VP_MERGE · 84e85e02
      Fraser Cormack authored
      This patch adds support for expanding VP_MERGE through a sequence of
      vector operations producing a full-length mask setting up the elements
      past EVL/pivot to be false, combining this with the original mask, and
      culminating in a full-length vector select.
      
      This expansion should work for any data type, though the only use for
      RVV is for boolean vectors, which themselves rely on an expansion for
      the VSELECT.
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D118058
      84e85e02
  6. Jan 26, 2022
  7. Jan 25, 2022
Loading