oota-llvm.git
14 years agogo to great lengths to work around a GAS bug my previous patch
Chris Lattner [Sat, 6 Nov 2010 21:37:06 +0000 (21:37 +0000)]
go to great lengths to work around a GAS bug my previous patch
exposed:

GAS doesn't accept "fcomip %st(1)", it requires "fcomip %st(1), %st(0)"
even though st(0) is implicit in all other fp stack instructions.

Fortunately, there is an alias for fcomip named "fcompi" and gas does
accept the default argument for the alias (boggle!).

As such, switch the canonical form of this instruction to "pi" instead
of "ip".  This makes the code generator and disassembler generate pi,
avoiding the gas bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118356 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorework the rotate-by-1 instructions to be defined like the
Chris Lattner [Sat, 6 Nov 2010 21:23:40 +0000 (21:23 +0000)]
rework the rotate-by-1 instructions to be defined like the
shift-by-1 instructions, where the asmstring doesn't contain
the implicit 1.  It turns out that a bunch of these rotate
instructions were completely broken because they used 1
instead of $1.

This fixes assembly mismatches on "rclb $1, %bl" and friends,
where we used to generate the 3 byte form, we now generate the
proper 2-byte form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118355 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agochange the fp comparison instructions to not have %st0 explicitly
Chris Lattner [Sat, 6 Nov 2010 20:55:09 +0000 (20:55 +0000)]
change the fp comparison instructions to not have %st0 explicitly
listed in its asm string, for consistency with the other similar
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118354 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove the plethora of fp stack aliases to the .td file.
Chris Lattner [Sat, 6 Nov 2010 20:47:38 +0000 (20:47 +0000)]
move the plethora of fp stack aliases to the .td file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118353 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd (and document) the ability for alias results to have
Chris Lattner [Sat, 6 Nov 2010 19:57:21 +0000 (19:57 +0000)]
add (and document) the ability for alias results to have
fixed physical registers.  Start moving fp comparison
aliases to the .td file (which default to using %st1 if
nothing is specified).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118352 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a RegList (register list) object to ARMOperand. It will be used soon to hold
Bill Wendling [Sat, 6 Nov 2010 19:56:04 +0000 (19:56 +0000)]
Add a RegList (register list) object to ARMOperand. It will be used soon to hold
(surprise!) a list of registers. Register lists are consecutive, so we only need
to record the start register plus the number of registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118351 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agogeneralize alias support to allow the result of an alias to
Chris Lattner [Sat, 6 Nov 2010 19:25:43 +0000 (19:25 +0000)]
generalize alias support to allow the result of an alias to
add fixed immediate values.  Move the aad and aam aliases to
use this, and document it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118350 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove fnstsw aliases to .td file, fix typo
Chris Lattner [Sat, 6 Nov 2010 18:58:32 +0000 (18:58 +0000)]
move fnstsw aliases to .td file, fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118349 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove in/out aliases to the .td files.
Chris Lattner [Sat, 6 Nov 2010 18:52:40 +0000 (18:52 +0000)]
move in/out aliases to the .td files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118348 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove sldt, imul, and movabsq aliases from c++ to .td file.
Chris Lattner [Sat, 6 Nov 2010 18:44:26 +0000 (18:44 +0000)]
move sldt, imul, and movabsq aliases from c++ to .td file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118347 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agocorrect suffix matching to search for s/l/t suffixes on
Chris Lattner [Sat, 6 Nov 2010 18:28:02 +0000 (18:28 +0000)]
correct suffix matching to search for s/l/t suffixes on
floating point stack instructions instead of looking for b/w/l/q.

This fixes issues where we'd accidentally match fistp to fistpl,
when it is in fact an ambiguous instruction.

This changes the behavior of llvm-mc to reject fstp, which was the
correct fix for rdar://8456389:
t.s:1:1: error: ambiguous instructions require an explicit suffix (could be 'fstps', 'fstpl', or 'fstpt')
fstp (%rax)

it also causes us to correctly reject fistp and fist, which addresses
PR8528:

