Commit Graph

6165 Commits

Author SHA1 Message Date
Galina Kistanova
ebc10e3a25 Fixed nondeterminism in RuleMatcher::emit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 01:51:53 +00:00
Zachary Turner
69916e12b3 git-llvm script should add .exe on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303708 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-24 00:28:46 +00:00
Rui Ueyama
30395dd637 [git-llvm] Check if svn is installed.
The error message that git-llvm script prints out when svn is missing
is very cryptic. I spent a fair amount of time to find what was wrong
with my environment. It looks like many newcomers also exprienced a
hard time to submit their first patches due to this error.

This patch adds a more user-friendly error message.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303696 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 21:50:40 +00:00
Francis Visoiu Mistrih
78c24559f4 abtest: remove duplicate script
This is fixing a mistake from r303690.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 21:28:41 +00:00
Francis Visoiu Mistrih
3a50f77d96 AsmPrinter: mark the beginning and the end of a function in verbose mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 21:22:16 +00:00
Tom Stellard
59b664b197 merge-request.sh: Use https url for bugzilla
With the http url, the script fails with:

Connection lost/failed: 411 Client Error: Length Required

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 20:35:38 +00:00
Daniel Sanders
8eeef874d9 Fix unused variable warnings after r303678
This should fix lld-x86_64-darwin13



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303683 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 20:02:48 +00:00
Daniel Sanders
50acddba23 [globalisel][tablegen] Add support for (set $dst, 1) and test X86's OptForSize predicate.
Summary:
It's rare but a small number of patterns use IntInit's at the root of the match.
On X86, one such rule is enabled by the OptForSize predicate and causes the
compiler to use the smaller:
	%0 = MOV32r1
instead of the usual:
	%0 = MOV32ri 1

This patch adds support for matching IntInit's at the root and uses this as a
test case for the optsize attribute that was implemented in r301750

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

Reviewed By: qcolombet

Subscribers: igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303678 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 19:33:16 +00:00
Daniel Sanders
32e52f525a Revert r303259 - [globalisel][tablegen] Import rules containing intrinsic_wo_chain.
It's causing some buildbots to timeout whenever tablegen needs re-compilation,
particularly those with -fsanitize=memory but not only them. A compile time
regression was expected since it triples the amount of SelectionDAG rules we
are able to import but it's currently too high.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303542 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-22 10:14:33 +00:00
Zachary Turner
435c118e77 [lit] Take the last error when executing pipelines.
This seems to have been present since the beginning of time,
which is quite surprising.  The symptom was this: Suppose you
have a test with a run line that looks like this:

  RUN: foo | FileCheck %s

foo prints some output and then due to a bug in the program it
asserts.  On Windows this results in the program returning a
negative exit code.  But if enough output had been printed
already by the tool so that the FileCheck match would succeed
then FileCheck would return 0, and because of bad logic in
lit this 0 return value would overwrite the failed return
value from previous items in the pipeline.  This only happened
with negative exit codes.

The most sensible behavior is to just take whatever the first
exit code is.  There is no logical ordering defined on exit
codes, so comparing with < and > does not make a lot of sense.
Instead, as soon as we find the first non-successful return
value, that should be the result of the entire expression.

