1. Feb 24, 2017
    • Adam Nemet's avatar
      [OptDiag] Hide legacy remark ctors · de53bfb9
      Adam Nemet authored
      These are only used when emitting remarks without ORE directly using the free
      functions emitOptimizationRemark*.
      
      llvm-svn: 296037
      de53bfb9
    • Bryant Wong's avatar
      [ADT] Fix zip iterator interface. · 332e6e5a
      Bryant Wong authored
      This commit provides `zip_{first,shortest}` with the standard member types and
      methods expected of iterators (e.g., `difference_type`), in order for zip to be
      used with other adaptors, such as `make_filter_range`.
      
      Support for reverse iteration has also been added.
      
      Differential Revision: https://reviews.llvm.org/D30246
      
      llvm-svn: 296036
      332e6e5a
    • Sanjoy Das's avatar
      [IR] Add a Instruction::dropPoisonGeneratingFlags helper · aa722ae8
      Sanjoy Das authored
      Summary:
      The helper will be used in a later change.  This change itself is NFC
      since the only user of this new function is its unit test.
      
      Reviewers: majnemer, efriedma
      
      Reviewed By: efriedma
      
      Subscribers: efriedma, mcrosier, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D30184
      
      llvm-svn: 296035
      aa722ae8
    • Benjamin Kramer's avatar
      [CodeGen] Silence unused variable warning in Release builds. · d12317ef
      Benjamin Kramer authored
      llvm-svn: 296034
      d12317ef
    • Richard Smith's avatar
      PR32044: Fix some cases where we would confuse a transparent init-list... · 382bc51f
      Richard Smith authored
      PR32044: Fix some cases where we would confuse a transparent init-list expression with an aggregate init.
      
      llvm-svn: 296033
      382bc51f
    • Artem Belevich's avatar
      [NVPTX] Added support for .f16x2 instructions. · 620db1f3
      Artem Belevich authored
      This patch enables support for .f16x2 operations.
      
      Added new register type Float16x2.
      Added support for .f16x2 instructions.
      Added handling of vectorized loads/stores of v2f16 values.
      
      Differential Revision: https://reviews.llvm.org/D30057
      Differential Revision: https://reviews.llvm.org/D30310
      
      llvm-svn: 296032
      620db1f3
    • Tim Northover's avatar
      ARM: make sure FastISel bails on f64 operations for Cortex-M4. · 063a56e8
      Tim Northover authored
      FastISel wasn't checking the isFPOnlySP subtarget feature before emitting
      double-precision operations, so it got completely invalid CodeGen for doubles
      on Cortex-M4F.
      
      The normal ISel testing wasn't spectacular either so I added a second RUN line
      to improve that while I was in the area.
      
      llvm-svn: 296031
      063a56e8
    • Hans Wennborg's avatar
      Revert r282872 "CVP. Turn marking adds as no wrap on by default" · 5cd9a9bf
      Hans Wennborg authored
      While not CVP's fault, this caused miscompiles (PR31181). Reverting
      until those are resolved.
      
      (This also reverts the follow-ups r288154 and r288161 which removed the
      flag.)
      
      llvm-svn: 296030
      5cd9a9bf
    • Vedant Kumar's avatar
      [llvm-cov] Strip redundant path components from filenames (fix PR31982) · 11813280
      Vedant Kumar authored
      Instead of stripping the longest common prefix off of the filenames in a
      report, strip out the longest chain of redundant path components. This
      fixes the case in PR31982, where there are two files with the same
      prefix, and stripping out the LCP makes things less intelligible.
      
      llvm-svn: 296029
      11813280
    • Dehao Chen's avatar
      Add call branch annotation for ICP promoted direct call in SamplePGO mode. · cc75d244
      Dehao Chen authored
      Summary: SamplePGO uses branch_weight annotation to represent callsite hotness. When ICP promotes an indirect call to direct call, we need to make sure the direct call is annotated with branch_weight in SamplePGO mode, so that downstream function inliner can use hot callsite heuristic.
      
      Reviewers: davidxl, eraman, xur
      
      Reviewed By: davidxl, xur
      
      Subscribers: mehdi_amini, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D30282
      
      llvm-svn: 296028
      cc75d244
    • George Burgess IV's avatar
      Tighten up a regex in a test · 635a7369
      George Burgess IV authored
      ...If we're trying to match "this function has only two arguments", `.*`
      probably isn't the best thing to use. :)
      
      llvm-svn: 296027
      635a7369
    • Krzysztof Parzyszek's avatar
      [Hexagon] Handle saturations in Hexagon bit tracker · 128e191e
      Krzysztof Parzyszek authored
      llvm-svn: 296026
      128e191e
    • Krzysztof Parzyszek's avatar
      [Hexagon] Allow setting register in BitVal without storing into map · 998e49e5
      Krzysztof Parzyszek authored
      In the bit tracker, references to other bit values in which the register
      is 0 are prohibited. This means that generating self-referential register
      cells like { w:32 [0-15]:s[0-15] [16-31]:s[15] } is impossible. In order
      to get a self-referential cell, it had to be stored into a map and then
      reloaded from it. To avoid this step, add a function that will set the
      register to a given value without going through the map.
      
      llvm-svn: 296025
      998e49e5
    • George Burgess IV's avatar
      [CodeGen] Fix ExtParameterInfo bugs in C++ CodeGen code. · d0a9e807
      George Burgess IV authored
      This patch makes use of the prefix/suffix ABI argument distinction that
      was introduced in r295870, so that we now emit ExtParameterInfo at the
      correct offset for member calls that have added ABI arguments. I don't
      see a good way to test the generated param info, since we don't actually
      seem to use it in CGFunctionInfo outside of Swift. Any
      suggestions/thoughts for how to better test this are welcome. :)
      
      This patch also fixes a small bug with inheriting constructors: if we
      decide not to pass args into an base class ctor, we would still
      generate ExtParameterInfo as though we did. The added test-case is for
      that behavior.
      
      llvm-svn: 296024
      d0a9e807
    • Rafael Espindola's avatar
      Convert EhOutputSection to be a synthetic section. · 66b4e215
      Rafael Espindola authored
      With this we complete the transition out of special output sections,
      and with the previous patches it should be possible to merge
      OutputSectionBase and OuputSection.
      
      llvm-svn: 296023
      66b4e215
    • Michael Kruse's avatar
      [DeLICM] Fortify against exceeding isl's max operations counter. · e199f285
      Michael Kruse authored
      Control flow would flow-through after the check whether the operations
      quota exceeded, with the intention that it would later be caught by
      Knowledge::isUsable(). However, the Knowledge constructor has its own
      assertions to check consistency which would fail if its fields have only
      been initialized partially because some sets have been computed correctly
      before the operations quota takes effect.
      
      Fix by erroring-out early instead of falling-throught into the code that
      might expect that everything has been computed correctly. For robustness,
      also bail-out if any of the fields contain nullptr values instead of
      relying on isl always setting exactly this error code if something went
      wrong.
      
      This should fix the
      perf-x86_64-penryn-O3-polly-before-vectorizer-unprofitable
      (-polly-process-unprofitable -polly-position=before-vectorizer
      -polly-enable-delicm) buildbot.
      
      llvm-svn: 296022
      e199f285
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] Shut the warning "getRegUnitWeight hides overload...". NFC. · 78468e48
      Stanislav Mekhanoshin authored
      Clang issues warning about hidden overload. That was intended, so
      add "using AMDGPUGenRegisterInfo::getRegUnitWeight;" to mute it.
      
      llvm-svn: 296021
      78468e48
    • Richard Smith's avatar
    • Adam Nemet's avatar
      [ORE] Remove ORE.emit{{.+}} functions · 2531df3d
      Adam Nemet authored
      Last use was killed in my previous patch. The preferred way is now to
      construct the remark, pipe things to it and pass it to ORE.emit.
      
      llvm-svn: 296019
      2531df3d
    • Kyle Butt's avatar
      CodeGen: MachineBlockPlacement: Rename member to more general name. NFC. · ebe6cc4d
      Kyle Butt authored
      Rename ComputedTrellisEdges to ComputedEdges to allow for other methods of
      pre-computing edges.
      
      Differential Revision: https://reviews.llvm.org/D30308
      
      llvm-svn: 296018
      ebe6cc4d
    • Adam Nemet's avatar
      [LAA] Remove unused LoopAccessReport · 41b019a3
      Adam Nemet authored
      The need for this removed when I converted everything to use the opt-remark
      classes directly with the streaming interface.
      
      llvm-svn: 296017
      41b019a3
    • Adam Nemet's avatar
      [LV] Remove unused VectorizationReport · bf0e6953
      Adam Nemet authored
      The need for this removed when I converted everything to use the opt-remark
      classes directly with the streaming interface.
      
      llvm-svn: 296016
      bf0e6953
    • Erik Pilkington's avatar
      [ObjC][CodeGen] CodeGen support for @available. · 9c42a8d4
      Erik Pilkington authored
      CodeGens uses of @available into calls to the compiler-rt function
      __isOSVersionAtLeast.
      
      This commit is part of a feature that I proposed here:
      http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html
      
      Differential revision: https://reviews.llvm.org/D27827
      
      llvm-svn: 296015
      9c42a8d4
    • Evgeniy Stepanov's avatar
      Disable TLS for stack protector on Android API<17. · ee2d77f6
      Evgeniy Stepanov authored
      The TLS slot did not exist back then.
      
      llvm-svn: 296014
      ee2d77f6
    • Ahmed Bougacha's avatar
      [GlobalISel] Emit opt remarks on isel fallbacks. · ae9dadec
      Ahmed Bougacha authored
      Having more fine-grained information on the specific construct that
      caused us to fallback is valuable for large-scale data collection.
      
      We still have the fallback warning, that's also used for FastISel.
      We still need to remove the fallback warning, and teach FastISel to also
      emit remarks (it currently has a combination of the warning, stats, and
      debug prints: the remarks could unify all three).
      
      The abort-on-fallback path could also be better handled using remarks:
      one could imagine a "-Rpass-error", analoguous to "-Werror", which would
      promote missed/failed remarks to errors.  It's not clear whether that
      would be useful for other remarks though, so we're not there yet.
      
      llvm-svn: 296013
      ae9dadec
    • Ahmed Bougacha's avatar
      [CodeGen] Teach opt remarks how to print MI instructions. · 27273975
      Ahmed Bougacha authored
      This will be used with GISel opt remarks.
      
      llvm-svn: 296012
      27273975
    • Ahmed Bougacha's avatar
      [CodeGen] Print MI without a newline when skipping debugloc. NFC. · 97119d48
      Ahmed Bougacha authored
      This matches the behavior for skip-operands. While there, document it.
      This is a follow-up to r296007.
      
      llvm-svn: 296011
      97119d48
    • Ahmed Bougacha's avatar
      [CodeGen] Use const MBBs in the opt remark diagnostics. NFC. · 0cf8cfa1
      Ahmed Bougacha authored
      llvm-svn: 296010
      0cf8cfa1
    • Stanislav Mekhanoshin's avatar
      Correct register pressure calculation in presence of subregs · ce3ddd2d
      Stanislav Mekhanoshin authored
      If a subreg is used in an instruction it counts as a whole superreg
      for the purpose of register pressure calculation. This patch corrects
      improper register pressure calculation by examining operand's lane mask.
      
      Differential Revision: https://reviews.llvm.org/D29835
      
      llvm-svn: 296009
      ce3ddd2d
    • Ahmed Bougacha's avatar
      [ORE] Use const CodeRegions in the remark diagnostics. NFC. · 851125dc
      Ahmed Bougacha authored
      llvm-svn: 296008
      851125dc
    • Ahmed Bougacha's avatar
      [CodeGen] Add a way to SkipDebugLoc in MachineInstr::print(). NFC. · 43192246
      Ahmed Bougacha authored
      llvm-svn: 296007
      43192246
    • Ahmed Bougacha's avatar
      [GlobalISel] Simplify Select type cleanup using a ScopeExit. NFC. · 1b333944
      Ahmed Bougacha authored
      This lets us use more natural early-returns when selection fails.
      
      llvm-svn: 296006
      1b333944
    • Adrian Prantl's avatar
      Revert "Teach the IR verifier to reject conflicting debug info for function arguments." · 29cf0c43
      Adrian Prantl authored
      This reverts commit r295749 while investigating PR32042.
      
      It looks like this check uncovered a problem in the frontend that
      needs to be fixed before the check can be enabled again.
      
      llvm-svn: 296005
      29cf0c43
    • Sanjay Patel's avatar
      [DAG] add convenience function to get -1 constant; NFCI · 4a4fbe16
      Sanjay Patel authored
      llvm-svn: 296004
      4a4fbe16
    • Chad Rosier's avatar
      [Reassociate] Add negated value of negative constant to the Duplicates list. · 95abfa35
      Chad Rosier authored
      In OptimizeAdd, we scan the operand list to see if there are any common factors
      between operands that can be factored out to reduce the number of multiplies
      (e.g., 'A*A+A*B*C+D' -> 'A*(A+B*C)+D'). For each operand of the operand list, we
      only consider unique factors (which is tracked by the Duplicate set). Now if we
      find a factor that is a negative constant, we add the negated value as a factor
      as well, because we can percolate the negate out. However, we mistakenly don't
      add this negated constant to the Duplicates set.
      
      Consider the expression A*2*-2 + B. Obviously, nothing to factor.
      
      For the added value A*2*-2 we over count 2 as a factor without this change,
      which causes the assert reported in PR30256.  The problem is that this code is
      assuming that all the multiply operands of the add are already reassociated.
      This change avoids the issue by making OptimizeAdd tolerate multiplies which
      haven't been completely optimized; this sort of works, but we're doing wasted
      work: we'll end up revisiting the add later anyway.
      
      Another possible approach would be to enforce RPO iteration order more strongly.
      If we have RedoInsts, we process them immediately in RPO order, rather than
      waiting until we've finished processing the whole function. Intuitively, it
      seems like the natural approach: reassociation works on expression trees, so
      the optimization only works in one direction. That said, I'm not sure how
      practical that is given the current Reassociate; the "optimal" form for an
      expression depends on its use list (see all the uses of "user_back()"), so
      Reassociate is really an iterative optimization of sorts, so any changes here
      would probably get messy.
      
      PR30256
      
      Differential Revision: https://reviews.llvm.org/D30228
      
      llvm-svn: 296003
      95abfa35
    • Dehao Chen's avatar
      Use base discriminator in sample pgo profile matching. · 533bc6ea
      Dehao Chen authored
      Summary: The discriminator has been encoded, and only the base discriminator should be used during profile matching.
      
      Reviewers: dblaikie, davidxl
      
      Reviewed By: dblaikie, davidxl
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D30218
      
      llvm-svn: 295999
      533bc6ea
    • Michael Kruse's avatar
      [Support] Remove NonowningIslPtr. NFC. · f4e201e0
      Michael Kruse authored
      NonowningIslPtr<isl_X> was used as types of function parameters when the
      function does not consume the isl object, i.e. an __isl_keep parameter.
      
      The alternatives are:
      
      1. IslPtr<isl_X>
         This has additional calls to isl_X_copy and isl_X_free to
         increase/decrease the reference counter even though not needed. The
         caller already owns a reference to the isl object.
      
      2. const IslPtr<isl_X>&
         This does not change the reference counter, but requires an
         additional load to get the pointer to the isl object (instead of just
         passing the pointer itself).
         Moreover, the compiler cannot rely on the constness of the pointer
         and has to reload the pointer every time it writes to memory (unless
         alias analysis such as TBAA says it is not possible).
      
      The isl C++ bindings currently in development do not have an equivalent
      to NonowningIslPtr and adding one would make the binding more
      complicated and its advantage in performance is small. In order to
      simplify the transition to these C++ bindings, remove NonowningIslPtr.
      Change every former use of it to alternative 2 mentioned aboce
      (const IslPtr<isl_X>&).
      
      llvm-svn: 295998
      f4e201e0
    • Krzysztof Parzyszek's avatar
      [Hexagon] Avoid IMPLICIT_DEFs as new-value producers · 2cfc7a48
      Krzysztof Parzyszek authored
      llvm-svn: 295997
      2cfc7a48
    • Adam Nemet's avatar
      [LazyMachineBFI] Reimplement with getAnalysisIfAvailable · b516cf3f
      Adam Nemet authored
      Since LoopInfo is not available in machine passes as universally as in IR
      passes, using the same approach for OptimizationRemarkEmitter as we did for IR
      will run LoopInfo and DominatorTree unnecessarily.  (LoopInfo is not used
      lazily by ORE.)
      
      To fix this, I am modifying the approach I took in D29836.  LazyMachineBFI now
      uses its client passes including MachineBFI itself that are available or
      otherwise compute them on the fly.
      
      So for example GreedyRegAlloc, since it's already using MBFI, will reuse that
      instance.  On the other hand, AsmPrinter in Justin's patch will generate DT,
      LI and finally BFI on the fly.
      
      (I am of course wondering now if the simplicity of this approach is even
      preferable in IR.  I will do some experiments.)
      
      Testing is provided by an updated version of D29837 which requires Justin's
      patch to bring ORE to the AsmPrinter.
      
      Differential Revision: https://reviews.llvm.org/D30128
      
      llvm-svn: 295996
      b516cf3f
    • Filipe Cabecinhas's avatar
      [test] Use @LINE macro · 3f4181db
      Filipe Cabecinhas authored
      llvm-svn: 295995
      3f4181db