Commit Graph

3061 Commits

Author SHA1 Message Date
Mikhail Glushenkov 9f9b7051c7 llvmc: make switch options ZeroOrMore by default.
llvm-svn: 121822
2010-12-15 01:21:59 +00:00
Jakob Stoklund Olesen 757f0e37ea Introduce TargetRegisterInfo::getOverlaps(Reg), returning a list of all
registers that alias Reg, including itself. This is almost the same as the
existing getAliasSet() method, except for the inclusion of Reg.

The name matches the reflexive TRI::regsOverlap(x, y) relation.

It is very common to do stuff to a register and all its aliases:

  stuff(Reg)
  for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias)
    stuff(*Alias);

That can now be written as the simpler:

  for (const unsigned *Alias = TRI->getOverlaps(Reg); *Alias; ++Alias)
    stuff(*Alias);

This change requires a bit more constant space for the alias lists because Reg
is included and because the empty alias list cannot be shared any longer.

If the getAliasSet method is eventually removed, this space can be reclaimed by
sharing overlap lists. For instance, %rax and %eax have identical overlap sets.

llvm-svn: 121800
2010-12-14 23:03:42 +00:00
Jim Grosbach 509dc2a700 Add support for MC-ized encoding of tLEApcrel and tLEApcrelJT. rdar://8755755
llvm-svn: 121798
2010-12-14 22:28:03 +00:00
Bill Wendling 092a7bdf9f The tLDR et al instructions were emitting either a reg/reg or reg/imm
instruction based on the t_addrmode_s# mode and what it returned. There is some
obvious badness to this. In particular, it's hard to do MC-encoding when the
instruction may change out from underneath you after the t_addrmode_s# variable
is finally resolved.

The solution is to revert a long-ago change that merged the reg/reg and reg/imm
versions. There is the addition of several new addressing modes. They no longer
have extraneous operands associated with them. I.e., if it's reg/reg we don't
have to have a dummy zero immediate tacked on to the SDNode.

There are some obvious cleanups here, which will happen shortly.

llvm-svn: 121747
2010-12-14 03:36:38 +00:00
Owen Anderson 6d375e5637 Second attempt at make Thumb2 LEAs pseudos. This time, perform the lowering much later, which makes the entire
process cleaner.

llvm-svn: 121735
2010-12-14 00:36:49 +00:00
Bob Wilson 651eaa02b8 Remove the rest of the *_sfp Neon instruction patterns.
Use the same COPY_TO_REGCLASS approach as for the 2-register *_sfp instructions.
This change made a big difference in the code generated for the
CodeGen/Thumb2/cross-rc-coalescing-2.ll test: The coalescer is still doing
a fine job, but some instructions that were previously moved outside the loop
are not moved now.  It's using fewer VFP registers now, which is generally
a good thing, so I think the estimates for register pressure changed and that
affected the LICM behavior.  Since that isn't obviously wrong, I've just
changed the test file.  This completes the work for Radar 8711675.

llvm-svn: 121730
2010-12-13 23:02:37 +00:00
Owen Anderson 9a4d42855d Revert r121721, which broke buildbots.
llvm-svn: 121726
2010-12-13 22:51:08 +00:00
Owen Anderson 4efa445f3c Make Thumb2 LEA-like instruction into pseudos, which map down to ADR. Provide correct fixups for Thumb2 ADR,
which is _of course_ different from ARM ADR fixups, or any other Thumb2 fixup.

llvm-svn: 121721
2010-12-13 22:29:52 +00:00
Owen Anderson 578074b2f3 In Thumb2, direct branches can be encoded as either a "short" conditional branch with a null predicate, or
as a "long" direct branch.  While the mnemonics are the same, they encode the branch offset differently, and
the Darwin assembler appears to prefer the "long" form for direct branches.  Thus, in the name of bitwise
equivalence, provide encoding and fixup support for it.

