Commit Graph

7488 Commits

Author SHA1 Message Date
Daniel Dunbar e9feb71497 Avoid a problem with ulimit on Solaris & friends, patch by Edward O'Callaghan!
llvm-svn: 77767
2009-08-01 03:37:54 +00:00
Evan Cheng e6e8289d72 Split t2MOVCCs since some assemblers do not recognize mov shifted register alias with predicate.
llvm-svn: 77764
2009-08-01 01:43:45 +00:00
Daniel Dunbar c54ecb384d llvm-mc: More quoted identifier support.
llvm-svn: 77761
2009-08-01 00:48:30 +00:00
Evan Cheng 6ab54fdb0a Fix Thumb2 function call isel. Thumb1 and Thumb2 should share the same
instructions for calls since BL and BLX are always 32-bit long and BX is always
16-bit long.

Also, we should be using BLX to call external function stubs.

llvm-svn: 77756
2009-08-01 00:16:10 +00:00
Daniel Dunbar ce24e0043e llvm-mc: Add -triple, and fix some typos
llvm-svn: 77750
2009-07-31 23:13:12 +00:00
Daniel Dunbar e0cbd9b986 llvm-mc: Fix .s output to quote section & symbol names when necessary.
llvm-svn: 77749
2009-07-31 23:04:32 +00:00
Daniel Dunbar a4fc8d94ce llvm-mc: A few more parsing / match tweaks.
- Operands which are just a label should be parsed as immediates, not memory
   operands (from the assembler perspective).

 - Match a few more flavors of immediates.

 - Distinguish match functions for memory operands which don't take a segment
   register.

 - We match the .s for "hello world" now!

llvm-svn: 77745
2009-07-31 22:22:54 +00:00
David Greene 81bcae5fda Simplify operand padding by keying off tabs in the asm stream. If
padding is disabled, tabs get replaced by spaces except in the case of
the first operand, where the tab is output to line up the operands after
the mnemonics.

Add some better comments and eliminate redundant code.

Fix some testcases to not assume tabs.

llvm-svn: 77740
2009-07-31 21:57:10 +00:00
Daniel Dunbar 9ee33ca28e llvm-mc: Support quoted identifiers.
- Uses MCAsmToken::getIdentifier which returns the (sub)string representing the
   meaningfull contents a string or identifier token.

 - Directives aren't done yet.

llvm-svn: 77739
2009-07-31 21:55:09 +00:00
Daniel Dunbar 3ebf848b47 llvm-mc/X86: Sketch match functions for immediates and memory operands.
Also, change scale value to always be 1 when unspecified to machine MachineInst
encoding.

llvm-svn: 77728
2009-07-31 20:53:16 +00:00
Eli Friedman ca9a4f1045 PR4662: Fix a crash introduced by the recent LLVMContext changes.
llvm-svn: 77716
2009-07-31 19:36:47 +00:00
Chris Lattner 4d2c0f9008 switch off of 'Section' onto MCSection. We're not properly using
MCSection subclasses yet, but this is a step in the right direction.

llvm-svn: 77708
2009-07-31 18:48:30 +00:00
Evan Cheng be8422e8e0 Until we have a "ALIGN" pseudo instruction, have asm printer emitted a .align
to ensure the instruction that follows a TBB (when the number of table entries
is odd) is 2-byte aligned.
Patch by Sandeep Patel.

llvm-svn: 77705
2009-07-31 18:35:56 +00:00
Chris Lattner fc0264a38e fix PR4650: we only track sizes for certain objects, so only put something
into the mergable section if it is one of our special cases.  This could
obviously be improved, but this is the minimal fix and restores us to the
previous behavior.