t.s:2:1: error: ambiguous instructions require an explicit suffix (could be 'fistps', or 'fistpl')
fistp (%rax)
^
t.s:3:1: error: ambiguous instructions require an explicit suffix (could be 'fists', or 'fistl')
fist (%rax)
^

Thanks to Ismail Donmez for tracking down the issue here!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118346 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPrune includes.
Benjamin Kramer [Sat, 6 Nov 2010 11:45:59 +0000 (11:45 +0000)]
Prune includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118342 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix grammar.
Bill Wendling [Sat, 6 Nov 2010 10:51:53 +0000 (10:51 +0000)]
Fix grammar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118341 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix grammar.
Bill Wendling [Sat, 6 Nov 2010 10:48:18 +0000 (10:48 +0000)]
Fix grammar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118340 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMatchRegisterName() returns 0 if it can't match the register.
Bill Wendling [Sat, 6 Nov 2010 10:45:34 +0000 (10:45 +0000)]
MatchRegisterName() returns 0 if it can't match the register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118339 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse TryParseRegister() instead of MatchRegisterName(). The former returns -1
Bill Wendling [Sat, 6 Nov 2010 10:40:24 +0000 (10:40 +0000)]
Use TryParseRegister() instead of MatchRegisterName(). The former returns -1
while the latter doesn't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118338 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a note.
Benjamin Kramer [Sat, 6 Nov 2010 10:37:16 +0000 (10:37 +0000)]
Add a note.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118337 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodocument instalias.
Chris Lattner [Sat, 6 Nov 2010 08:30:26 +0000 (08:30 +0000)]
document instalias.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118335 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a bug where we had an implicit assumption that the
Chris Lattner [Sat, 6 Nov 2010 08:20:59 +0000 (08:20 +0000)]
fix a bug where we had an implicit assumption that the
result instruction operand numbering matched the result pattern.

Fixing this allows us to move the xchg/test aliases to the .td file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118334 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure we have movw on the target before using it.
Eric Christopher [Sat, 6 Nov 2010 07:53:11 +0000 (07:53 +0000)]
Make sure we have movw on the target before using it.

Fixes 8559.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118333 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove the lcall/ljmp aliases to the .td file.
Chris Lattner [Sat, 6 Nov 2010 07:48:45 +0000 (07:48 +0000)]
move the lcall/ljmp aliases to the .td file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118332 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove the "movsd -> movsl" alias to the .td files,
Chris Lattner [Sat, 6 Nov 2010 07:34:58 +0000 (07:34 +0000)]
move the "movsd -> movsl" alias to the .td files,
tidy up the movsx and movzx aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118331 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix some bugs in the alias support, unblocking changing of "clr" aliases
Chris Lattner [Sat, 6 Nov 2010 07:31:43 +0000 (07:31 +0000)]
fix some bugs in the alias support, unblocking changing of "clr" aliases
from c++ hacks to proper .td InstAlias definitions.  Change them!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118330 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReimplement BuildResultOperands to be in terms of the result instruction's
Chris Lattner [Sat, 6 Nov 2010 07:14:44 +0000 (07:14 +0000)]
Reimplement BuildResultOperands to be in terms of the result instruction's
operand list instead of the operand list redundantly declared on the alias
or instruction.

With this change, we finally remove the ins/outs list on the alias.  Before:
  def : InstAlias<(outs GR16:$dst), (ins GR8 :$src),
                  "movsx $src, $dst",
                  (MOVSX16rr8W GR16:$dst, GR8:$src)>;
After:
  def : InstAlias<"movsx $src, $dst",
                  (MOVSX16rr8W GR16:$dst, GR8:$src)>;

This also makes the alias mechanism more general and powerful, which will
be exploited in subsequent patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118329 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimplement more checking to reject things like:
Chris Lattner [Sat, 6 Nov 2010 07:06:09 +0000 (07:06 +0000)]
implement more checking to reject things like:
  (someinst GR16:$foo, GR32:$foo)