llvm-svn: 121710
2010-12-13 19:31:11 +00:00
Bill Wendling 73ce4a6fd8 Add support for using the `!if' operator when initializing variables:
class A<bit a, bits<3> x, bits<3> y> {
    bits<3> z;
    let z = !if(a, x, y);
  }

The variable z will get the value of x when 'a' is 1 and 'y' when a is '0'.

llvm-svn: 121666
2010-12-13 01:46:19 +00:00
Bill Wendling 5343836f2d Move <map> include out of .h and into .cpp.
llvm-svn: 121661
2010-12-13 01:05:54 +00:00
Bill Wendling dc913e64d7 Merge DEBUG statements.
llvm-svn: 121660
2010-12-13 01:03:49 +00:00
Chris Lattner 77d369c8eb eliminate the Records global variable, patch by Garrison Venn!
llvm-svn: 121659
2010-12-13 00:23:57 +00:00
Chris Lattner 9704907aac clean up RecordKeeper::getAllDerivedDefinitions, patch by Garrison Venn!
llvm-svn: 121658
2010-12-13 00:20:52 +00:00
Bill Wendling 73a48d83b2 Get rid of ellipses.
llvm-svn: 121589
2010-12-10 22:54:30 +00:00
Jim Grosbach e119da1146 Thumb unconditional branch binary encoding. rdar://8754994
llvm-svn: 121496
2010-12-10 18:21:33 +00:00
Jim Grosbach 78485ad65e Thumb conditional branch binary encodings. rdar://8745367
llvm-svn: 121493
2010-12-10 17:13:40 +00:00
Bob Wilson 4959014850 The Neon vqdmlsl_lane and vqdmlal_lane intrinsics have 4 arguments, not 3.
llvm-svn: 121469
2010-12-10 06:37:53 +00:00
Devang Patel 3967ef8df3 Add initial support to measure local variables.
llvm-svn: 121428
2010-12-09 23:18:58 +00:00
Jim Grosbach 529c7e8d1f Thumb needs a few different encoding schemes for branch targets. Rename
t_brtarget to be more specific.

llvm-svn: 121398
2010-12-09 19:01:46 +00:00
Bob Wilson 47206b840b 80-column fixes.
llvm-svn: 121395
2010-12-09 18:43:35 +00:00
Bob Wilson 38c3ca78e6 Add a license comment to the generated arm_neon.h header.
Remove the previous header.  I don't think we need to expose to end users
that we use TableGen to produce our version of arm_neon.h, and that header
was also using doubleslash comments which could be a problem when using it
in strict C89 compilations.

llvm-svn: 121390
2010-12-09 18:31:01 +00:00
Michael J. Spencer 5078434ff3 Missed FileUpdate because CMake doesn't build it yet :(.
llvm-svn: 121385
2010-12-09 17:48:55 +00:00
Michael J. Spencer 7b6fef82d4 Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
llvm-svn: 121379
2010-12-09 17:36:48 +00:00
Bill Wendling 3392bfc8f3 The BLX instruction is encoded differently than the BL, because why not? In
particular, the immediate has 20-bits of value instead of 21. And bit 0 is '0'
always. Going through the BL fixup encoding was trashing the "bit 0 is '0'"
invariant.

Attempt to get the encoding at slightly more correct with this.

llvm-svn: 121336
2010-12-09 00:39:08 +00:00
Bill Wendling a7d6aa902a Support the "target" encodings for the CB[N]Z instructions.
llvm-svn: 121308
2010-12-08 23:01:43 +00:00
Bob Wilson 4868ba0619 Add operators for "_lane" variants of some saturating Neon multiply intrinsics
so they can be implemented without separate clang builtins.

llvm-svn: 121299
2010-12-08 22:36:08 +00:00
Bob Wilson dbe9e7e3dd Add operators for vabdl and vabal so they can be implemented without builtins.
llvm-svn: 121287
2010-12-08 21:39:04 +00:00
Bob Wilson bf74755e62 Remove unused function parameter.
llvm-svn: 121286
2010-12-08 21:39:00 +00:00
Bob Wilson 194ad82666 Add an operator for vaba so it can be implemented using vabd.
llvm-svn: 121276
2010-12-08 20:09:10 +00:00
Bill Wendling 55bc7187ac Use this new fangled StringSwitch technology.
llvm-svn: 121273
2010-12-08 20:02:49 +00:00
Bill Wendling 4182a16930 Cleanup table a bit.
llvm-svn: 121250
2010-12-08 13:03:15 +00:00
Bill Wendling 8a6449c46e Add support for loading from a constant pool.
llvm-svn: 121226
2010-12-08 01:57:09 +00:00
Bob Wilson 97b44b5b4a Add operators for vadd[lw] and vsub[lw]
so they can be implemented without clang builtins.

llvm-svn: 121213
2010-12-08 00:14:04 +00:00
Bob Wilson c40935fa0c Add operators for vmlal{_n,_lane} and vmlsl{_n,_lane}
so they can be implemented without clang builtins.

llvm-svn: 121209
2010-12-07 23:53:37 +00:00
Bob Wilson 7a36c68748 Emit vmovl intrinsics first in the arm_neon.h header
so they can be used in the implementations of other intrinsics.

llvm-svn: 121208
2010-12-07 23:53:32 +00:00
Jim Grosbach fb116aed60 Add source Record* reference to PatternToMatch. Allows better diagnostics.
llvm-svn: 121196
2010-12-07 23:05:49 +00:00
Bob Wilson 361afe4ef2 Add an operator for vdup_lane so it can be implemented without a clang builtin.
llvm-svn: 121190
2010-12-07 22:39:24 +00:00
Bob Wilson 17a233c0e5 Add an operator for vmull_lane so it can be implemented without a clang builtin.
llvm-svn: 121187
2010-12-07 22:02:48 +00:00
Devang Patel eea0fd0942 Handle recursive values. Add comments.
llvm-svn: 121184
2010-12-07 21:12:05 +00:00
Jim Grosbach f878e62a0d Remove reference to the CMPz instruction patterns for ARM.
llvm-svn: 121180
2010-12-07 20:44:33 +00:00
Bob Wilson 192336b865 Add new built-in operations for vmull and vmull_n
so they can be implemented without requiring clang builtins.
Radar 8446238.

llvm-svn: 121173
2010-12-07 20:02:45 +00:00
Jim Grosbach 8656d82b5b Trailing whitespace.
llvm-svn: 121167
2010-12-07 19:36:07 +00:00
Jim Grosbach e99956eb3e Change assert to diagnostic. Message still needs work, but it's better than
an assert, at least.

llvm-svn: 121166
2010-12-07 19:35:36 +00:00
NAKAMURA Takumi 182ea825a9 utils/lit/lit/TestFormats.py: [PR8438] unittests: Seek *Tests (not BUILD_MODE/*Tests) under whole unittests/ if BUILD_MODE == '.'
llvm-svn: 121118
2010-12-07 07:41:32 +00:00
Bob Wilson 654db47903 Add an OpReinterpret operation to TableGen's NeonEmitter.
An OpReinterpret entry is handled by translating it to OpCast intrinsics for
all combinations of source and destination types with the same total size.
This will be used to generate all the vreinterpret intrinsics.

llvm-svn: 121087
2010-12-07 01:12:23 +00:00
Bob Wilson b87116e30a Fix whitespace.
llvm-svn: 121086
2010-12-07 01:12:19 +00:00
Devang Patel 52700c348b Add python scripts to extract debug info using LLDB and do comparison.
llvm-svn: 121079
2010-12-07 00:34:59 +00:00
Jim Grosbach 9e1994698d Add fixup for Thumb1 BL/BLX instructions.
llvm-svn: 121072
2010-12-06 23:57:07 +00:00
Michael J. Spencer 459a6f150a KillTheDoctor: Cleanup error_code usage.
llvm-svn: 120986
2010-12-06 04:28:01 +00:00