Permalink
Commits on Sep 14, 2018
  1. [LoopInterchange] Preserve ScalarEvolution, by forgetting about inter…

    fhahn committed Sep 14, 2018
    …changed loops.
    
    As preparation for LoopInterchange becoming a loop pass, it needs to
    preserve ScalarEvolution. Even though interchanging should not change
    the trip count of the loop, it modifies loop entry, latch and exit
    blocks.
    
    I added -verify-scev to some loop interchange tests, but the verification does
    not catch problems caused by missing invalidation of SE in loop interchange, as
    the trip counts themselves do not change. So there might be potential to
    make the SE verification covering more stuff in the future.
    
    Reviewers: mkazantsev, efriedma, karthikthecool
    
    Reviewed By: efriedma
    
    Differential Revision: https://reviews.llvm.org/D52026
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342209 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Sep 12, 2018
  1. [PatternMatch] Use generic One,Two,ThreeOps_match classes (NFC).

    fhahn committed Sep 12, 2018
    Currently we have a few duplicated matcher classes, which all do pretty
    much the same thing. This patch introduces generic
    One,Tow,ThreeOps_match classes which take the opcode the match as
    template argument.
    
    Reviewers: SjoerdMeijer, dneilson, spatel, arsenm
    
    Reviewed By: SjoerdMeijer
    
    Differential Revision: https://reviews.llvm.org/D51044
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342058 91177308-0d34-0410-b5e6-96231b3b80d8
  2. [LV] Move InterleaveGroup and InterleavedAccessInfo to VectorUtils.h …

    fhahn committed Sep 12, 2018
    …(NFC)
    
    Move the 2 classes out of LoopVectorize.cpp to make it easier to re-use
    them for VPlan outside LoopVectorize.cpp
    
    Reviewers: Ayal, mssimpso, rengolin, dcaballe, mkuper, hsaito, hfinkel, xbolva00
    
    Reviewed By: rengolin, xbolva00
    
    Differential Revision: https://reviews.llvm.org/D49488
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342027 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Sep 11, 2018
  1. [CallSiteSplitting] Add debug location to created PHI nodes.

    fhahn committed Sep 11, 2018
    There are 2 cases when we create PHI nodes:
     * For the result of the call that was duplicated in the split blocks.
       Those PHI nodes should have the debug location of the call.
    
     * For values produced before the call. Those instructions need to be
       duplicated in the split blocks and the PHI nodes should have the
       debug locations of those instructions.
    
    Fixes PR37962.
    
    Reviewers: junbuml, gbedwell, vsk
    
    Reviewed By: junbuml
    
    Tags: #debug-info
    
    Differential Revision: https://reviews.llvm.org/D51919
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341970 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Sep 7, 2018
  1. [InstCombine] Do not fold scalar ops over select with vector condition.

    fhahn committed Sep 7, 2018
    If OtherOpT or OtherOpF have scalar types and the condition is a vector,
    we would create an invalid select.
    
    Reviewers: spatel, john.brawn, mssimpso, craig.topper
    
    Reviewed By: spatel
    
    Differential Revision: https://reviews.llvm.org/D51781
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341666 91177308-0d34-0410-b5e6-96231b3b80d8
  2. [NewGVN] Mark function as changed if we erase instructions.

    fhahn committed Sep 7, 2018
    Currently eliminateInstructions only returns true if any instruction got
    replaced. In the test case for this patch, we eliminate the trivially
    dead calls, for which eliminateInstructions not do a replacement and the
    function is not marked as changed, which is why the inliner crashes
    while traversing the call graph.
    
    Alternatively we could also change eliminateInstructions to return true
    in case we mark instructions for deletion, but that's slightly more code
    and doing it at the place where the replacement happens seems safer.
    
    Fixes PR37517.
    
    Reviewers: davide, mcrosier, efriedma, bjope
    
    Reviewed By: bjope
    
    Differential Revision: https://reviews.llvm.org/D51169
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341651 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Sep 6, 2018
  1. [LoopInterchange] Cleanup unused variables.

    fhahn committed Sep 6, 2018
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341537 91177308-0d34-0410-b5e6-96231b3b80d8
  2. [LoopInterchange] Move preheader creation to transform stage and simp…

    fhahn committed Sep 6, 2018
    …lify.
    
    There is no need to create preheaders in the analysis stage, we only
    need them when adjusting the branches. Also, the only cases we need to
    create our own preheaders is when they have more than 1 predecessors or
    PHI nodes (even with only 1 predecessor, we could have an LCSSA phi
    node). I have simplified the conditions and added some assertions to be
    sure. Because we know the inner and outer loop need to be tightly
    nested, it is sufficient to check if the inner loop preheader is the
    outer loop header to check if we need to create a new preheader.
    
    Reviewers: efriedma, mcrosier, karthikthecool
    
    Reviewed By: efriedma
    
    Differential Revision: https://reviews.llvm.org/D51703
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341533 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Sep 3, 2018
  1. [SLC] Support expanding pow(x, n+0.5) to x * x * ... * sqrt(x)

    fhahn committed Sep 3, 2018
    Reviewers: evandro, efriedma, spatel
    
    Reviewed By: spatel
    
    Differential Revision: https://reviews.llvm.org/D51435
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341330 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Aug 30, 2018
  1. Fix "Q" and "R" inline assembly template modifiers for big-endian Arm

    fhahn committed Aug 30, 2018
    Consider the endianness of the target when printing register names.  This is in line with the documentation at http://llvm.org/docs/LangRef.html#asm-template-argument-modifiers
    
    Patch by Jackson Woodruff <jackson.woodruff@arm.com>
    
    Reviewers: t.p.northover, echristo, javed.absar, efriedma
    
    Reviewed By: efriedma
    
    Differential Revision: https://reviews.llvm.org/D49778
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341052 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Aug 24, 2018
  1. [Local] Make DoesKMove required for combineMetadata.

    fhahn committed Aug 24, 2018
    This patch makes the DoesKMove argument non-optional, to force people
    to think about it. Most cases where it is false are either code hoisting
    or code sinking, where we pick one instruction from a set of
    equal instructions among different code paths.
    
    Reviewers: dberlin, nlopes, efriedma, davide
    
    Reviewed By: efriedma
    
    Differential Revision: https://reviews.llvm.org/D47475
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340606 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Aug 23, 2018
  1. [SCCP] Remove unused variable added in r340525.

    fhahn committed Aug 23, 2018
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340526 91177308-0d34-0410-b5e6-96231b3b80d8
  2. Recommit r333268: [IPSCCP] Use PredicateInfo to propagate facts from …

    fhahn committed Aug 23, 2018
    …cmp instructions.
    
    This version of the patch fixes cleaning up ssa_copy intrinsics, so it does not
    crash for instructions in blocks that have been marked unreachable.
    
    This patch updates IPSCCP to use PredicateInfo to propagate
    facts to true branches predicated by EQ and to false branches
    predicated by NE.
    
    As a follow up, we should be able to extend it to also propagate additional
    facts about nonnull.
    
    Reviewers: davide, mssimpso, dberlin, efriedma
    
    Reviewed By: davide, dberlin
    
    Differential Revision: https://reviews.llvm.org/D45330
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340525 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Aug 21, 2018
  1. [CodeExtractor] Use 'normal destination' BB as insert point to store …

    fhahn committed Aug 21, 2018
    …invoke results.
    
    Currently CodeExtractor tries to use the next node after an invoke to
    place the store for the result of the invoke, if it is an out parameter
    of the region. This fails, as the invoke terminates the current BB.
    In that case, we can place the store in the 'normal destination' BB, as
    the result will only be available in that case.
    
    
    Reviewers: davidxl, davide, efriedma
    
    Reviewed By: davidxl
    
    Differential Revision: https://reviews.llvm.org/D51037
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340331 91177308-0d34-0410-b5e6-96231b3b80d8
  2. [GVN] Assign new value number to calls reading memory, if there is no…

    fhahn committed Aug 21, 2018
    … MemDep info.
    
    Currently we assign the same value number to two calls reading the same
    memory location if we do not have MemoryDependence info. Without MemDep
    Info we cannot guarantee that there is no store between the two calls, so we
    have to assign a new number to the second call.
    
    It also adds a new option EnableMemDep to enable/disable running
    MemoryDependenceAnalysis and also renamed NoLoads to NoMemDepAnalysis to
    be more explicit what it does. As it also impacts calls that read memory,
    NoLoads is a bit confusing.
    
    Reviewers: efriedma, sebpop, john.brawn, wmi
    
    Reviewed By: efriedma
    
    Differential Revision: https://reviews.llvm.org/D50893
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340319 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Aug 17, 2018
  1. [NewGVN] Add tests for r340031.

    fhahn committed Aug 17, 2018
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340032 91177308-0d34-0410-b5e6-96231b3b80d8
  2. [InstrSimplify,NewGVN] Add option to ignore additional instr info whe…

    fhahn committed Aug 17, 2018
    …n simplifying.
    
    NewGVN uses InstructionSimplify for simplifications of leaders of
    congruence classes. It is not guaranteed that the metadata or other
    flags/keywords (like nsw or exact) of the leader is available for all members
    in a congruence class, so we cannot use it for simplification.
    
    This patch adds a InstrInfoQuery struct with a boolean field
    UseInstrInfo (which defaults to true to keep the current behavior as
    default) and a set of helper methods to get metadata/keywords for a
    given instruction, if UseInstrInfo is true. The whole thing might need a
    better name, to avoid confusion with TargetInstrInfo but I am not sure
    what a better name would be.
    
    The current patch threads through InstrInfoQuery to the required
    places, which is messier then it would need to be, if
    InstructionSimplify and ValueTracking would share the same Query struct.
    
    The reason I added it as a separate struct is that it can be shared
    between InstructionSimplify and ValueTracking's query objects. Also,
    some places do not need a full query object, just the InstrInfoQuery.
    
    It also updates some interfaces that do not take a Query object, but a
    set of optional parameters to take an additional boolean UseInstrInfo.
    
    See https://bugs.llvm.org/show_bug.cgi?id=37540.
    
    Reviewers: dberlin, davide, efriedma, sebpop, hiraditya
    
    Reviewed By: hiraditya
    
    Differential Revision: https://reviews.llvm.org/D47143
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340031 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Aug 7, 2018
  1. [GVN,NewGVN] Keep nonnull if K does not move.

    fhahn committed Aug 7, 2018
    In combineMetadata, we should be able to preserve K's nonnull metadata,
    if K does not move. This condition should hold for all replacements by
    NewGVN/GVN, but I added a bunch of assertions to verify that.
    
    Fixes PR35038.
    
    There probably are additional kinds of metadata that could be preserved
    using similar reasoning. This is follow-up work.
    
    Reviewers: dberlin, davide, efriedma, nlopes
    
    Reviewed By: efriedma
    
    Differential Revision: https://reviews.llvm.org/D47339
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339149 91177308-0d34-0410-b5e6-96231b3b80d8
  2. [GVN,NewGVN] Move patchReplacementInstruction to Utils/Local.h

    fhahn committed Aug 7, 2018
    This function is shared between both implementations. I am not sure if
    Utils/Local.h is the best place though.
    
    Reviewers: davide, dberlin, efriedma, xbolva00
    
    Reviewed By: efriedma, xbolva00
    
    Differential Revision: https://reviews.llvm.org/D47337
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339138 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jul 25, 2018
  1. Revert r337904: [IPSCCP] Use PredicateInfo to propagate facts from cm…

    fhahn committed Jul 25, 2018
    …p instructions.
    
    I suspect it is causing the clang-stage2-Rthinlto failures.
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337956 91177308-0d34-0410-b5e6-96231b3b80d8
  2. Recommit r333268: [IPSCCP] Use PredicateInfo to propagate facts from …

    fhahn committed Jul 25, 2018
    …cmp instructions.
    
    r337828 resolves a PredicateInfo issue with unnamed types.
    
    Original message:
    This patch updates IPSCCP to use PredicateInfo to propagate
    facts to true branches predicated by EQ and to false branches
    predicated by NE.
    
    As a follow up, we should be able to extend it to also propagate additional
    facts about nonnull.
    
    Reviewers: davide, mssimpso, dberlin, efriedma
    
    Reviewed By: davide, dberlin
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337904 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jul 24, 2018
  1. [PredicateInfo] Use custom mangling to support ssa_copy with unnamed …

    fhahn committed Jul 24, 2018
    …types.
    
    This is a workaround and it would be better to fix this generally, but
    doing it generally is quite tricky. See D48541 and PR38117.
    
    Doing it in PredicateInfo directly allows us to use the type address to
    differentiate different unnamed types, because neither the created
    declarations nor the ssa_copy calls should be visible after
    PredicateInfo got destroyed.
    
    Reviewers: efriedma, davide
    
    Reviewed By: efriedma
    
    Differential Revision: https://reviews.llvm.org/D49126
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337828 91177308-0d34-0410-b5e6-96231b3b80d8
  2. Recommit r334887: [SmallSet] Add SmallSetIterator.

    fhahn committed Jul 24, 2018
    Updated to make sure we properly construct/destroy SetIter if it has a
    non-trivial ctors/dtors, like in MSVC.
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337818 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jul 20, 2018
  1. [IPSCCP] Fix for bot failure caused by r337548

    fhahn committed Jul 20, 2018
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337554 91177308-0d34-0410-b5e6-96231b3b80d8
  2. Recommit r328307: [IPSCCP] Use constant range information for compari…

    fhahn committed Jul 20, 2018
    …sons of parameters.
    
    This version contains a fix to add values for which the state in ParamState change
    to the worklist if the state in ValueState did not change. To avoid adding the
    same value multiple times, mergeInValue returns true, if it added the value to
    the worklist. The value is added to the worklist depending on its state in
    ValueState.
    
    Original message:
    For comparisons with parameters, we can use the ParamState lattice
    elements which also provide constant range information. This improves
    the code for PR33253 further and gets us closer to use
    ValueLatticeElement for all values.
    
    Also, as we are using the range information in the solver directly, we
    do not need tryToReplaceWithConstantRange afterwards anymore.
    
    Reviewers: dberlin, mssimpso, davide, efriedma
    
    Reviewed By: mssimpso
    
    Differential Revision: https://reviews.llvm.org/D43762
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337548 91177308-0d34-0410-b5e6-96231b3b80d8
  3. [UBSan] Also use blacklist for 'Address; Undefined' setting

    fhahn committed Jul 20, 2018
    It looks like currently the UBSan blacklist is only applied when "Undefined" is selected.
    This patch updates the cmake file to apply it whenever Undefined is selected
     (e.g. 'Address; Undefined' ). This  allows us to use the workaround added in
    rL335525 when using AddressSan and UBSan together.
    
    Reviewers: eugenis, vitalybuka
    
    Reviewed By: eugenis
    
    Differential Revision: https://reviews.llvm.org/D49558
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337539 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jul 17, 2018
  1. Revert rL337292 due to another MSVC STL problem.

    fhahn committed Jul 17, 2018
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337303 91177308-0d34-0410-b5e6-96231b3b80d8
  2. Recommit r334887: [SmallSet] Add SmallSetIterator.

    fhahn committed Jul 17, 2018
    Spell out destructor, copy/move constructor and assignment operators for
    MSVC STL, where set<T>::const_iterator is not trivially copy constructible.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337292 91177308-0d34-0410-b5e6-96231b3b80d8
  3. [IPSCCP] Run Solve each time we resolved an undef in a function.

    fhahn committed Jul 17, 2018
    Once we resolved an undef in a function we can run Solve, which could
    lead to finding a constant return value for the function, which in turn
    could turn undefs into constants in other functions that call it, before
    resolving undefs there.
    
    Computationally the amount of work we are doing stays the same, just the
    order we process things is slightly different and potentially there are
    a few less undefs to resolve.
    
    We are still relying on the order of functions in the IR, which means
    depending on the order, we are able to resolve the optimal undef first
    or not. For example, if @test1 comes before @testf, we find the constant
    return value of @testf too late and we cannot use it while solving
    @test1.
    
    This on its own does not lead to more constants removed in the
    test-suite, probably because currently we have to be very lucky to visit
    applicable functions in the right order.
    
    Maybe we manage to come up with a better way of resolving undefs in more
    'profitable' functions first.
    
    Reviewers: efriedma, mssimpso, davide
    
    Reviewed By: efriedma, davide
    
    Differential Revision: https://reviews.llvm.org/D49385
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337283 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jul 11, 2018
  1. Recommit r334887: [SmallSet] Add SmallSetIterator.

    fhahn committed Jul 11, 2018
    This version now uses the subset of is_trivially_XXX provided by
    GCC 4.8 and llvm/Support/type_traits.h
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336805 91177308-0d34-0410-b5e6-96231b3b80d8
  2. Recommit r336653: [VPlan] Add VPlanTestBase.h with helper

    fhahn committed Jul 11, 2018
    The original version caused a memsan failure.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336792 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jul 10, 2018
  1. [VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests.

    fhahn committed Jul 10, 2018
    Reviewers: dcaballe, hsaito, rengolin
    
    Reviewed By: dcaballe
    
    Differential Revision: https://reviews.llvm.org/D49032
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336653 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jul 2, 2018
  1. Recommit r328307: [IPSCCP] Use constant range information for compari…

    fhahn committed Jul 2, 2018
    …sons of parameters.
    
    This version contains a fix to add values for which the state in ParamState change
    to the worklist if the state in ValueState did not change. To avoid adding the
    same value multiple times, mergeInValue returns true, if it added the value to
    the worklist. The value is added to the worklist depending on its state in
    ValueState.
    
    Original message:
    For comparisons with parameters, we can use the ParamState lattice
    elements which also provide constant range information. This improves
    the code for PR33253 further and gets us closer to use
    ValueLatticeElement for all values.
    
    Also, as we are using the range information in the solver directly, we
    do not need tryToReplaceWithConstantRange afterwards anymore.
    
    Reviewers: dberlin, mssimpso, davide, efriedma
    
    Reviewed By: mssimpso
    
    Differential Revision: https://reviews.llvm.org/D43762
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336098 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jun 28, 2018
  1. [SCCP] Mark CFG as preserved.

    fhahn committed Jun 28, 2018
    SCCP does not change the CFG, so we can mark it as preserved.
    
    Reviewers: dberlin, efriedma, davide
    
    Reviewed By: davide
    
    Differential Revision: https://reviews.llvm.org/D47149
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335820 91177308-0d34-0410-b5e6-96231b3b80d8
Commits on Jun 27, 2018