Reimplement BuildAliasOperandReference to be correctly
based on the names of operands in the result pattern,
instead of on the instruction operand definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118328 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodecode and validate instruction alias result definitions.
Chris Lattner [Sat, 6 Nov 2010 06:54:38 +0000 (06:54 +0000)]
decode and validate instruction alias result definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118327 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify
Chris Lattner [Sat, 6 Nov 2010 06:45:08 +0000 (06:45 +0000)]
simplify

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118326 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix another fixme, replacing a string with a semantic pointer.
Chris Lattner [Sat, 6 Nov 2010 06:43:11 +0000 (06:43 +0000)]
fix another fixme, replacing a string with a semantic pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118325 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodisolve a hack, having CodeGenInstAlias decode the alias in the .td
Chris Lattner [Sat, 6 Nov 2010 06:39:47 +0000 (06:39 +0000)]
disolve a hack, having CodeGenInstAlias decode the alias in the .td
file instead of the asmmatcher.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118324 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoHook up the '.code {16|32}' directive to the streamer.
Jim Grosbach [Fri, 5 Nov 2010 22:40:53 +0000 (22:40 +0000)]
Hook up the '.code {16|32}' directive to the streamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118310 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd '.code 32' assembler directive to MC streamers.
Jim Grosbach [Fri, 5 Nov 2010 22:40:09 +0000 (22:40 +0000)]
Add '.code 32' assembler directive to MC streamers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118309 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoHook up the '.thumb_func' directive to the streamer.
Jim Grosbach [Fri, 5 Nov 2010 22:33:53 +0000 (22:33 +0000)]
Hook up the '.thumb_func' directive to the streamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118307 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix past-o.
Jim Grosbach [Fri, 5 Nov 2010 22:11:33 +0000 (22:11 +0000)]
Fix past-o.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118304 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC'ize the '.code 16' and '.thumb_func' ARM directives.
Jim Grosbach [Fri, 5 Nov 2010 22:08:08 +0000 (22:08 +0000)]
MC'ize the '.code 16' and '.thumb_func' ARM directives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118301 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDisallow the certain NEON modified-immediate forms when generating vorr or vbic.
Owen Anderson [Fri, 5 Nov 2010 21:57:54 +0000 (21:57 +0000)]
Disallow the certain NEON modified-immediate forms when generating vorr or vbic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118300 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTrailing whitespace.
Jim Grosbach [Fri, 5 Nov 2010 20:41:12 +0000 (20:41 +0000)]
Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118296 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC'ize simple ARMConstantValue entry emission (with a FIXME).
Jim Grosbach [Fri, 5 Nov 2010 20:34:24 +0000 (20:34 +0000)]
MC'ize simple ARMConstantValue entry emission (with a FIXME).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118295 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPut class into an anonymous namespace.
Benjamin Kramer [Fri, 5 Nov 2010 19:56:38 +0000 (19:56 +0000)]
Put class into an anonymous namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118294 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd codegen and encoding support for the immediate form of vbic.
Owen Anderson [Fri, 5 Nov 2010 19:27:46 +0000 (19:27 +0000)]
Add codegen and encoding support for the immediate form of vbic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118291 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnable MachO writing for ARM/Darwin. Lots of stuff still doesn't work
Jim Grosbach [Fri, 5 Nov 2010 18:50:35 +0000 (18:50 +0000)]
Enable MachO writing for ARM/Darwin. Lots of stuff still doesn't work
(relocations, e.g.), but this will allow simple things to flow through.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118289 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAllow targets to specify the MachO CPUType/CPUSubtype information.
Jim Grosbach [Fri, 5 Nov 2010 18:48:58 +0000 (18:48 +0000)]
Allow targets to specify the MachO CPUType/CPUSubtype information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118288 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosyntaxunified directive is a no-op for MachO writing.
Jim Grosbach [Fri, 5 Nov 2010 18:47:32 +0000 (18:47 +0000)]
syntaxunified directive is a no-op for MachO writing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118287 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd v5 and v7 ARM CPU subtype values.
Jim Grosbach [Fri, 5 Nov 2010 17:48:05 +0000 (17:48 +0000)]
Add v5 and v7 ARM CPU subtype values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118281 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd FIXME.
Jim Grosbach [Fri, 5 Nov 2010 17:37:13 +0000 (17:37 +0000)]
Add FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118280 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen passing a parameter using the 'byval' mechanism, inline code needs to be used
Duncan Sands [Fri, 5 Nov 2010 15:20:29 +0000 (15:20 +0000)]
When passing a parameter using the 'byval' mechanism, inline code needs to be used
to perform the copy, which may be of lots of memory [*].  It would be good if the
fall-back code generated something reasonable, i.e. did the copy in a loop, rather
than vast numbers of loads and stores.  Add a note about this.  Currently target
specific code seems to always kick in so this is more of a theoretical issue rather
than a practical one now that X86 has been fixed.
[*] It's amazing how often people pass mega-byte long arrays by copy...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118275 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCrashRecoveryContext: Add RunSafelyOnThread helper function.
Daniel Dunbar [Fri, 5 Nov 2010 07:19:09 +0000 (07:19 +0000)]
CrashRecoveryContext: Add RunSafelyOnThread helper function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118272 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen passing a huge parameter using the byval mechanism, a long
Duncan Sands [Thu, 4 Nov 2010 21:16:46 +0000 (21:16 +0000)]
When passing a huge parameter using the byval mechanism, a long
sequence of loads and stores was being generated to perform the
copy on the x86 targets if the parameter was less than 4 byte
aligned, causing llc to use up vast amounts of memory and time.
Use a "rep movs" form instead.  PR7170.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118260 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse arrays instead of constant-sized SmallVectors.
Benjamin Kramer [Thu, 4 Nov 2010 18:45:27 +0000 (18:45 +0000)]
Use arrays instead of constant-sized SmallVectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118257 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd 118023 back, but with proper spelling for .uleb128/.sleb128.
Rafael Espindola [Thu, 4 Nov 2010 18:17:08 +0000 (18:17 +0000)]
Add 118023 back, but with proper spelling for .uleb128/.sleb128.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118254 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert previous patch. Some targets don't support uleb and say
Rafael Espindola [Thu, 4 Nov 2010 17:04:24 +0000 (17:04 +0000)]
Revert previous patch. Some targets don't support uleb and say
they do :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118250 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMCize.
Rafael Espindola [Thu, 4 Nov 2010 16:32:18 +0000 (16:32 +0000)]
MCize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118249 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIntroduce DIBuilder. It is intended to be a front-end friendly interface to emit...
Devang Patel [Thu, 4 Nov 2010 15:01:38 +0000 (15:01 +0000)]
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.

