Skip to content
  1. Apr 06, 2021
    • Florian Hahn's avatar
      [VPlan] Print VPValue operands for VPWidenPHI if possible. · a6b06b78
      Florian Hahn authored
      For VPWidenPHIRecipes that model all incoming values as VPValue
      operands, print those operands instead of printing the original PHI.
      
      D99294 updates recipes of reduction PHIs to use the VPValue for the
      incoming value from the loop backedge, making use of this new printing.
      a6b06b78
    • Simon Pilgrim's avatar
      [KnownBits] Rename KnownBits::computeForMul to KnownBits::mul. NFCI. · ddbb5873
      Simon Pilgrim authored
      As promised in D98866
      ddbb5873
    • Yevgeny Rouban's avatar
      [NewPM] Redesign of PreserveCFG Checker · 39e3e3aa
      Yevgeny Rouban authored
      The reason for the NewPM redesign is described in the commit
        cba3e783: [NewPM] Disable PreservedCFGChecker ...
      
      The checker introduces an internal custom CFG analysis that tracks
      current up-to date CFG snapshot. The analysis is invalidated along
      any other CFG related analysis (the key is CFGAnalyses). If the CFG
      analysis is not invalidated at a functional pass exit then the checker
      asserts that the CFG snapshot taken from this analysis is equals to
      a snapshot of the current CFG.
      
      Along the way:
      - the function CFG::printDiff() is simplified by removing function
        name calculation. The name is printed by the caller;
      - fixed CFG invalidated condition (see CFG::invalidate());
      - StandardInstrumentations::registerCallbacks() gets additional
        optional parameter of type FunctionAnalysisManager*, which is
        needed by the checker to get the custom CFG analysis;
      - several PM related tests updated to explicitly set
        -verify-cfg-preserved=1 as they need.
      
      This patch is safe to land as the CFGChecker is left switched off
      (the options -verify-cfg-preserved is false by default). It will be
      switched on by a separate patch to minimize possible reverts.
      
      Reviewed By: skatkov, kuhar
      
      Differential Revision: https://reviews.llvm.org/D91327
      39e3e3aa
  2. Apr 05, 2021
  3. Apr 04, 2021
  4. Apr 02, 2021
  5. Apr 01, 2021
    • Anirudh Prasad's avatar
      [AsmParser][SystemZ][z/OS] Add in support to accept "#" as part of an Identifier token · 7b921a67
      Anirudh Prasad authored
      - This patch adds in support to accept the "#" character as part of an Identifier.
      - This support is needed especially for the HLASM dialect since "#" is treated as part of the valid "Alphabet" range
      - The way this is done is by making use of the previous precedent set by the `AllowAtInIdentifier` field in `MCAsmLexer.h`. A new field called `AllowHashInIdentifier` is introduced.
      - The static function `IsIdentifierChar` is also updated to accept the `#` character if the `AllowHashInIdentifier` field is set to true.
      Note: The field introduced in `MCAsmLexer.h` could very well be moved to `MCAsmInfo.h`. I'm not opposed to it. I decided to put it in `MCAsmLexer` since there seems to be some sort of precedent already with `AllowAtInIdentifier`.
      
      Reviewed By: abhina.sreeskantharajan, nickdesaulniers, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D99277
      7b921a67
  6. Mar 31, 2021
    • Philip Reames's avatar
      Revert "Make TableGenGlobalISel an object library" · e8d8754c
      Philip Reames authored
      This reverts commit 2c3cf62d.
      
      Causes build failures on x86_64, will respond to commit thread with link errors.
      e8d8754c
    • Aaron Puchert's avatar
      Make TableGenGlobalISel an object library · 2c3cf62d
      Aaron Puchert authored
      That's how it was originally intended but that wasn't possible because
      we still needed to support older CMake versions.
      
      The problem here is that the sources in TableGenGlobalISel are meant to
      be linked into both llvm-tblgen and TableGenTests (a unit test), but not
      be part of LLVM proper. So they shouldn't be an ordinary LLVM component.
      Because they are used in llvm-tblgen, they can't draw in the LLVM dylib
      dependency, but then we'd have to do the same thing in TableGenTests to
      make sure we don't link both a static Support library and another copy
      through the LLVM dylib.
      
      With an object library we're just reusing the object files and don't
      have to care about dependencies at all.
      
      Reviewed By: beanz
      
      Differential Revision: https://reviews.llvm.org/D74588
      2c3cf62d
    • Juneyoung Lee's avatar
      [ValueTracking] Add with.overflow intrinsics to poison analysis functions · df0b97da
      Juneyoung Lee authored
      This is a patch teaching ValueTracking that `s/u*.with.overflow` intrinsics do not
      create undef/poison and they propagate poison.
      I couldn't write a nice example like the one with ctpop; ValueTrackingTest.cpp were simply updated
      to check these instead.
      This patch helps reducing regression while fixing https://llvm.org/pr49688 .
      
      Reviewed By: nikic
      
      Differential Revision: https://reviews.llvm.org/D99671
      df0b97da
    • Lang Hames's avatar
      [JITLink] Delete copy and move constructors for jitlink::Section. · ec235dd3
      Lang Hames authored
      Sections are not movable or copyable.
      ec235dd3
    • Lang Hames's avatar
      [JITLink] Switch from StringRef to ArrayRef<char>, add some generic x86-64 utils · 0269a407
      Lang Hames authored
      Adds utilities for creating anonymous pointers and jump stubs to x86_64.h. These
      are used by the GOT and Stubs builder, but may also be used by pass writers who
      want to create pointer stubs for indirection.
      
      This patch also switches the underlying type for LinkGraph content from
      StringRef to ArrayRef<char>. This avoids any confusion when working with buffers
      that contain null bytes in the middle like, for example, a newly added null
      pointer content array. ;)
      0269a407
  7. Mar 30, 2021
  8. Mar 29, 2021
  9. Mar 28, 2021
  10. Mar 26, 2021
  11. Mar 25, 2021
  12. Mar 24, 2021
    • Nikita Popov's avatar
      [SCEV] Improve handling of not expressions in isImpliedCond() · a7efed5a
      Nikita Popov authored
      SCEV currently tries to prove implications of x pred y by also
      trying to imply ~y pred ~x. This is expensive in terms of
      compile-time (in fact, the majority of isImpliedCond compile-time
      is spent here) and generally not fruitful. The issue is that this
      also swaps the operands and thus breaks canonical ordering. If
      originally we were trying to prove an implication like
      X > C1 -> Y > C2, then we'll now try to prove X > C1 -> C3 > ~Y,
      which will not work.
      
      The only real case where we can get some use out of this transform
      is if the original conditions were in the form X > C1 -> Y < C2, were
      then swapped to X > C1 -> C2 > Y and are then swapped again here to
      X > C1 -> ~Y > C3.
      
      As such, handle this at a higher level, where we are doing the
      swapping in the first place. There's four different ways that we
      can line up a predicate and a swapped predicate, so we use some
      heuristics to pick some profitable way.
      
      Because we now try this transform at a higher level
      (isImpliedCondOperands rather than isImpliedCondOperandsHelper),
      we can also prove additional facts. Of the added tests, one was
      proven previously while the other wasn't.
      
      Differential Revision: https://reviews.llvm.org/D90926
      a7efed5a
    • Nick Lewycky's avatar
    • Thomas Preud'homme's avatar
      [FileCheck] Fix PR49531: invalid use of string var · 058455ff
      Thomas Preud'homme authored
      FileCheck string substitution block parsing code only report an invalid
      variable name in a string variable use if it starts with a forbidden
      character. It does not report anything if there are unparsed characters
      after the variable name, i.e. [[X-Y]] is parsed as [[X]] and no error is
      returned. This commit fixes that.
      
      Reviewed By: jdenny, jhenderson
      
      Differential Revision: https://reviews.llvm.org/D98691
      058455ff
    • Anirudh Prasad's avatar
      [AsmParser][SystemZ][z/OS] Re-introduce HLASM comment syntax · 301d9261
      Anirudh Prasad authored
      - https://reviews.llvm.org/rGb605cfb336989705f391d255b7628062d3dfe9c3 was reverted due to sanitizer bugs in the introduced unit-test (specifically in the Address sanitizer https://lab.llvm.org/buildbot/#/builders/5/builds/5697)
      - This patch attempts to rectify that, as well as re-factor parts of the test
      - The issue was previously, within the `setupCallToAsmParser` function in the unit-test, `SrcMgr` was declared as a local variable. `SrcMgr` owns a unique pointer. Since the variable goes out of scope at the end of the function, the unique pointer is released.
      - This patch, moves the declaration of the `SrcMgr` variable to a class field, since the scope will remain until the class's destructor is invoked (which in this case is at the end of the unit test)
      - Furthermore, this patch also moves the `MCContext Ctx` declaration from a local variable instance inside a function, to a unique pointer class field. This ensures the instantiation of the MCContext remains until the tear down of the test.
      
      Reviewed By: abhina.sreeskantharajan
      
      Differential Revision: https://reviews.llvm.org/D99004
      301d9261
    • Alex Orlov's avatar
      * Fix demangling of optional template-args for vendor extended type qualifier. · 876435c4
      Alex Orlov authored
      This fixes https://bugs.llvm.org/show_bug.cgi?id=48009 bug.
      
      Reviewed By: erik.pilkington, krisb
      
      Differential Revision: https://reviews.llvm.org/D98687
      876435c4
  13. Mar 23, 2021
    • Matteo Favaro's avatar
      [MSSA] Extending IsGuaranteedLoopInvariant to support an instruction defined in the entry block · a4fb8866
      Matteo Favaro authored
      As mentioned in [[ https://reviews.llvm.org/D96979 | D96979 ]], I'm extending the **IsGuaranteedLoopInvariant** check also to the `MemorySSA.cpp` file.
      
      @fhahn For now I didn't unify the function into `MemorySSA.h` because, as you mentioned, it's not directly MSSA related. I'm open to suggestions to find a better place so we can improve the unification process.
      
      Reviewed By: fhahn
      
      Differential Revision: https://reviews.llvm.org/D97155
      a4fb8866
    • serge-sans-paille's avatar
      Introduce a generic operator to apply complex operations to BitVector · e19884cd
      serge-sans-paille authored
      This avoids temporary and memcpy call when computing large expressions.
      
      It's basically some kind of poor man's expression template, but it seems easier
      to maintain to have a single generic `apply` call instead of the whole
      expression template machinery here.
      
      Differential Revision: https://reviews.llvm.org/D98176
      e19884cd
    • David Sherwood's avatar
      [IR][SVE] Add new llvm.experimental.stepvector intrinsic · 748ae528
      David Sherwood authored
      This patch adds a new llvm.experimental.stepvector intrinsic,
      which takes no arguments and returns a linear integer sequence of
      values of the form <0, 1, ...>. It is primarily intended for
      scalable vectors, although it will work for fixed width vectors
      too. It is intended that later patches will make use of this
      new intrinsic when vectorising induction variables, currently only
      supported for fixed width. I've added a new CreateStepVector
      method to the IRBuilder, which will generate a call to this
      intrinsic for scalable vectors and fall back on creating a
      ConstantVector for fixed width.
      
      For scalable vectors this intrinsic is lowered to a new ISD node
      called STEP_VECTOR, which takes a single constant integer argument
      as the step. During lowering this argument is set to a value of 1.
      The reason for this additional argument at the codegen level is
      because in future patches we will introduce various generic DAG
      combines such as
      
        mul step_vector(1), 2 -> step_vector(2)
        add step_vector(1), step_vector(1) -> step_vector(2)
        shl step_vector(1), 1 -> step_vector(2)
        etc.
      
      that encourage a canonical format for all targets. This hopefully
      means all other targets supporting scalable vectors can benefit
      from this too.
      
      I've added cost model tests for both fixed width and scalable
      vectors:
      
        llvm/test/Analysis/CostModel/AArch64/neon-stepvector.ll
        llvm/test/Analysis/CostModel/AArch64/sve-stepvector.ll
      
      as well as codegen lowering tests for fixed width and scalable
      vectors:
      
        llvm/test/CodeGen/AArch64/neon-stepvector.ll
        llvm/test/CodeGen/AArch64/sve-stepvector.ll
      
      See this thread for discussion of the intrinsic:
      https://lists.llvm.org/pipermail/llvm-dev/2021-January/147943.html
      748ae528
  14. Mar 22, 2021
  15. Mar 20, 2021
  16. Mar 19, 2021
    • Jessica Paquette's avatar
      [GlobalISel] Add G_SBFX + G_UBFX (bitfield extraction opcodes) · 4773dd5b
      Jessica Paquette authored
      There is a bunch of similar bitfield extraction code throughout *ISelDAGToDAG.
      
      E.g, ARMISelDAGToDAG, AArch64ISelDAGToDAG, and AMDGPUISelDAGToDAG all contain
      code that matches a bitfield extract from an and + right shift.
      
      Rather than duplicating code in the same way, this adds two opcodes:
      
      - G_UBFX (unsigned bitfield extract)
      - G_SBFX (signed bitfield extract)
      
      They work like this
      
      ```
      %x = G_UBFX %y, %lsb, %width
      ```
      
      Where `lsb` and `width` are
      
      - The least-significant bit of the extraction
      - The width of the extraction
      
      This will extract `width` bits from `%y`, starting at `lsb`. G_UBFX zero-extends
      the result, while G_SBFX sign-extends the result.
      
      This should allow us to use the combiner to match the bitfield extraction
      patterns rather than duplicating pattern-matching code in each target.
      
      Differential Revision: https://reviews.llvm.org/D98464
      4773dd5b
    • Andrei Elovikov's avatar
      92205cb2
    • Andrei Elovikov's avatar
      [VPlan] Add plain text (not DOT's digraph) dumps · 93a9d2de
      Andrei Elovikov authored
      I foresee two uses for this:
      1) It's easier to use those in debugger.
      2) Once we start implementing more VPlan-to-VPlan transformations (especially
         inner loop massaging stuff), using the vectorized LLVM IR as CHECK targets in
         LIT test would become too obscure. I can imagine that we'd want to CHECK
         against VPlan dumps after multiple transformations instead. That would be
         easier with plain text dumps than with DOT format.
      
      Reviewed By: fhahn
      
      Differential Revision: https://reviews.llvm.org/D96628
      93a9d2de
    • Paul Robinson's avatar
      [RGT] Recode more unreachable assertions and tautologies · fb4f6057
      Paul Robinson authored
      Count iterations of zero-trip loops and assert the count is zero,
      rather than asserting inside the loop.
      Unreachable functions should use llvm_unreachable.
      Remove tautological 'if' statements, even when they're following a
      pattern of checks.
      
      Found by the Rotten Green Tests project.
      fb4f6057
Loading