| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
The bug was introduced by r301018 "[InstCombine] fadd double (sitofp x), y check that the promotion is valid". The patch didn't expect that fadd can be on vectors not necessarily scalars. Add vector support along with the test.
llvm-svn: 301070
|
| |
|
|
|
|
|
|
| |
If a switch was in an unreachable block that branched
to a block with a phi, it would leave phis with missing
predecessors.
llvm-svn: 301064
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixes leaving intermediate flat addressing computations
where a GEP instruction's source is a constant expression.
Still leaves behind a trivial addrspacecast + gep pair that
instcombine is able to handle, which ideally could be folded
here directly.
llvm-svn: 301044
|
| |
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D32373
llvm-svn: 301042
|
| |
|
|
|
|
| |
This can cause an inf-loop. Investigating...
llvm-svn: 301035
|
| |
|
|
| |
llvm-svn: 301030
|
| |
|
|
|
|
|
|
|
|
| |
C | ~D == -1
~(C | ~D) == 0
~C & D == 0
D & ~C == 0
D.isSubsetOf(C)
llvm-svn: 301021
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Doing these transformations check that the result of integer addition is representable in the FP type.
(fadd double (sitofp x), fpcst) --> (sitofp (add int x, intcst))
(fadd double (sitofp x), (sitofp y)) --> (sitofp (add int x, y))
This is a fix for https://bugs.llvm.org//show_bug.cgi?id=27036
Reviewed By: andrew.w.kaylor, scanon, spatel
Differential Revision: https://reviews.llvm.org/D31182
llvm-svn: 301018
|
| |
|
|
|
|
|
|
|
|
| |
to handle the targets on the second branch being commuted
Currently we choose PostBB as the single successor of QFB, but its possible that QTB's single successor is QFB which would make QFB the correct choice.
Differential Revision: https://reviews.llvm.org/D32323
llvm-svn: 300992
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
places based on it.
Existing constant hoisting pass will merge a group of contants in a small range
and hoist the const materialization code to the common dominator of their uses.
However, if the uses are all in cold pathes, existing implementation may hoist
the materialization code from cold pathes to a hot place. This may hurt performance.
The patch introduces BFI to the pass and selects the best insertion places based
on it.
The change is controlled by an option consthoist-with-block-frequency which is
off by default for now.
Differential Revision: https://reviews.llvm.org/D28962
llvm-svn: 300989
|
| |
|
|
|
|
|
|
|
| |
Phi nodes in non-header blocks are converted to select instructions after
if-conversion. This patch updates the cost model to account for the selects.
Differential Revision: https://reviews.llvm.org/D31906
llvm-svn: 300980
|
| |
|
|
|
|
|
|
|
| |
This matches the demanded bits behavior in the DAG and should fix:
https://bugs.llvm.org/show_bug.cgi?id=32706
Differential Revision: https://reviews.llvm.org/D32255
llvm-svn: 300977
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CodeExtractor looks up the dominator node corresponding to return blocks
when splitting them. If one of these blocks is unreachable, there's no
node in the Dom and CodeExtractor crashes because it doesn't check
for domtree node validity.
In theory, we could add just a check for skipping null DTNodes in
`splitReturnBlock` but the fix I propose here is slightly different. To the
best of my knowledge, unreachable blocks are irrelevant for the algorithm,
therefore we can just skip them when building the candidate set in the
constructor.
Differential Revision: https://reviews.llvm.org/D32335
llvm-svn: 300946
|
| |
|
|
| |
llvm-svn: 300931
|
| |
|
|
|
|
|
|
| |
The demanded mask and the constant should always be the same width for all callers today.
Also stop copying the demanded mask as its passed in. We should avoid allocating memory unless we are going to do something. The final AND to create the new constant will take care of it.
llvm-svn: 300927
|
| |
|
|
|
|
| |
Forgot to make this fix with the signature change in r300911.
llvm-svn: 300912
|
| |
|
|
| |
llvm-svn: 300911
|
| |
|
|
|
|
|
|
|
| |
Instead of calling BasicBlock::SplitBasicBlock directly in
CodeExtractor.
Differential Revision: https://reviews.llvm.org/D32308
llvm-svn: 300899
|
| |
|
|
|
|
| |
More fixes are needed to enable the helper SimplifyShrShlDemandedBits().
llvm-svn: 300898
|
| |
|
|
|
|
| |
more places in SimplifyDemandedBits.
llvm-svn: 300896
|
| |
|
|
| |
llvm-svn: 300888
|
| |
|
|
|
|
|
|
| |
SimplifyDemandedBits. NFC
This allows us to use less temporary APInt for And and Invert operations.
llvm-svn: 300885
|
| |
|
|
|
|
| |
Or. The code above it is equivalent if you work through the bitwise math.
llvm-svn: 300876
|
| |
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D32305
llvm-svn: 300869
|
| |
|
|
|
|
|
|
| |
getSignBit is a static function that creates an APInt with only the sign bit set. getSignMask seems like a better name to convey its functionality. In fact several places use it and then store in an APInt named SignMask.
Differential Revision: https://reviews.llvm.org/D32108
llvm-svn: 300856
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
another without creating temporary APInts
This question comes up in many places in SimplifyDemandedBits. This makes it easy to ask without allocating additional temporary APInts.
The BitVector class provides a similar functionality through its (IMHO badly named) test(const BitVector&) method. Though its output polarity is reversed.
I've provided one example use case in this patch. I plan to do more as a follow up.
Differential Revision: https://reviews.llvm.org/D32258
llvm-svn: 300851
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Currently we don't explicitly process ConstantDataSequential, ConstantAggregateZero, or ConstantVector, or Undef before applying the Depth limit. Instead they occur after the depth check in the non-instruction path.
For the constant types that we do handle, the code is replicated from computeKnownBits.
This patch fixes the missing constant handling and the reduces the amount of code by just using computeKnownBits directly for any type of Constant.
Differential Revision: https://reviews.llvm.org/D32123
llvm-svn: 300849
|
| |
|
|
|
|
| |
Removes a use of getSlotAttributes, which I intend to change.
llvm-svn: 300795
|
| |
|
|
| |
llvm-svn: 300787
|
| |
|
|
|
|
|
|
|
| |
This change is correct because the verifier requires that at most one
argument be marked 'sret'.
NFC, removes a use of AttributeList slot APIs.
llvm-svn: 300784
|
| |
|
|
| |
llvm-svn: 300778
|
| |
|
|
| |
llvm-svn: 300777
|
| |
|
|
| |
llvm-svn: 300769
|
| |
|
|
|
|
|
|
|
|
| |
overflow bool out param is used.
This is preparation for a clang change to improve the [[nodiscard]] warning to not be ignored on methods that return a class marked [[nodiscard]] that are defined in the class itself. See D32207.
We should consider adding wrapper methods to APInt that return the overflow flag directly and discard the APInt result. This would eliminate the void casts and the need to create a bool before the call to pass to the out param.
llvm-svn: 300758
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The most common case for a branch condition is
a single use compare. Directly invert the branch
predicate rather than adding a lot of xor i1 true
which the DAG will have to fold later.
This produces nicer to read structurizer output.
This produces some random changes in codegen
due to the DAG swapping branch conditions itself,
and then does a poor job of dealing with those
inverts.
llvm-svn: 300732
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
See http://llvm.org/docs/LangRef.html#non-integral-pointer-type
The NewGVN test does not fail without these changes (perhaps it does
try to coerce pointers <-> integers to begin with?), but I added the
test case anyway.
Reviewers: dberlin
Subscribers: mcrosier, llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D32208
llvm-svn: 300730
|
| |
|
|
|
|
|
|
| |
This should simplify the call sites, which typically want to tweak one
attribute at a time. It should also avoid creating ephemeral
AttributeLists that live forever.
llvm-svn: 300718
|
| |
|
|
| |
llvm-svn: 300717
|
| |
|
|
|
|
|
|
|
|
|
|
| |
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/2476/steps/build-stage2-LLVMgold.so/logs/stdio
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/15036/steps/build_llvmclang/logs/stdio
I've updated the commit thread, reverting to get the bots back to green.
Original commit summary:
[JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor.
llvm-svn: 300662
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BB's successor. .
Summary: In case all predecessor go to a single successor of current BB. We want to fold (not thread).
Reviewers: efriedma, sanjoy
Reviewed By: sanjoy
Subscribers: dberlin, majnemer, llvm-commits
Differential Revision: https://reviews.llvm.org/D30869
llvm-svn: 300657
|
| |
|
|
|
|
| |
I will use this in a later change.
llvm-svn: 300613
|
| |
|
|
| |
llvm-svn: 300607
|
| |
|
|
|
|
| |
return false. Merge the appropriate if statements so it doesn't happen again.
llvm-svn: 300584
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In tryToVectorizeList, under a very limited circumstance (when entered
from tryToVectorizePair), the values may be reordered (swapped) and the
SLP tree is built with the new order. This extends that to the case when
starting from phis in vectorizeChainsInBlock when there are exactly two
phis. The textual order of phi nodes shouldn't really matter. Without
this change, the loop body in the accompnaying test case is fully vectorized
when we swap the orde of the phis but not with this order. While this
doesn't solve the phi-ordering problem in a general way (for more than 2
phis), this is simple fix that piggybacks on an existing mechanism and
is useful in cases like multiplying two complex numbers.
Differential revision: https://reviews.llvm.org/D32065
llvm-svn: 300574
|
| |
|
|
|
|
|
|
|
|
| |
This patch uses lshrInPlace to replace code where the object that lshr is called on is being overwritten with the result.
This adds an lshrInPlace(const APInt &) version as well.
Differential Revision: https://reviews.llvm.org/D32155
llvm-svn: 300566
|
| |
|
|
| |
llvm-svn: 300565
|
| |
|
|
|
|
| |
getNumUses() can be more expensive as it iterates over all list's elements.
llvm-svn: 300558
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch is part of D28975's breakdown.
Add caching for block masks similar to the cache already used for edge masks,
replacing generation per user with reusing the first generated value which
dominates all uses.
Differential Revision: https://reviews.llvm.org/D32054
llvm-svn: 300557
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: sebpop, hiraditya
Reviewed By: sebpop
Subscribers: n.bozhenov, llvm-commits
Differential Revision: https://reviews.llvm.org/D32158
Patch by Andrei Elovikov <andrei.elovikov@intel.com>
llvm-svn: 300552
|
| |
|
|
| |
llvm-svn: 300544
|