To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
                                       TheCU, "", getOrCreateMainFile(),
                                       0, Size, 0, 0, 0, OCTy);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd getFile() to get DIFile of a DIType.
Devang Patel [Thu, 4 Nov 2010 14:56:34 +0000 (14:56 +0000)]
Add getFile() to get DIFile of a DIType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118247 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIn the calling convention logic, ValVT is always a legal type,
Duncan Sands [Thu, 4 Nov 2010 10:49:57 +0000 (10:49 +0000)]
In the calling convention logic, ValVT is always a legal type,
and as such can be represented by an MVT - the more complicated
EVT is not needed.  Use MVT for ValVT everywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118245 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix @llvm.prefetch isel. Selecting between pld / pldw using the first immediate rw...
Evan Cheng [Thu, 4 Nov 2010 05:19:35 +0000 (05:19 +0000)]
Fix @llvm.prefetch isel. Selecting between pld / pldw using the first immediate rw. There is currently no intrinsic that matches to pli.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118237 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agopartition operand processing between aliases and instructions.
Chris Lattner [Thu, 4 Nov 2010 02:11:18 +0000 (02:11 +0000)]
partition operand processing between aliases and instructions.
Right now the code is partitioned but the behavior is the same.
This should be improved in the near future.   This removes some
uses of TheOperandList.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118232 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agopull name slicing out of BuildInstructionOperandReference so
Chris Lattner [Thu, 4 Nov 2010 01:58:23 +0000 (01:58 +0000)]
pull name slicing out of BuildInstructionOperandReference so
it doesn't do any lexical stuff anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118230 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agocleanups.
Chris Lattner [Thu, 4 Nov 2010 01:55:23 +0000 (01:55 +0000)]
cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118228 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoreplace SrcOpNum with SrcOpName, eliminating a numering dependency
Chris Lattner [Thu, 4 Nov 2010 01:42:59 +0000 (01:42 +0000)]
replace SrcOpNum with SrcOpName, eliminating a numering dependency
on the incoming operand list.  This also makes the code simpler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118225 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSystem: Add llvm_execute_on_thread, which does what it says.
Daniel Dunbar [Thu, 4 Nov 2010 01:26:25 +0000 (01:26 +0000)]
System: Add llvm_execute_on_thread, which does what it says.
 - Primarily useful for running some code with a specified stack size, when
   pthreads are available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118222 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd ARM fixup info for load/store label references. Probably will need a bit of