llvm-svn: 77679
2009-07-31 16:17:13 +00:00
Daniel Dunbar a93183b8c9 Add this test back, the check pattern was too strict.
llvm-svn: 77662
2009-07-31 03:11:49 +00:00
Daniel Dunbar 8f416a5138 Remove this test while I figure out why it is failing.
llvm-svn: 77659
2009-07-31 02:46:36 +00:00
Daniel Dunbar b6d6aa2d22 llvm-mc: Match a few X86 instructions.
- This is "experimental" code, I am feeling my way around and working out the
   best way to do things (and learning tblgen in the process). Comments welcome,
   but keep in mind this stuff will change radically.

 - This is enough to match "subb" and friends, but not much else. The next step is to
   automatically generate the matchers for individual operands.

llvm-svn: 77657
2009-07-31 02:32:59 +00:00
Evan Cheng 5811ab5cf3 When fp is not eliminated, instructions with T2_i12 modes will be changed to T2_i8 ones. Take that into consideration when determining stack size limit for reserving register scavenging slot.
llvm-svn: 77642
2009-07-30 23:29:25 +00:00
Devang Patel 16e5124a82 Do not use abbrev while writing NamedMDNode name.
llvm-svn: 77637
2009-07-30 23:06:35 +00:00
David Goodwin 0bfc8312c2 Darwin assembler now recognizes "orn", so remove workaround.
llvm-svn: 77627
2009-07-30 21:51:41 +00:00
David Goodwin ce774e2383 Darwin assembler now supports "rrx", so remove workaround.
llvm-svn: 77625
2009-07-30 21:38:40 +00:00
David Goodwin 79c079b478 Cleanup and include code selection for some frame index cases.
llvm-svn: 77622
2009-07-30 18:56:48 +00:00
Evan Cheng e62288fdd4 Optimize some common usage patterns of atomic built-ins __sync_add_and_fetch() and __sync_sub_and_fetch.
When the return value is not used (i.e. only care about the value in the memory), x86 does not have to use add to implement these. Instead, it can use add, sub, inc, dec instructions with the "lock" prefix.

This is currently implemented using a bit of instruction selection trick. The issue is the target independent pattern produces one output and a chain and we want to map it into one that just output a chain. The current trick is to select it into a merge_values with the first definition being an implicit_def. The proper solution is to add new ISD opcodes for the no-output variant. DAG combiner can then transform the node before it gets to target node selection.

Problem #2 is we are adding a whole bunch of x86 atomic instructions when in fact these instructions are identical to the non-lock versions. We need a way to add target specific information to target nodes and have this information carried over to machine instructions. Asm printer (or JIT) can use this information to add the "lock" prefix.

llvm-svn: 77582
2009-07-30 08:33:02 +00:00
Dan Gohman 49a6f16b7c Add a new register class to describe operands that can't be SP,
due to x86 encoding restrictions. This is currently off by default
because it may cause code quality regressions. This is for PR4572.

llvm-svn: 77565
2009-07-30 01:56:29 +00:00
Evan Cheng e3493a91cc tbb / tbh instructions only branch forward, not backwards.
llvm-svn: 77522
2009-07-29 23:20:20 +00:00
Evan Cheng 1f58eed638 Add VFP3 D registers to the DPR register class.
llvm-svn: 77521
2009-07-29 23:03:41 +00:00
Devang Patel 27c87fff7f Read and write NamedMDNode.
llvm-svn: 77517
2009-07-29 22:34:41 +00:00
Daniel Dunbar 98ddd164d8 Fix PR4645 which was fallout from the fix for PR4641.
- Call RAUW to delete all instructions (this is a patch from Nick Lewycky).

llvm-svn: 77512
2009-07-29 22:00:43 +00:00
Evan Cheng 56c89e70fe xfail for now.
llvm-svn: 77478
2009-07-29 17:40:28 +00:00
Bob Wilson cf19885a32 Change Neon VLDn intrinsics to return multiple values instead of really
wide vectors.  Likewise, change VSTn intrinsics to take separate arguments
for each vector in a multi-vector struct.  Adjust tests accordingly.

