1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

4038 Commits

Author SHA1 Message Date
Richard Smith
865f47cbb6 Fix integer undefined behavior due to signed left shift overflow in LLVM.
Reviewed offline by chandlerc.

llvm-svn: 162623
2012-08-24 23:29:28 +00:00
Jakob Stoklund Olesen
43f9c539ae Infer instruction properties from single-instruction patterns.
Previously, instructions without a primary patterns wouldn't get their
properties inferred. Now, we use all single-instruction patterns for
inference, including 'def : Pat<>' instances.

This causes a lot of instruction flags to change.

- Many instructions no longer have the UnmodeledSideEffects flag because
  their flags are now inferred from a pattern.

- Instructions with intrinsics will get a mayStore flag if they already
  have UnmodeledSideEffects and a mayLoad flag if they already have
  mayStore. This is because intrinsics properties are linear.

- Instructions with atomic_load patterns get a mayStore flag because
  atomic loads can't be reordered. The correct workaround is to create
  pseudo-instructions instead of using normal loads. PR13693.

llvm-svn: 162614
2012-08-24 22:46:53 +00:00
Jakob Stoklund Olesen
b371220285 Stop inferring isVariadic from instruction patterns.
Instructions are now only marked as variadic if they use variable_ops in
their ins list.

A variadic SDNode is typically used for call nodes that have the call
arguments as operands.

A variadic MachineInstr can actually encode a variable number of
operands, for example ARM's stm/ldm instructions. A call instruction
does not have to be variadic. The call argument registers are added as
implicit operands.

This change remove the MCID::Variadic flags from most call and return
instructions, allowing us to better verify their operands.

llvm-svn: 162599
2012-08-24 21:08:09 +00:00
Jakob Stoklund Olesen
746c77c658 Verify explicit instruction properties when they can be inferred.
It is now allowed to explicitly set hasSideEffects, mayStore, and
mayLoad on instructions with patterns.

Verify that the patterns are consistent with the explicit flags.

llvm-svn: 162569
2012-08-24 17:08:41 +00:00
Jakob Stoklund Olesen
65bc015c14 Heed guessInstructionProperties, and stop warning on redundant flags.
Emit TableGen errors if guessInstructionProperties is 0 and
instruction properties can't be inferred from patterns.

Allow explicit instruction properties even when they can be inferred.

This patch doesn't change the TableGen output. Redundant properties
are not yet verified because the tree has errors.

llvm-svn: 162516
2012-08-24 00:31:16 +00:00
Jakob Stoklund Olesen
925ae76e4b Tristate mayLoad, mayStore, and hasSideEffects.
Keep track of the set/unset state of these bits along with their
true/false values, but treat '?' as '0' for now.

llvm-svn: 162461
2012-08-23 19:34:46 +00:00
Jakob Stoklund Olesen
94b286501c Add CodeGenTarget::guessInstructionProperties.
Currently, TableGen just guesses instruction properties when it can't
infer them form patterns.

This adds a guessInstructionProperties flag to the instruction set
definition that will be used to disable guessing. The flag is intended
as a migration aid. It will be removed again when no more targets need
their properties guessed.

llvm-svn: 162460
2012-08-23 19:34:41 +00:00
Dmitri Gribenko
98218ea1ef Fix a bunch of -Wdocumentation warnings.
llvm-svn: 162446
2012-08-23 16:54:08 +00:00
Jakob Stoklund Olesen
4c8373f54e Print out the location of expanded multiclass defs in TableGen errors.
When reporting an error for a defm, we would previously only report the
location of the outer defm, which is not always where the error is.

Now we also print the location of the expanded multiclass defs:

lib/Target/X86/X86InstrSSE.td:2902:12: error: foo
  defm ADD : basic_sse12_fp_binop_s<0x58, "add", fadd, SSE_ALU_ITINS_S>,
             ^
lib/Target/X86/X86InstrSSE.td:2801:11: note: instantiated from multiclass
  defm PD : sse12_fp_packed<opc, !strconcat(OpcodeStr, "pd"), OpNode, VR128,
            ^
lib/Target/X86/X86InstrSSE.td:194:5: note: instantiated from multiclass
    def rm : PI<opc, MRMSrcMem, (outs RC:$dst), (ins RC:$src1, x86memop:$src2),
        ^

llvm-svn: 162409
2012-08-22 23:33:58 +00:00
Jim Grosbach
282ab87aef TblGen: Make asm-matcher ConvertToMCInst() table driven.
No change in interface or functionality. Purely under-the-hood
details of the generated function that change.

The X86 assembly parser is reduced in size by over 15% and ARM by
over 10%.

No performance change by my measurements.

llvm-svn: 162337
2012-08-22 01:06:23 +00:00
Chad Rosier
3ef3f1b990 Formatting. No functional change.
llvm-svn: 162292
2012-08-21 17:22:47 +00:00
Akira Hatanaka
4e1b032521 Add stub methods for mips assembly matcher.
Patch by Vladimir Medic.

