I have audited all the callers of concatenate and none require duplicate
entries to service concatenation.
These duplicates serve no purpose but to needlessly embiggen the IR.
N.B. Layering getMostGenericAliasScope on top of concatenate makes it
O(nlogn + mlogm) instead of O(n*m).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278836 91177308-0d34-0410-b5e6-96231b3b80d8
Besides breaking up a 700 line function to improve readability,
this sinks the 'FIXME: ConstantInt' check into each helper. So
now we can independently break that restriction within any of the
helper functions.
As much as possible, the code was only {cut/paste/clang-format}'ed
to minimize risk (no functional changes intended), so several more
readability improvements are still possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278828 91177308-0d34-0410-b5e6-96231b3b80d8
There's some formatting and pointer deref ugliness here that I intend to fix in
subsequent patches. The overall goal is to refactor the obnoxiously long switch
and incrementally remove the restriction to scalar types (allow folds for vector
splats). This patch introduces the use of m_APInt which means the RHSV reference
is now a pointer (and may have matched a vector splat), but the check of 'RHS'
remains, so vector folds are disallowed and no functional change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278816 91177308-0d34-0410-b5e6-96231b3b80d8
We're going to need it for G_MUL, and, if other targets end up using
something similar, we can easily put it in the generic selector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278808 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This is part of a serious of patches to evolve ADCE.cpp to support
removing of unnecessary control flow.
This patch changes the data structures to hold liveness information to
support the additional information we will eventually need. In
particular we now have a notion of basic blocks being live because
they contain a live operations. This will eventually feed into control
dependence analysis of which branches are live. We cater to getting
from instructions to associated block information and from blocks to
information about their terminators.
This patch also changes the structure of the main loop of the
algorithm so that it alternates propagating liveness between
instructions and usign control dependence information to mark branches
live.
We force all terminators live for now until we add code to handlinge
removing control flow in a later patch.
No changes to effective behavior with this patch
Previous patches:
D23065 [ADCE] Refactor anticipating new functionality (NFC)
D23102 [ADCE] Refactoring for new functionality (NFC)
Reviewers: nadav, majnemer, mehdi_amini
Subscribers: freik, twoh, llvm-commits
Differential Revision: https://reviews.llvm.org/D23225
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278807 91177308-0d34-0410-b5e6-96231b3b80d8
The pipeliner was generating an invalid Phi name for an operand
in the epilog block, which caused an assert in the live variable
analysis pass. The fix is to the code that generates new Phis
in the epilog block. In this case, there is an existing Phi that
needs to be reused rather than creating a new Phi instruction.
Differential Revision: https://reviews.llvm.org/D23513
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278805 91177308-0d34-0410-b5e6-96231b3b80d8
The combine was only matching v2i64 as it assumed lowering to MOVQ - but we have v2f64 patterns that match in a similar fashion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278794 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
The assembler currently does not check the branch target for CBZ/CBNZ
instructions, which only permit branching forwards with a positive offset. This
adds validation for the branch target to ensure negative PC-relative offsets are
not encoded into the instruction, whether specified as a literal or as an
assembler symbol.
Reviewers: rengolin, t.p.northover
Subscribers: llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D23312
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278788 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Multiple APIs were taking a StringMap for the ImportLists containing
the entries for for all the modules while operating on a single entry
for the current module. Instead we can pass the desired ModuleImport
directly. Also some of the APIs were not const, I believe just to be
able to use operator[] on the StringMap.
Reviewers: tejohnson
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23537
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278776 91177308-0d34-0410-b5e6-96231b3b80d8
Recall that MSVC always gives enums the type 'int', nothing else. MSVC
2015 does not appear to have this problem anymore.
Clang-cl -Wmicrosoft-enum-value flags this, FWIW, so now I have a true
positive for my warning. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278762 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Fixed a bug in ThinLTOCodeGenerator's temp file dumping. The Twine
needs to be passed directly as an argument, or a copy saved into a
std::string.
It doesn't seem there are any consumers of this, so I added a new option
to llvm-lto to enable saving of temp files during ThinLTO, and augmented
a test to use it to check post-import but pre-opt bitcode.
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23525
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278761 91177308-0d34-0410-b5e6-96231b3b80d8
This was indented really awkwardly, and clang-format didn't seem to
know how to do any better. Avoid the issue with a temporary variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278756 91177308-0d34-0410-b5e6-96231b3b80d8