Jim Grosbach [Thu, 4 Nov 2010 01:12:30 +0000 (01:12 +0000)]
Add ARM fixup info for load/store label references. Probably will need a bit of
tweaking when we start using it for object file emission or JIT, but it's a
start.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118221 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd encoding for VSTR.
Bill Wendling [Thu, 4 Nov 2010 00:59:42 +0000 (00:59 +0000)]
Add encoding for VSTR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118220 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agostrength reduce some code, resolving a fixme.
Chris Lattner [Thu, 4 Nov 2010 00:57:06 +0000 (00:57 +0000)]
strength reduce some code, resolving a fixme.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118219 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotake a big step to making aliases more general and less of a hack:
Chris Lattner [Thu, 4 Nov 2010 00:43:46 +0000 (00:43 +0000)]
take a big step to making aliases more general and less of a hack:
now matchables contain an explicit list of how to populate each
operand in the result instruction instead of having them somehow
magically be correlated to the input inst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118217 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDisable fancy splitting during spilling unless -extra-spiller-splits is given.
Jakob Stoklund Olesen [Thu, 4 Nov 2010 00:32:32 +0000 (00:32 +0000)]
Disable fancy splitting during spilling unless -extra-spiller-splits is given.

This way, InlineSpiller does the same amount of splitting as the standard
spiller. Splitting should really be guided by the register allocator, and
doesn't belong in the spiller at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118216 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach ARM Target to use the tblgen support for generating an MC'ized
Jim Grosbach [Wed, 3 Nov 2010 23:52:49 +0000 (23:52 +0000)]
Teach ARM Target to use the tblgen support for generating an MC'ized
CodeEmitter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118209 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd rule to build MC'ized CodeEmitter.
Jim Grosbach [Wed, 3 Nov 2010 23:46:01 +0000 (23:46 +0000)]
Add rule to build MC'ized CodeEmitter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118207 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport generating an MC'ized CodeEmitter directly. Maintain a reference to the
Jim Grosbach [Wed, 3 Nov 2010 23:38:14 +0000 (23:38 +0000)]
Support generating an MC'ized CodeEmitter directly. Maintain a reference to the
Fixups list for the instruction so the operand encoders can add to it as
needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118206 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCovert VORRIMM to be produced via early target-specific DAG combining, rather than...
Owen Anderson [Wed, 3 Nov 2010 23:15:26 +0000 (23:15 +0000)]
Covert VORRIMM to be produced via early target-specific DAG combining, rather than legalization.
This is both the conceptually correct place for it, as well as allowing it to be more aggressive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118204 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support for code generation of the one register with immediate form of vorr.
Owen Anderson [Wed, 3 Nov 2010 22:44:51 +0000 (22:44 +0000)]
Add support for code generation of the one register with immediate form of vorr.
We could be more aggressive about making this work for a larger range of constants,
but this seems like a good start.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118201 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotrailing whitespace
Jim Grosbach [Wed, 3 Nov 2010 22:03:20 +0000 (22:03 +0000)]
trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118199 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoJust return undef for invalid masks or elts, and since we're doing that,
Eric Christopher [Wed, 3 Nov 2010 20:44:42 +0000 (20:44 +0000)]
Just return undef for invalid masks or elts, and since we're doing that,
just do it earlier too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118195 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLet RegAllocBasic require MachineDominators - they are already available and
Jakob Stoklund Olesen [Wed, 3 Nov 2010 20:39:26 +0000 (20:39 +0000)]
Let RegAllocBasic require MachineDominators - they are already available and
splitting needs them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118194 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTag debug output as regalloc
Jakob Stoklund Olesen [Wed, 3 Nov 2010 20:39:23 +0000 (20:39 +0000)]
Tag debug output as regalloc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118193 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOptimize generated code for integer materialization a bit.
Eric Christopher [Wed, 3 Nov 2010 20:21:17 +0000 (20:21 +0000)]
Optimize generated code for integer materialization a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118192 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename Operand -> AsmOperand for clarity.
Chris Lattner [Wed, 3 Nov 2010 19:47:34 +0000 (19:47 +0000)]
rename Operand -> AsmOperand for clarity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118190 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix test.
Evan Cheng [Wed, 3 Nov 2010 18:21:33 +0000 (18:21 +0000)]
Fix test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118187 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUnlike a lot of NEON instructions, vext isn't _actually_ parameterized by element...
Owen Anderson [Wed, 3 Nov 2010 18:16:27 +0000 (18:16 +0000)]
Unlike a lot of NEON instructions, vext isn't _actually_ parameterized by element size.  Instead,
all of the different element sizes are pseudo instructions that map down to vext.8 underneath, with
the immediate shifted left to reflect the increased element size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118183 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThis test assumes SSE is present; that is not the default
Dale Johannesen [Wed, 3 Nov 2010 18:08:41 +0000 (18:08 +0000)]
This test assumes SSE is present; that is not the default
on non-X86 hosts.  Hopefully fixes ppc-host buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118182 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd codegen patterns for VST1-lane instructions. Radar 8599955.
Bob Wilson [Wed, 3 Nov 2010 16:24:53 +0000 (16:24 +0000)]
Add codegen patterns for VST1-lane instructions.  Radar 8599955.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118176 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCheck for extractelement with a variable operand for the element number.
Bob Wilson [Wed, 3 Nov 2010 16:24:50 +0000 (16:24 +0000)]
Check for extractelement with a variable operand for the element number.
For NEON we had been assuming this was always an immediate constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118175 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename FindExecutable to PrependMainExecutablePath.
Mikhail Glushenkov [Wed, 3 Nov 2010 16:14:16 +0000 (16:14 +0000)]
Rename FindExecutable to PrependMainExecutablePath.