llvm-svn: 162124
2012-08-17 20:16:42 +00:00
Craig Topper
bebbf04c18 Declare some for loop indices inside the for loop statement.
llvm-svn: 162085
2012-08-17 05:42:16 +00:00
Craig Topper
3fb03e8722 Fix up indentation of outputted decode function for readability.
llvm-svn: 162082
2012-08-17 05:16:15 +00:00
NAKAMURA Takumi
f77fb107af lit: Show actually created count of threads. The incorrect threads count is printed if the number of tests are less than the number of default threads.
Thanks to Vinson Lee, reported in PR13620.

llvm-svn: 162078
2012-08-17 04:15:41 +00:00
Jakob Stoklund Olesen
babff4afdb Add an MCID::Select flag and TII hooks for optimizing selects.
Select instructions pick one of two virtual registers based on a
condition, like x86 cmov. On targets like ARM that support predication,
selects can sometimes be eliminated by predicating the instruction
defining one of the operands.

Teach PeepholeOptimizer to recognize select instructions, and ask the
target to optimize them.

llvm-svn: 162059
2012-08-16 23:11:47 +00:00
Jakob Stoklund Olesen
7513042c0c Add a CoveringSubRegIndices field to SubRegIndex records.
This can be used to tell TableGen to use a specific SubRegIndex instead
of synthesizing one when discovering all sub-registers.

llvm-svn: 161982
2012-08-15 20:15:48 +00:00
Jakob Stoklund Olesen
fc7e4e26ed Make synthesized sub-register indexes available in the target namespace.
TableGen sometimes synthesizes missing sub-register indexes. Emit these
indexes as enumerators in the target namespace along with the
user-defined ones.

Also take this opportunity to stop creating new Record objects for
synthetic indexes.

llvm-svn: 161964
2012-08-15 18:00:55 +00:00
Benjamin Kramer
2217c5a829 Fix a const violation in the generated disassembler.
llvm-svn: 161940
2012-08-15 10:26:44 +00:00
Jim Grosbach
53796945f5 Switch the fixed-length disassembler to be table-driven.
Refactor the TableGen'erated fixed length disassemblmer to use a
table-driven state machine rather than a massive set of nested
switch() statements.

As a result, the ARM Disassembler (ARMDisassembler.cpp) builds much more
quickly and generates a smaller end result. For a Release+Asserts build on
a 16GB 3.4GHz i7 iMac w/ SSD:

Time to compile at -O2 (averaged w/ hot caches):
  Previous: 35.5s
  New:       8.9s

TEXT size:
  Previous: 447,251
  New:      297,661

Builds in 25% of the time previously required and generates code 66% of
the size.

Execution time of the disassembler is only slightly slower (7% disassembling
10 million ARM instructions, 19.6s vs 21.0s). The new implementation has
not yet been tuned, however, so the performance should almost certainly
be recoverable should it become a concern.

llvm-svn: 161888
2012-08-14 19:06:05 +00:00
Joerg Sonnenberger
f07e1e10a6 Add some missing includes for the build against stdcxx.
llvm-svn: 161657
2012-08-10 10:53:56 +00:00
Bob Wilson
e946057869 Use the final .version number for LLVM_MINOR_VERSION in Apple llvmCore builds.
We've switched to a 3-component version numbering scheme for Apple releases,
and with this scheme, the final number is the one most relevant for setting
LLVM_MINOR_VERSION.  <rdar://problem/12071459>

llvm-svn: 161645
2012-08-10 00:25:30 +00:00
Chad Rosier
b0454bf13e [ms-inline asm] Add a new Inline Asm Non-Standard Dialect attribute.
This new attribute is intended to be used by the backend to determine how
the inline asm string should be parsed/printed. This patch adds the 
ia_nsdialect attribute and also adds a test case to ensure the IR is
correctly parsed, but there is no functional change at this time.

The standard dialect is assumed to be AT&T.  Therefore, this attribute
should only be added to MS-style inline assembly statements, which use
the Intel dialect.  If we ever support more dialects we'll need to
add additional state to the attribute.

llvm-svn: 161641
2012-08-10 00:00:22 +00:00
Andrew Trick
75af469e99 Added MispredictPenalty to SchedMachineModel.
This replaces an existing subtarget hook on ARM and allows standard
CodeGen passes to potentially use the property.

llvm-svn: 161471
2012-08-08 02:44:16 +00:00
Bill Wendling
5e0afec8b6 Remove extraneous ';'.
llvm-svn: 161298
2012-08-04 10:31:40 +00:00
Richard Trieu
af1a72a830 Remove redundant '== true' after a comparison.
llvm-svn: 161223
2012-08-02 23:22:39 +00:00
Michael J. Spencer
6c18ae4d14 [yaml2obj] Fix build. Apparently I've gotten too familiar with C++11.
llvm-svn: 161206
2012-08-02 19:36:30 +00:00
Michael J. Spencer
9f255feb3f Add yaml2obj. A utility to convert YAML to binaries.
yaml2obj takes a textual description of an object file in YAML format
and outputs the binary equivalent. This greatly simplifies writing
tests that take binary object files as input.

