Commit Graph

6088 Commits

Author SHA1 Message Date
Daniel Sanders
d5d860727b [tablegen] Use categories on options that only matter to one emitter.
Summary:
The categories are emitted in a strange order in this patch due to a bug in the
CommandLine library.

Reviewers: ab

Reviewed By: ab

Subscribers: ab, llvm-commits

Differential Revision: https://reviews.llvm.org/D30995

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 13:15:13 +00:00
Karl-Johan Karlsson
f6c7abbfd1 [TableGen] Make CodeGenMapTable understand the namespace field of an instruction
Do not force the backends to use target name as namespace.

Original patch by Mattias Eriksson

Reviewers: stoklund, craig.topper

Reviewed By: stoklund

Subscribers: materi, llvm-commits

Differential Revision: https://reviews.llvm.org/D31322

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 07:13:44 +00:00
Krzysztof Parzyszek
4712ec63c2 Move spill size and alignment info from MC to TargetRegisterInfo
This is another step towards implementing register classes with
parametrized register/spill sizes and value types.

This is an updated version of r298652. The difference is that MCRegister-
Class still contains register size, available as getPhysRegSize(). The
old function getSize was retained as a temporary measure to avoid build
breakage for out-of-tree targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298739 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 21:01:16 +00:00
Krzysztof Parzyszek
b3204c752e Revert r298652 on Quentin's request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 19:18:29 +00:00
Tom Stellard
7a6e6b169d stable-merge-request.sh: Add a script for submitting merge requests via bugzilla
Summary:
This script will automatically create a new stable merge request bug in
bugzilla for the given svn revision and release number.

Reviewers: hans

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D30905

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 16:13:18 +00:00
Benjamin Kramer
01a5eed38e Another instance where GCC doesn't understand implicit construction of StringLiteral.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298703 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 14:17:56 +00:00
Benjamin Kramer
1dd3d84b80 Make GCC happy again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298702 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 14:15:35 +00:00
Benjamin Kramer
54c10c042d Don't build up std::vectors with constant sizes when an array suffices.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298701 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 14:11:47 +00:00
Krzysztof Parzyszek
2884223490 Move spill size and alignment info from MC to TargetRegisterInfo
This is another step towards implementing register classes with
parametrized register/spill sizes.

Differential Revision: https://reviews.llvm.org/D31299


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298652 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 22:32:22 +00:00
Tim Shen
9efd978480 [PPC] Add generated tests for all atomic operations
Summary: Add tests for all atomic operations for powerpc64le, so that all changes can be easily examined.

Reviewers: kbarton, hfinkel, echristo

Subscribers: mehdi_amini, nemanjai, llvm-commits

Differential Revision: https://reviews.llvm.org/D31285

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298614 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 16:02:47 +00:00
Brian Gesiak
81e6d00cf5 lit: remove python2-isms
Summary:
`assert.assertItemEqual` went away in Python 3. Seeing how lists
are ordered, comparing a list against each other should work just
as well.

Patch by @jbergstroem (Johan Bergström).

Reviewers: modocache, gparker42

Reviewed By: modocache

Differential Revision: https://reviews.llvm.org/D31229



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22 04:23:01 +00:00
Reid Kleckner
6707770d48 Rename AttributeSet to AttributeList
Summary:
This class is a list of AttributeSetNodes corresponding the function
prototype of a call or function declaration. This class used to be
called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is
typically accessed by parameter and return value index, so
"AttributeList" seems like a more intuitive name.

Rename AttributeSetImpl to AttributeListImpl to follow suit.

It's useful to rename this class so that we can rename AttributeSetNode
to AttributeSet later. AttributeSet is the set of attributes that apply
to a single function, argument, or return value.

Reviewers: sanjoy, javed.absar, chandlerc, pete

Reviewed By: pete

Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits

Differential Revision: https://reviews.llvm.org/D31102

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 16:57:19 +00:00
Tim Northover
b38a51e92c GlobalISel: add implicit defs & uses when mutating an instruction.
Otherwise a scheduler might do bad things to the code we produce.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298311 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-20 21:58:23 +00:00
Zachary Turner
7d6ca05af0 Explicitly add move constructor/assignment operators.
These are needed due to some obscure rules in the standard
about how std::vector selects between copy and move
constructors, which can cause a conforming implementation
to attempt to select the copy constructor of RuleMatcher,
which will fail since std::unique_ptr<> isn't copyable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-20 19:56:52 +00:00
Daniel Sanders
1111ea1a18 [tablegen][globalisel] Capture instructions into locals and related infrastructure for multiple instructions matches.
Summary:
Prepare the way for nested instruction matching support by having actions
like CopyRenderer look up operands in the RuleMatcher rather than a
specific InstructionMatcher. This allows actions to reference any operand
from any matched instruction.