Makes it more clear that it is just a path manipulation function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118174 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago80-col violations, trailing whitespace.
Mikhail Glushenkov [Wed, 3 Nov 2010 16:14:07 +0000 (16:14 +0000)]
80-col violations, trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118173 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename PointsToLocalMemory to PointsToLocalOrConstantMemory to make
Duncan Sands [Wed, 3 Nov 2010 14:45:05 +0000 (14:45 +0000)]
Rename PointsToLocalMemory to PointsToLocalOrConstantMemory to make
the code more self-documenting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118171 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify uses of MVT and EVT. An MVT can be compared directly
Duncan Sands [Wed, 3 Nov 2010 12:17:33 +0000 (12:17 +0000)]
Simplify uses of MVT and EVT.  An MVT can be compared directly
with a SimpleValueType, while an EVT supports equality and
inequality comparisons with SimpleValueType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118169 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a comment typo.
Duncan Sands [Wed, 3 Nov 2010 11:55:03 +0000 (11:55 +0000)]
Fix a comment typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118168 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInside the calling convention logic LocVT is always a simple
Duncan Sands [Wed, 3 Nov 2010 11:35:31 +0000 (11:35 +0000)]
Inside the calling convention logic LocVT is always a simple
value type, so there is no point in passing it around using
an EVT.  Use the simpler MVT everywhere.  Rather than trying
to propagate this information maximally in all the code that
using the calling convention stuff, I chose to do a mainly
low impact change instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118167 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf we have an undef mask our Elt will be -1 for our access, handle
Eric Christopher [Wed, 3 Nov 2010 09:36:40 +0000 (09:36 +0000)]
If we have an undef mask our Elt will be -1 for our access, handle
this by using an undef as a pointer.