This fixes the issue, as now tests which fail on non-Windows
platforms also fail for me on Windows as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-19 18:12:07 +00:00
Reid Kleckner
71f289771f [git-llvm] Don't attempt to propget files that don't exist yet in SVN
svn propget will fail halfway through, and the patch will fail to apply.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303359 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-18 17:17:17 +00:00
Guy Blank
be169add2e [MVT] add v1i1 MVT
Adds the v1i1 MVT as a preparation for another commit (https://reviews.llvm.org/D32273)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303346 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-18 11:29:41 +00:00
Daniel Sanders
1b3695cbc0 Re-commit: [globalisel][tablegen] Import rules containing intrinsic_wo_chain.
Summary:
As of this patch, 1018 out of 3938 rules are currently imported.

Depends on D32275

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

Reviewed By: qcolombet

Subscribers: dberris, igorb, llvm-commits

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

The previous commit failed on test-suite/Bitcode/simd_ops/AArch64_halide_runtime.bc
because isImmOperandEqual() assumed MO was a register operand and that's not
always true.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303341 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-18 10:33:36 +00:00
Quentin Colombet
0817426586 Revert "[globalisel][tablegen] Import rules containing intrinsic_wo_chain."
This reverts commit r303259.

This breaks the GISel bot:
http://lab.llvm.org:8080/green/job/Compiler_Verifiers_GlobalISEL/5163/consoleFull#-134276167849ba4694-19c4-4d7e-bec5-911270d8a58c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303313 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 23:17:29 +00:00
Rafael Espindola
7eb7fabda7 Add back a dummy --use-processes.
Some bots are using it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 18:55:01 +00:00
Rafael Espindola
919d78ce80 Always use the multiprocess module.
This seems to work on freebsd and openbsd these days.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303280 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 18:20:01 +00:00
Daniel Sanders
4980b7679c [globalisel][tablegen] Import rules containing intrinsic_wo_chain.
Summary:
As of this patch, 1018 out of 3938 rules are currently imported.

Depends on D32275

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

Reviewed By: qcolombet

Subscribers: dberris, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 13:39:49 +00:00
Daniel Sanders
7e6b531c1a [globalisel][tablegen] Require that all registers between instructions of a match are virtual.
Summary:
Without this, it's possible to encounter multiple defs for a register.

This is triggered by the current version of D32868 when applied to trunk.

Reviewers: qcolombet, ab, t.p.northover, rovka, kristof.beyls

Reviewed By: qcolombet

Subscribers: llvm-commits, igorb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303253 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 12:43:30 +00:00
Diana Picus
571ecd0259 Fixup r303240: Use llvm::to_string instead of std::to_string
It turns out some of the buildbots don't have std::to_string around,
even in this day and age...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303243 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 09:25:08 +00:00
Diana Picus
3bbcbfa075 [GlobalISel][TableGen] Fix handling of default operands
When looping through a destination pattern's operands to decide how many
default operands we need to introduce, we used to count the "expanded"
number of operands. So if one default operand would be rendered as 2
values, we'd count it as 2 operands, when in fact it needs to count as
only 1 operand regardless of how many values it expands to.

This turns out to be a problem only in some very specific cases, e.g.
when we have one operand with multiple default values followed by more
operands with default values (see the new test). In such a situation
we'd stop looping before looking at all the operands, and then error out
assuming that we don't have enough default operands to make up the
shortfall.

At the moment this only affects ARM.

The patch removes the loop counting default operands entirely and
assumes that we'll have to introduce values for any default operand that
we find (i.e. we're assuming it cannot be given as a child at all). It
also extracts the code for adding renderers for default operands into a
helper method.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 08:57:28 +00:00
Galina Kistanova
733dbc6c18 Added LLVM_DUMP_METHOD attributes for MatchableInfo::dump(). Defined it only if dump is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303229 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 02:20:05 +00:00
Hans Wennborg
528105d20c build_llvm_package.bat: Minor updates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 16:50:48 +00:00
Sam Kolton
5188cfa18e [TableGen] Add EncoderMethod to RegisterOperand
Reviewers: stoklund, grosbach, vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303044 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 10:13:07 +00:00
Reid Kleckner
4dc3e3a6c2 [git-llvm] Fix svn:eol-style issue for one-file patches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 00:10:19 +00:00
Ayman Musa
059f03aebf [X86] Moving X86Local namespace from .cpp to .h file to use it in memory folding TableGen backend.
Differential Revision: https://reviews.llvm.org/D32797



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302791 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 11:51:12 +00:00
Puyan Lotfi
92fa36802d Adding VSCode syntax colorizer to utils (generated from textmate colorizer).
--This line, and those below, will be igored--

A    utils/vscode
A    utils/vscode/README
A    utils/vscode/tablegen
A    utils/vscode/tablegen/.vscode
A    utils/vscode/tablegen/.vscode/launch.json
A    utils/vscode/tablegen/CHANGELOG.md
A    utils/vscode/tablegen/README.md
A    utils/vscode/tablegen/language-configuration.json
A    utils/vscode/tablegen/package.json
A    utils/vscode/tablegen/syntaxes
A    utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
A    utils/vscode/tablegen/vsc-extension-quickstart.md


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09 17:13:37 +00:00
Geoff Berry
6922382ead Fix comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 15:33:08 +00:00
Kamil Rytarowski
3ff0533844 Note addition of NetBSD support in googletest
Recreated patch for __NetBSD__ has been pushed upstream to Google.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302329 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-06 02:45:42 +00:00
Joerg Sonnenberger
7b3685be8d Add NetBSD to the list of platforms supporting death tests. Two unit
tests require this for compilation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302264 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 17:57:45 +00:00
Renato Golin
e27523b837 [test-release] Status update *before* long gzip
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 16:21:30 +00:00
Reid Kleckner
a82b376f69 [IR] Abstract away ArgNo+1 attribute indexing as much as possible
Summary:
Do three things to help with that:
- Add AttributeList::FirstArgIndex, which is an enumerator currently set
  to 1. It allows us to change the indexing scheme with fewer changes.
- Add addParamAttr/removeParamAttr. This just shortens addAttribute call
  sites that would otherwise need to spell out FirstArgIndex.
- Remove some attribute-specific getters and setters from Function that
  take attribute list indices.  Most of these were only used from
  BuildLibCalls, and doesNotAlias was only used to test or set if the
  return value is malloc-like.

I'm happy to split the patch, but I think they are probably easier to
review when taken together.

This patch should be NFC, but it sets the stage to change the indexing
scheme to this, which is more convenient when indexing into an array:
  0: func attrs
  1: retattrs
  2...: arg attrs

Reviewers: chandlerc, pete, javed.absar

Subscribers: david2050, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 18:17:31 +00:00
Elad Cohen
ea59a24717 Support arbitrary address space pointers in masked gather/scatter intrinsics.
Fixes PR31789 - When loop-vectorize tries to use these intrinsics for a
non-default address space pointer we fail with a "Calling a function with a
bad singature!" assertion. This patch solves this by adding the 'vector of
pointers' argument as an overloaded type which will determine the address
space.

Differential revision: https://reviews.llvm.org/D31490



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302018 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 12:28:54 +00:00
Reid Kleckner
4f77dbb38b [lit] Try to exit more cleanly
If all jobs complete successfully, use pool.close() instead of
pool.terminate() before waiting for the workers. Zach Turner reported
that he was getting "access denied" exceptions from pool.terminate().

Make the workers abort immediately without printing to stderr when they
are interrupted.

Finally, catch exceptions when attempting to remove our temporary
testing directory. On abnormal exit, there can often be open handles
that haven't been cleaned up yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301941 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02 17:45:16 +00:00
Diana Picus
33dd8eaf5d [ARM] GlobalISel: Use TableGen instruction selector
Emit and use the TableGen instruction selector for ARM. At the moment,
this allows us to remove the hand-written code for selecting G_SDIV and
G_UDIV.

Future commits will focus on increasing the code coverage for it and
removing more dead code from the current instruction selector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301905 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02 09:40:49 +00:00
Daniel Sanders
bb8d1d09bc [globalisel][tablegen] Silence unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301755 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 19:10:19 +00:00
Daniel Sanders
f31ac9d1e8 [globalisel][tablegen] Compute available feature bits correctly.
Summary:
Predicate<> now has a field to indicate how often it must be recomputed.
Currently, there are two frequencies, per-module (RecomputePerFunction==0)
and per-function (RecomputePerFunction==1). Per-function predicates are
currently recomputed more frequently than necessary since the only predicate
in this category is cheap to test. Per-module predicates are now computed in
getSubtargetImpl() while per-function predicates are computed in selectImpl().

Tablegen now manages the PredicateBitset internally. It should only be
necessary to add the required includes.

Also fixed a problem revealed by the test case where
constrainSelectedInstRegOperands() would attempt to tie operands that
BuildMI had already tied.

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

Reviewed By: rovka

Subscribers: kristof.beyls, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-29 17:30:09 +00:00
Matt Arsenault
8c9ed246f2 TableGen: Add IntrHasSideEffects property for intrinsics
The IntrNoMem, IntrReadMem, IntrWriteMem, and IntrArgMemOnly intrinsic
properties differ from their corresponding LLVM IR attributes by specifying
that the intrinsic, in addition to its memory properties, has no other side
effects.

The IntrHasSideEffects flag used in combination with one of the memory flags
listed above, makes it possible to define an intrinsic such that its
properties at the CodeGen layer match its properties at the IR layer.

Patch by Tom Stellard

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 21:01:46 +00:00
Matt Arsenault
ea376dae25 Add speculatable function attribute
This attribute tells the optimizer that the function may be speculated.

Patch by Tom Stellard

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301680 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 20:25:27 +00:00
Simon Pilgrim
452c525cff Fixed assert message to correctly refer to MRMSrcReg4VOp3Frm/MRMSrcMeg4VOp3Frm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301544 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 14:25:04 +00:00
Igor Breger
a620093752 [globalisel][tablegen] Fix vector element size
Summary: Fix vector element size.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: rovka, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301421 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 15:59:05 +00:00
Reid Kleckner
154994d2b5 [git-llvm] Remove CR from middle of svn propget output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 22:26:46 +00:00
Reid Kleckner
d403ad1ed0 [git-llvm] Make push work on CRLF files with svn:eol-style=native
Summary:
`git apply` on Windows doesn't work for files that SVN checks out as
CRLF. There is no way to force SVN to check everything out with Unix
line endings on Windows. Files with svn:eol-style=native will always
come out with CRLF, breaking `git apply`, which wants Unix line endings.
My workaround is to list all files with this property set in the change,
and run `dos2unix` on them. SVN doesn't commit a massive line ending
change because the svn:eol-style property indicates that these are text
files.

Tested on r301245.

Reviewers: zturner, jlebar

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 22:09:08 +00:00
Daniel Sanders
4a4290955c [globalisel][tablegen] Add support for RegisterOperand.
Summary:
It functions just like RegisterClass except that the class is obtained
from a field.

Depends on D31761.

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

Reviewed By: ab

Subscribers: dberris, llvm-commits, igorb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-22 15:53:21 +00:00
Daniel Sanders
cc3830e7da [globalisel][tablegen] Revise API for ComplexPattern operands to improve flexibility.
Summary:
Some targets need to be able to do more complex rendering than just adding an
operand or two to an instruction. For example, it may need to insert an
instruction to extract a subreg first, or it may need to perform an operation
on the operand.

In SelectionDAG, targets would create SDNode's to achieve the desired effect
during the complex pattern predicate. This worked because SelectionDAG had a
form of garbage collection that would take care of SDNode's that were created
but not used due to a later predicate rejecting a match. This doesn't translate
well to GlobalISel and the churn was wasteful.

The API changes in this patch enable GlobalISel to accomplish the same thing
without the waste. The API is now:
	InstructionSelector::OptionalComplexRendererFn selectArithImmed(MachineOperand &Root) const;
where Root is the root of the match. The return value can be omitted to
indicate that the predicate failed to match, or a function with the signature
ComplexRendererFn can be returned. For example:
	return OptionalComplexRendererFn(
	       [=](MachineInstrBuilder &MIB) { MIB.addImm(Immed).addImm(ShVal); });
adds two immediate operands to the rendered instruction. Immed and ShVal are
captured from the predicate function.

As an added bonus, this also reduces the amount of information we need to
provide to GIComplexOperandMatcher.

Depends on D31418

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

Reviewed By: ab

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-22 15:11:04 +00:00
Daniel Sanders
caed319d51 [globalisel][tablegen] Fix PR32733 by checking which instruction operands belong to.
canMutate() was returning true when the operands were all in the same order as
the matched instruction. However, it wasn't checking the operands were actually
on that instruction. This worked when we could only match a single instruction
but the addition of nested instruction matching led to cases where the operands
could be split across multiple instructions. canMutate() now returns false if
operands belong to instructions other than the root of the match.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301077 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-22 14:31:28 +00:00
Daniel Sanders
e8660ea63d [globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivalent in GIRule.
Summary:
The SelectionDAG importer now imports rules with Predicate's attached via
Requires, PredicateControl, etc. These predicates are implemented as
bitset's to allow multiple predicates to be tested together. However,
unlike the MC layer subtarget features, each target only pays for it's own
predicates (e.g. AArch64 doesn't have 192 feature bits just because X86
needs a lot).

Both AArch64 and X86 derive at least one predicate from the MachineFunction
or Function so they must re-initialize AvailableFeatures before each
function. They also declare locals in <Target>InstructionSelector so that
computeAvailableFeatures() can use the code from SelectionDAG without
modification.

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

Reviewed By: rovka

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300993 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 15:59:56 +00:00
Daniel Sanders
9eb6db17b6 Revert r300964 + r300970 - [globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivalent in GIRule.
It's causing llvm-clang-x86_64-expensive-checks-win to fail to compile and I
haven't worked out why. Reverting to make it green while I figure it out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300978 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 14:09:20 +00:00
Daniel Sanders
20f23a27dd [globalisel][tablegen] Try again to fix builds on old MSVC's after r300964
This should fix llvm-clang-x86_64-expensive-checks-win

I reproduced the error using the following code:
namespace llvm {
// Moving this out of the llvm namespace fixes the error.
template<unsigned NumBits> class PredicateBitsetImpl {};
}
namespace {
const unsigned MAX_SUBTARGET_PREDICATES = 11;
// This works on Clang but is broken on MSVC
//     using PredicateBitset = PredicateBitsetImpl<MAX_SUBTARGET_PREDICATES>;
// Some versions emit a syntax error here ("error C2061: syntax error: identifier
// 'PredicateBitsetImpl'") but others accept it and only emit the C3646 below.
//
// This works on Clang and MSVC
using PredicateBitset = llvm::PredicateBitsetImpl<MAX_SUBTARGET_PREDICATES>;

class Foo {
private: 
    PredicateBitset A; // error C3646: 'A': unknown override specifier
};
}



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 12:51:43 +00:00
Daniel Sanders
ec8dbe0803 Revert: r300966 - [globalisel][tablegen] Attempt to fix builds on old MSVC's after r300964
It didn't fix the builder.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300968 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 12:08:25 +00:00
Daniel Sanders
548d25c9dd [globalisel][tablegen] Attempt to fix builds on old MSVC's after r300964
This should fix llvm-clang-x86_64-expensive-checks-win


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 11:29:29 +00:00