It works by checking the 'shape' of the match and capturing
each matched instruction to a local variable. If the shape is wrong
(not enough operands, leaf nodes where non-leafs are expected, etc.), then
the rule exits early without checking the predicates. Once we've captured
the instructions, we then test the predicates as before (except using the
local variables). If the match is successful, then we render the new
instruction as before using the local variables.

It's not noticable in this patch but by the time we support multiple
instruction matching, this patch will also cause a significant improvement
to readability of the emitted code since
MRI.getVRegDef(I->getOperand(0).getReg()) will simply be MI1 after
emitCxxCaptureStmts().

This isn't quite NFC because I've also fixed a bug that I'm surprised we
haven't encountered yet. It now checks there are at least the expected
number of operands before accessing them with getOperand().

Depends on D30531

Reviewers: t.p.northover, qcolombet, aditya_nandakumar, ab, rovka

Reviewed By: rovka

Subscribers: dberris, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D30535

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-20 15:20:42 +00:00
Jonas Paulsson
1b93bd9e9e Add SystemZ to utils/update_llc_test_checks.py.
Extend script for auto-generating CHECK lines so that it works for SystemZ.

This is a pre-commit for the new tests resulting from
https://reviews.llvm.org/D29489

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298048 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-17 07:11:42 +00:00
Simon Pilgrim
733a6d0f30 Removed unnecessary semicolon. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 22:50:47 +00:00
David Blaikie
312b28eb63 Add GDB pretty-printer for llvm::Twine type
Patch by Simon Marchi!