Fixes rdar://8625016

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118164 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typo, pointed out by Trevor Harmon.
Duncan Sands [Wed, 3 Nov 2010 08:16:50 +0000 (08:16 +0000)]
Fix typo, pointed out by Trevor Harmon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118163 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix preload instruction isel. Only v7 supports pli, and only v7 with mp extension...
Evan Cheng [Wed, 3 Nov 2010 06:34:55 +0000 (06:34 +0000)]
Fix preload instruction isel. Only v7 supports pli, and only v7 with mp extension supports pldw. Add subtarget attribute to denote mp extension support and legalize illegal ones to nothing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118160 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support to match @llvm.prefetch to pld / pldw / pli. rdar://8601536.
Evan Cheng [Wed, 3 Nov 2010 05:14:24 +0000 (05:14 +0000)]
Add support to match @llvm.prefetch to pld / pldw / pli. rdar://8601536.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118152 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPut the PC encoding in the correct bit position.
Bill Wendling [Wed, 3 Nov 2010 04:57:44 +0000 (04:57 +0000)]
Put the PC encoding in the correct bit position.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118151 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInvert these branches by default, it makes assembly comparisons a little
Eric Christopher [Wed, 3 Nov 2010 04:29:11 +0000 (04:29 +0000)]
Invert these branches by default, it makes assembly comparisons a little
easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118148 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThe MC code couldn't handle ARM LDR instructions with negative offsets:
Bill Wendling [Wed, 3 Nov 2010 01:49:29 +0000 (01:49 +0000)]
The MC code couldn't handle ARM LDR instructions with negative offsets:

    vldr.64 d1, [r0, #-32]

The problem was with how the addressing mode 5 encodes the offsets. This change
makes sure that the way offsets are handled in addressing mode 5 is consistent
throughout the MC code. It involves re-refactoring the "getAddrModeImmOpValue"
method into an "Imm12" and "addressing mode 5" version. But not to worry! The
majority of the duplicated code has been unified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118144 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix DAGCombiner to avoid going into an infinite loop when it
Dan Gohman [Wed, 3 Nov 2010 01:47:46 +0000 (01:47 +0000)]
Fix DAGCombiner to avoid going into an infinite loop when it
encounters (and:i64 (shl:i64 (load:i64), 1), 0xffffffff).
This fixes rdar://8606584.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118143 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove unused function.
Jim Grosbach [Wed, 3 Nov 2010 01:35:15 +0000 (01:35 +0000)]
Remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118141 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the no longer used 'Modifier' optional operand to the ARM
Jim Grosbach [Wed, 3 Nov 2010 01:11:15 +0000 (01:11 +0000)]
Remove the no longer used 'Modifier' optional operand to the ARM
printOperand() asm printer helper functions. rdar://8425198

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118140 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove unused function.
Jim Grosbach [Wed, 3 Nov 2010 01:07:48 +0000 (01:07 +0000)]
Remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118139 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBreak ARM addrmode4 (load/store multiple base address) into its constituent
Jim Grosbach [Wed, 3 Nov 2010 01:01:43 +0000 (01:01 +0000)]
Break ARM addrmode4 (load/store multiple base address) into its constituent
parts. Represent the operation mode as an optional operand instead.
rdar://8614429

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118137 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTwo sets of changes. Sorry they are intermingled.
Evan Cheng [Wed, 3 Nov 2010 00:45:17 +0000 (00:45 +0000)]
Two sets of changes. Sorry they are intermingled.

1. Fix pre-ra scheduler so it doesn't try to push instructions above calls to
   "optimize for latency". Call instructions don't have the right latency and
   this is more likely to use introduce spills.
2. Fix if-converter cost function. For ARM, it should use instruction latencies,
   not # of micro-ops since multi-latency instructions is completely executed
   even when the predicate is false. Also, some instruction will be "slower"
   when they are predicated due to the register def becoming implicit input.
   rdar://8598427

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118135 91177308-0d34-0410-b5e6-96231b3b80d8