llvm-svn: 161205
2012-08-02 19:16:56 +00:00
Craig Topper
3f200a7638 Add more indirection to the disassembler tables to reduce amount of space used to store the operand types and encodings. Store only the unique combinations in a separate table and store indices in the instruction table. Saves about 32K of static data.
llvm-svn: 161101
2012-08-01 07:39:18 +00:00
Michael J. Spencer
a48c593965 [obj2yaml] Print the Relocations header.
llvm-svn: 161082
2012-07-31 22:04:08 +00:00
Ted Kremenek
e8efc4633b Use regex instead of special casing clang and llvm libraries.
llvm-svn: 161065
2012-07-31 18:23:44 +00:00
Craig Topper
2c84966b00 Use uint8_t to store the InstructionContext table. Saves 768 bytes of static data.
llvm-svn: 161034
2012-07-31 06:15:39 +00:00
Craig Topper
95d5583643 Tidy up. Move for loop index declarations into for statements. Use unsigned instead of uint16_t for loop indices. Use unsigned instead of uint32_t for arguments to raw_ostream.indent.
llvm-svn: 161033
2012-07-31 06:02:05 +00:00
Craig Topper
9145aff0fc Tidy up function argument formatting.
llvm-svn: 161032
2012-07-31 05:42:02 +00:00
Craig Topper
1cae7621fc Remove trailing whitespace
llvm-svn: 161031
2012-07-31 05:28:41 +00:00
Craig Topper
4412ea4f5a Remove trailing whitespace
llvm-svn: 161030
2012-07-31 05:27:01 +00:00
Craig Topper
19fc5055ea Mark MOVZX32_NOREX as isCodeGenOnly and neverHasSideEffects. The isCodeGenOnly change allows special detection of _NOREX instructions to be removed from tablegen disassembler code.
llvm-svn: 160951
2012-07-30 06:48:11 +00:00
Craig Topper
63cf938ced Remove some unnecessary filter checks. They were already covered by IsCodeGenOnly
llvm-svn: 160950
2012-07-30 06:27:19 +00:00
Craig Topper
f02d9cd605 Remove check for sub class of X86Inst from filter function since caller guaranteed it. Replace another sub class check with ShouldBeEmitted flag since it was factored in there already.
llvm-svn: 160949
2012-07-30 05:39:34 +00:00
Craig Topper
a78fdabf13 Simplify code that filtered certain instructions in two different ways. No functional change.
llvm-svn: 160948
2012-07-30 05:10:05 +00:00
Craig Topper
5e5b8cbcd3 Remove check for f256mem from has256BitOperands as nothing depended on it and it isn't the only 256-bit memory type anyway.
llvm-svn: 160946
2012-07-30 04:53:00 +00:00
Craig Topper
8afab784a4 Remove trailing whitespace.
llvm-svn: 160945
2012-07-30 04:48:12 +00:00
Craig Topper
043e2ac679 Clean up includes.
llvm-svn: 160852
2012-07-27 06:44:02 +00:00
Jakob Stoklund Olesen
49c17daace Eliminate the large XXXSubRegTable constant arrays.
These tables were indexed by [register][subreg index] which made them,
very large and sparse.

Replace them with lists of sub-register indexes that match the existing
lists of sub-registers. MCRI::getSubReg() becomes a very short linear
search, like getSubRegIndex() already was.

llvm-svn: 160843
2012-07-27 00:10:51 +00:00
Jakob Stoklund Olesen
7031003c8d Remove support for 'CompositeIndices' and sub-register cycles.
Now that the weird X86 sub_ss and sub_sd sub-register indexes are gone,
there is no longer a need for the CompositeIndices construct in .td
files. Sub-register index composition can be specified on the
SubRegIndex itself using the ComposedOf field.

Also enforce unique names for sub-registers in TableGen. The same
sub-register cannot be available with multiple sub-register indexes.

llvm-svn: 160842
2012-07-26 23:39:50 +00:00
Craig Topper
9667d599eb Make l/q suffixes on AVX forms of scalar convert instructions consistent with their non-AVX forms.
llvm-svn: 160775
2012-07-26 07:48:28 +00:00
Jakob Stoklund Olesen
95a1a7df29 Differentially encode all MC register lists.
This simplifies MCRegisterInfo and shrinks the target descriptions a bit
more.

llvm-svn: 160758
2012-07-25 21:41:37 +00:00
Eric Christopher
39c63b7e55 Fix a "Bad fd number" error on some platforms due to a less portable
redirection in the system call.

Patch by Andy Gibbs.

llvm-svn: 160644
2012-07-23 20:54:17 +00:00
Sylvestre Ledru
bf8acb65ac Fix a typo (the the => the)
llvm-svn: 160621
2012-07-23 08:51:15 +00:00
Daniel Dunbar
e5881c76d8 lit: Use close_fds=True on UNIX, to avoid file descriptor pollution of
subprocesses.

llvm-svn: 160556
2012-07-20 18:29:34 +00:00