llvm-svn: 77468
2009-07-29 16:39:22 +00:00
Nick Lewycky 013c8e5474 Just discard the output, no need to turn it back into text.
llvm-svn: 77439
2009-07-29 06:14:52 +00:00
Chris Lattner 1d3defa392 don't dump .bc file to stdout, and simplify this to a trivial testcase.
llvm-svn: 77436
2009-07-29 05:32:07 +00:00
Chris Lattner c5397abb52 fix PR4584 with a trivial patch now that the pieces are in place.
llvm-svn: 77434
2009-07-29 05:20:33 +00:00
Nick Lewycky f82326b984 Bulk erasing instructions without RAUWing them is unsafe. Instead, break them
into a new BB that has no predecessors.

llvm-svn: 77433
2009-07-29 05:17:50 +00:00
Evan Cheng c6d70ae063 Optimize Thumb2 jumptable to use tbb / tbh when all the offsets fit in byte / halfword.
llvm-svn: 77422
2009-07-29 02:18:14 +00:00
Eric Christopher dce1e4949e Add a couple more tests for the ptest intrinsics to make sure we're
grabbing them all correctly.

llvm-svn: 77413
2009-07-29 00:51:15 +00:00
Eric Christopher f7802a33ce Add support for gcc __builtin_ia32_ptest{z,c,nzc} intrinsics. Lower
to ptest instruction plus setcc. Revamp ptest instruction. Add test.

llvm-svn: 77407
2009-07-29 00:28:05 +00:00
Andreas Bolka 2f84b5ab46 Slightly reformat LDA tests to ease grepping.
llvm-svn: 77398
2009-07-28 23:40:40 +00:00
Evan Cheng c8bed03349 In thumb2 mode, add pc is unpredictable. Use add + mov pc instead (that is until more optimization goes in).
llvm-svn: 77364
2009-07-28 20:53:24 +00:00
David Goodwin 68bb69d6e3 Remove support for ORN to workaround <rdar://problem/7096522>.
llvm-svn: 77363
2009-07-28 20:51:25 +00:00
David Goodwin 865c6298d7 Add workaround for <rdar://problem/7098328>.
llvm-svn: 77340
2009-07-28 18:15:38 +00:00
Chris Lattner ebbbf451c9 fix testcase for previous patch.
llvm-svn: 77338
2009-07-28 18:04:18 +00:00
Chris Lattner 513a36b63d Fix PR4639, a ELF-TLS regression from some of my refactoring.
llvm-svn: 77336
2009-07-28 17:57:51 +00:00
David Goodwin e82862e24e Add Thumb-2 patterns for ARMsrl_flag and ARMsra_flag.
llvm-svn: 77329
2009-07-28 17:06:49 +00:00
Evan Cheng 12da273f90 tADDrSPI doesn't have a predicate operand, but tADDhirr and tADDi3 have.
llvm-svn: 77305
2009-07-28 07:38:35 +00:00
Evan Cheng 780748d565 - More refactoring. This gets rid of all of the getOpcode calls.
- This change also makes it possible to switch between ARM / Thumb on a
  per-function basis.
- Fixed thumb2 routine which expand reg + arbitrary immediate. It was using
  using ARM so_imm logic.
- Use movw and movt to do reg + imm when profitable.
- Other code clean ups and minor optimizations.

llvm-svn: 77300
2009-07-28 05:48:47 +00:00
Dan Gohman 31a9b9880b Teach instcombine to respect and preserve inbounds. Add inbounds
to a few tests where it is required for the expected transformation.

llvm-svn: 77290
2009-07-28 01:40:03 +00:00
David Goodwin 57b51d9f82 ORN does not require (and can not have) the ".w" suffix. "Orthogonality" is a dirty word at ARM.
llvm-svn: 77275
2009-07-27 23:34:12 +00:00
Daniel Dunbar eb6bb32bef llvm-mc: Implement .abort fully in the front end
llvm-svn: 77272
2009-07-27 23:20:52 +00:00
Dan Gohman 1639c3905e Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details.

llvm-svn: 77259
2009-07-27 21:53:46 +00:00