Differential Revision: https://reviews.llvm.org/D30994

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:51:44 +00:00
Daniel Sanders
9fb2625421 [tablegen][globalisel] Trivial changes to reduce size of following patch. NFC.
Summary:
* Move namespace {
* Trivial: Typo
* RuleMatcher: Separate class and definition
* Trivial: const findNodeEquiv

Reviewers: t.p.northover, qcolombet, aditya_nandakumar, ab, rovka

Reviewed By: rovka

Subscribers: dberris, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D30531

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:18:38 +00:00
Daniel Sanders
9db5e41e1d [globalisel][tblgen] Add support for ComplexPatterns
Summary:
Adds a new kind of MachineOperand: MO_Placeholder.
This operand must not appear in the MIR and only exists as a way of
creating an 'uninitialized' operand until a matcher function overwrites it.

Depends on D30046, D29712

Reviewers: t.p.northover, ab, rovka, aditya_nandakumar, javed.absar, qcolombet

Reviewed By: qcolombet

Subscribers: dberris, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D30089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297782 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14 21:32:08 +00:00
James Henderson
51258d9cbd Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14 10:51:14 +00:00
Craig Topper
27a7060a36 [SelectionDAG] Enhance SDTCisSameNumEltsAs to work with scalar types and use it on extend/trunc/round operations.
Currently we don't enforce that ISD::ANY_EXTEND, ZERO_EXTEND, SIGN_EXTEND, TRUNC, FP_ROUND, FP_EXTEND have the same number of elements(including scalar) between their input and output. Though we have them documented as such. Up until a few months ago x86 created nodes that violated this rule. That's all been fixed now, and we should enforce the rule going forward.

In order to do this we need to allow SDTCisSameNumEltsAs to support scalar types and not enforce being a vector. If one type is scalar we will force the other type to also be scalar.

Differential Revision: https://reviews.llvm.org/D30878



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 17:37:14 +00:00
Zachary Turner
39e53ee48c [ADT] Improve the genericity of llvm::enumerate().
There were some issues in the implementation of enumerate()
preventing it from being used in various contexts.  These were
all related to the fact that it did not supporter llvm's
iterator_facade_base class.  So this patch adds support for that
and additionally exposes a new helper method to_vector() that
will evaluate an entire range and store the results in a
vector.

Differential Revision: https://reviews.llvm.org/D30853

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297633 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 16:24:10 +00:00
Craig Topper
760a31890d Revert "[AVX-512] EVEX2VEX, don't reject intrinsic instructions when both have a memory operand. We should just continue to check other operands instead."
This reverts r297596.

There were other issues that were making this not work that have been fixed now. Reverting this results in a more accurate table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 05:34:03 +00:00
Craig Topper
c68171ad8f [AVX-512] EVEX2VEX, don't reject intrinsic instructions when both have a memory operand. We should just continue to check other operands instead.
This exposed that we have several intrinsic instructions that have identical TSFlags to other instructions. We should merge their patterns and kill of the duplicate. I'll fix that in a follow up patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 00:36:49 +00:00
Craig Topper
026472f7e8 [X86] Minor formatting tweaks in EVEX to VEX tables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 00:36:46 +00:00
Artem Belevich
bb9779aa2e [FileCheck] Added --enable-var-scope option to enable scope for regex variables.
If `--enable-var-scope` is in effect, variables with names that
start with `$` are considered to be global. All other variables are
local. All local variables get undefined at the beginning of each
CHECK-LABEL block. Global variables are not affected by CHECK-LABEL.
This makes it easier to ensure that individual tests are not affected
by variables set in preceding tests.

Differential Revision: https://reviews.llvm.org/D30749

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297396 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 17:59:04 +00:00
Joey Gouly
205d8d3e8e [SelectionDAG] Make SelectCode return void
SelectCode has been returning nullptr since 182dac0 ("SDAG: Make
SelectCodeCommon return void", 2016-05-10). Make SelectCode also
return void instead, as all callers have been updated.

Patch by Sven van Haastregt.

Review: https://reviews.llvm.org/D30497


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297377 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 13:38:06 +00:00
Daniel Sanders
35c6dd2400 Recommit: [globalisel] Change LLT constructor string into an LLT-based object that knows how to generate it.
Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.

Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.

The problem with the previous commit appears to have been that TableGen was including CodeGen/LowLevelType.h instead of Support/LowLevelTypeImpl.h.

Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar

Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D30046



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 23:20:35 +00:00
Daniel Sanders
428e17c613 Revert r297177: Change LLT constructor string into an LLT-based object ...
More module problems. This time it only showed up in the stage 2 compile of
clang-x86_64-linux-selfhost-modules-2 but not the stage 1 compile.

Somehow, this change causes the build to need Attributes.gen before it's been
generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 19:21:23 +00:00
Daniel Sanders
86bbf4372b [globalisel] Change LLT constructor string into an LLT-based object that knows how to generate it.
Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.

Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.

Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar

Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D30046

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 18:32:25 +00:00
Ayman Musa
69112bd6d2 [X86] Quick fix for build bot failure (r297127) due to unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297130 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 08:56:27 +00:00
Ayman Musa
b59d8041db [X86][AVX512] Adding new LLVM TableGen backend which generates the EVEX2VEX compressing tables.
X86EvexToVex machine instruction pass compresses EVEX encoded instructions by replacing them with their identical VEX encoded instructions when possible.
It uses manually supported 2 large tables that map the EVEX instructions to their VEX ideticals.
This TableGen backend replaces the tables by automatically generating them.

Differential Revision: https://reviews.llvm.org/D30451



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297127 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 08:11:19 +00:00
Krzysztof Parzyszek
490469a98c [TableGen] Ensure proper ordering of subtarget feature names
Recommit r297039 without the testcase. The MIR testcase did not work
well with MC code emitter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 21:26:49 +00:00
Krzysztof Parzyszek
628a420ef1 Revert r297039, it's causing some mysterious buildbot failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 20:24:21 +00:00
Adam Nemet
079dec76a9 [opt-diff] Fix the case when the script is invoked with directories
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297055 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 19:15:22 +00:00
Krzysztof Parzyszek
b69b5c5449 [TableGen] Ensure proper ordering of subtarget feature names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297039 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 18:08:37 +00:00
Daniel Berlin
82a036a26d Fix bug in bisect-skip-count not using passed-in arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296961 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04 03:23:41 +00:00
Zachary Turner
985631dcc8 Teach lit to expand glob expressions.
This will enable removing hacks throughout the codebase
in clang and compiler-rt that feed multiple inputs to a
testing utility by globbing, all of which are either disabled
on Windows currently or using xargs / find hacks.

Differential Revision: https://reviews.llvm.org/D30380

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 18:55:24 +00:00
Adam Nemet
6a466e7794 New tool: opt-diff.py
This tool allows generating the different between two optimization record
files.  The result is a YAML file too that can be visualized with opt-viewer.

This is very useful to see what optimization were added and removed by a
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296767 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 17:00:59 +00:00
Adam Nemet
5bf944fd37 [opt-viewer] Treat remarks with different attributes as different
We used to exclude arguments but for a diffed YAML file, it's interesting to
show these as changes.

Turns out this also affects gvn/LoadClobbered because we used to squash
multiple entries of this on the same line even if they reported clobbers
by *different* instructions.  This increases the number of unique entries now
and the share of gvn/LoadClobbered.

Total number of remarks      902287

Top 10 remarks by pass:
  inline                         43%
  gvn                            37%
  licm                           11%
  loop-vectorize                  4%
  asm-printer                     3%
  regalloc                        1%
  loop-unroll                     1%
  inline-cost                     0%
  slp-vectorizer                  0%
  loop-delete                     0%

Top 10 remarks:
  gvn/LoadClobbered              33%
  inline/Inlined                 16%
  inline/CanBeInlined            14%
  inline/NoDefinition             7%
  licm/Hoisted                    6%
  licm/LoadWithLoopInvariantAddressInvalidated  5%
  gvn/LoadElim                    3%
  asm-printer/InstructionCount    3%
  inline/TooCostly                2%
  loop-vectorize/MissedDetails    2%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296766 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 17:00:56 +00:00
Adam Nemet
76f5727a33 [opt-viewer] Don't use __getattr__ for missing YAML attributes
__getattr__ does not work well with debugging.  If the attribute function has
a run-time error, a missing attribute is reported instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 17:00:53 +00:00
Adam Nemet
40561164f5 [opt-viewer] Sort entries with identical hotness by source line
We want entries that are close to each other in the source appear next to each
other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296764 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 17:00:49 +00:00
Adam Nemet
aa64e902dd New tool: opt-stats.py
I am planning to use this tool to find too noisy (missed) optimization
remarks.  Long term it may actually be better to just have another tool that
exports the remarks into an sqlite database and perform queries like this in
SQL.

This splits out the YAML parsing from opt-viewer.py into a new Python module
optrecord.py.

This is the result of the script on the LLVM testsuite:

Total number of remarks        714433

Top 10 remarks by pass:
  inline                         52%
  gvn                            24%
  licm                           13%
  loop-vectorize                  5%
  asm-printer                     3%
  loop-unroll                     1%
  regalloc                        1%
  inline-cost                     0%
  slp-vectorizer                  0%
  loop-delete                     0%

Top 10 remarks:
  gvn/LoadClobbered              20%
  inline/Inlined                 19%
  inline/CanBeInlined            18%
  inline/NoDefinition             9%
  licm/LoadWithLoopInvariantAddressInvalidated  6%
  licm/Hoisted                    6%
  asm-printer/InstructionCount    3%
  inline/TooCostly                3%
  gvn/LoadElim                    3%
  loop-vectorize/MissedDetails    2%

Beside some refactoring, I also changed optrecords not to use context to
access global data (max_hotness).  Because of the separate module this would
have required splitting context into two.  However it's not possible to access
the optrecord context from the SourceFileRenderer when calling back to
Remark.RelativeHotness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 21:35:00 +00:00
Adam Nemet
a3f7c6ad38 [opt-viewer] Suggest installing the faster parser (libYAML)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 00:54:40 +00:00
Adam Nemet
2f28d0c7ba [opt-viewer] Handle column number 0
The asm-printer now emits remarks with function location which have
unspecified (0) source column number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296547 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:59:46 +00:00
Daniel Berlin
bd74a4c6a2 This script was meant to be committed with the DebugCounter changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 02:19:11 +00:00
Sanjay Patel
a17350a541 [utils] allow auto-generation of checks for thumb triples
If there's some reason not to do this, feel free to revert and/or fix, but
for the cases I'm looking at, the script appears to do fine for these targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 21:47:44 +00:00
Simon Pilgrim
f1e0716def Fixed IntOperandMatcher::emitCxxPredicateExpr arguments
Extra const in the StringRef argument meant that MSVC complained about it not correctly overriding from OperandPredicateMatcher::emitCxxPredicateExpr (which didn't have the const)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296138 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 17:20:27 +00:00
Daniel Sanders
bf21af7b42 [globalisel] Decouple src pattern operands from dst pattern operands.
Summary:
This isn't testable for AArch64 by itself so this patch also adds
support for constant immediates in the pattern and physical
register uses in the result.

The new IntOperandMatcher matches the constant in patterns such as
'(set $rd:GPR32, (G_XOR $rs:GPR32, -1))'. It's always safe to fold
immediates into an instruction so this is the first rule that will match
across multiple BB's.

The Renderer hierarchy is responsible for adding operands to the result
instruction. Renderers can copy operands (CopyRenderer) or add physical
registers (in particular %wzr and %xzr) to the result instruction
in any order (OperandMatchers now import the operand names from
SelectionDAG to allow renderers to access any operand). This allows us to
emit the result instruction for:
  %1 = G_XOR %0, -1 --> %1 = ORNWrr %wzr, %0
  %1 = G_XOR -1, %0 --> %1 = ORNWrr %wzr, %0
although the latter is untested since the matcher/importer has not been
taught about commutativity yet.

Added BuildMIAction which can build new instructions and mutate them where
possible. W.r.t the mutation aspect, MatchActions are now told the name of
an instruction they can recycle and BuildMIAction will emit mutation code
when the renderers are appropriate. They are appropriate when all operands
are rendered using CopyRenderer and the indices are the same as the matcher.
This currently assumes that all operands have at least one matcher.

Finally, this change also fixes a crash in
AArch64InstructionSelector::select() caused by an immediate operand
passing isImm() rather than isCImm(). This was uncovered by the other
changes and was detected by existing tests.

Depends on D29711

Reviewers: t.p.northover, ab, qcolombet, rovka, aditya_nandakumar, javed.absar

Reviewed By: rovka

Subscribers: aemerson, dberris, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D29712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 15:43:30 +00:00