1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

3031 Commits

Author SHA1 Message Date
Bill Wendling
39c49e3e17 Use the "isCompare" machine instruction attribute instead of calling the
relatively expensive comparison analyzer on each instruction. Also rename the
comparison analyzer method to something more in line with what it actually does.

This pass is will eventually be folded into the Machine CSE pass.

llvm-svn: 110539
2010-08-08 05:04:59 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Rafael Espindola
6d53fded19 Fix eabi calling convention when a 64 bit value shadows r3.
Without this what was happening was:

* R3 is not marked as "used"
* ARM backend thinks it has to save it to the stack because of vaarg
* Offset computation correctly ignores it
* Offsets are wrong

llvm-svn: 110446
2010-08-06 15:35:32 +00:00
Bill Wendling
0cd2ae5158 Add the Optimize Compares pass (disabled by default).
This pass tries to remove comparison instructions when possible. For instance,
if you have this code:

   sub r1, 1
   cmp r1, 0
   bz  L1

and "sub" either sets the same flag as the "cmp" instruction or could be
converted to set the same flag, then we can eliminate the "cmp" instruction all
together. This is a important for ARM where the ALU instructions could set the
CPSR flag, but need a special suffix ('s') to do so.

llvm-svn: 110423
2010-08-06 01:32:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Jim Grosbach
fb6af5329d For local variables in functions with a frame pointer, use FP as a base
register for local access when it's closer to the stack slot being refererenced
than the stack pointer. Make sure to take into account any argument frame
SP adjustments that are in affect at the time.

rdar://8256090

llvm-svn: 110366
2010-08-05 19:27:37 +00:00
Bob Wilson
fbce203f20 Fix indentation.
llvm-svn: 110363
2010-08-05 19:00:21 +00:00
Bob Wilson
4ba3c0a5e1 Add an ARM RSCrr instruction for disassembly only.
Partial fix for PR7792.

llvm-svn: 110361
2010-08-05 18:59:36 +00:00
Bob Wilson
9fbaea3765 Add an ARM RSBrr instruction for disassembly only.
Partial fix for PR7792.

llvm-svn: 110358
2010-08-05 18:23:43 +00:00
Chandler Carruth
01c83a8512 Silence a GCC warning about && and || without explicit parentheses. This
preserves the existing behavior, as it seems a concious choice to allow RS to
be null and BigStack marked true.

llvm-svn: 110307
2010-08-05 03:04:21 +00:00
Bob Wilson
214b004717 ARM "rrx" shift operands do not have an immediate. PR7790.
llvm-svn: 110292
2010-08-05 00:34:42 +00:00
Jim Grosbach
511dbe9c8e and back in. false alarm on the tests from another unrelated local change.
llvm-svn: 110269
2010-08-04 22:46:09 +00:00
Devang Patel
53e2e4feae Implement target specific getDebugValueLocation().
llvm-svn: 110267
2010-08-04 22:39:39 +00:00
Jim Grosbach
497c60502c oops. revert for a moment to clean up tests first.
llvm-svn: 110259
2010-08-04 22:12:43 +00:00
Jim Grosbach
ece51f94db Reserve a stack slot if the function adjusts the stack but doesn't
simplify the call frame pseudo instructions. In that situation, the
calculations for estimating the stack size will be way off, leading to
not having an emergency spill slot when we need one. It should be possible
to be more precise about tracking the adjustment values, but not really
necessary for correctness. Upcoming cleanups for PEI in general will
render that moot.

llvm-svn: 110258
2010-08-04 22:10:15 +00:00
Dale Johannesen
53bc276b33 Remove switch for disabling ARM tail calls. They
seem to be working correctly.  No functional change.

llvm-svn: 110226
2010-08-04 18:07:17 +00:00
Bob Wilson
6a2437480a Combine NEON VABD (absolute difference) intrinsics with ADDs to make VABA
(absolute difference with accumulate) intrinsics.  Radar 8228576.

llvm-svn: 110170
2010-08-04 00:12:08 +00:00
Nate Begeman
b506e13a32 Add support for getting & setting the FPSCR application register on ARM when VFP is enabled.
Add support for using the FPSCR in conjunction with the vcvtr instruction, for controlling fp to int rounding.
Add support for the FLT_ROUNDS_ node now that the FPSCR is exposed.

llvm-svn: 110152
2010-08-03 21:31:55 +00:00
Daniel Dunbar
e0737ebae3 Silence some -Asserts uninitialized variable warnings.
llvm-svn: 109956
2010-07-31 21:08:54 +00:00
Bob Wilson
58c8a5da9e Move newlines before inline jumptables from the asm strings in .td files to
the jtblock_operand print methods.  This avoids extra newlines in the
disassembler's output.  PR7757.

llvm-svn: 109948
2010-07-31 06:28:10 +00:00
Bob Wilson
439e7b1d73 Add support for disassembling VMVN (immediate) instructions. PR7747.
llvm-svn: 109946
2010-07-31 05:57:44 +00:00
Evan Cheng
ee59acf6dd Add -disable-shifter-op to disable isel of shifter ops. On Cortex-a9 the shifts cost extra instructions so it might be better to emit them separately to take advantage of dual-issues.
llvm-svn: 109934
2010-07-30 23:33:54 +00:00
Bob Wilson
6ce71251cc Add a check in the ARM disassembler for NEON instructions that would
reference registers past the end of the NEON register file, and report them
as invalid instead of asserting when trying to print them.  PR7746.

llvm-svn: 109933
2010-07-30 23:27:59 +00:00
Bob Wilson
bd1dc153a5 Add the __TEXT,__StaticInit section to the list of sections emitted at the
beginning on ARM Darwin assembly files so that it won't be placed after
debug sections.  Radar 8252813.

llvm-svn: 109879
2010-07-30 19:55:47 +00:00
Jim Grosbach
1718345a30 Many Thumb2 instructions can reference the full ARM register set (i.e.,
have 4 bits per register in the operand encoding), but have undefined
behavior when the operand value is 13 or 15 (SP and PC, respectively).
The trivial coalescer in linear scan sometimes will merge a copy from
SP into a subsequent instruction which uses the copy, and if that
instruction cannot legally reference SP, we get bad code such as:
  mls r0,r9,r0,sp
instead of:
  mov r2, sp
  mls r0, r9, r0, r2

This patch adds a new register class for use by Thumb2 that excludes
the problematic registers (SP and PC) and is used instead of GPR
for those operands which cannot legally reference PC or SP. The
trivial coalescer explicitly requires that the register class
of the destination for the COPY instruction contain the source
register for the COPY to be considered for coalescing. This prevents
errant instructions like that above.

PR7499

llvm-svn: 109842
2010-07-30 02:41:01 +00:00
Nate Begeman
0b0f838c32 Add builtins for ssat/usat, similar to RealView's __ssat and __usat intrinsics.
llvm-svn: 109813
2010-07-29 22:48:09 +00:00
Bob Wilson
d70ec880ea Refactor ARM-specific DAG combining in preparation for adding some more
transformations.

llvm-svn: 109800
2010-07-29 20:34:14 +00:00
Dale Johannesen
717fbb2b32 Implement vector constants which are splat of
integers with mov + vdup.  8003375.  This is
currently disabled by default because LICM will
not hoist a VDUP, so it pessimizes the code if
the construct occurs inside a loop (8248029).

llvm-svn: 109799
2010-07-29 20:10:08 +00:00
Bob Wilson
823182c3e5 Don't assert on an unrecognized BrMiscFrm instruction.
PR7745.

llvm-svn: 109788
2010-07-29 18:29:28 +00:00
Nate Begeman
b24fa8b8ae Add intrinsics __builtin_arm_qadd & __builtin_arm_qsub to allow access to the QADD & QSUB instructions.
Behave identically to __qadd & __qsub RealView instruction intrinsics.

llvm-svn: 109770
2010-07-29 17:56:55 +00:00
Jim Grosbach
8764c0127d ARM mode version of r109693. Remove incorrect substitution pattern for UXTB16. It wrongly assumed the input shift was actually a rotate. rdar://8240138
llvm-svn: 109696
2010-07-28 23:25:44 +00:00
Jim Grosbach
17bec0f609 Remove incorrect substitution pattern for UXTB16. It wrongly assumed the input shift was actually a rotate. rdar://8240138
llvm-svn: 109693
2010-07-28 23:17:45 +00:00
Jim Grosbach
03b130774b Remove dead prototype
llvm-svn: 109691
2010-07-28 23:16:12 +00:00
Eli Friedman
94c9f00dd6 And a bit more non-ASCII stuff.
llvm-svn: 109458
2010-07-26 22:28:18 +00:00
Anton Korobeynikov
b71ee4ebbb Drop some non-ascii stuff
llvm-svn: 109456
2010-07-26 22:23:07 +00:00
Anton Korobeynikov
5e1e95aed9 Add a note
llvm-svn: 109448
2010-07-26 21:48:35 +00:00
Anton Korobeynikov
5e3d50ec58 Currently EH lowering code expects typeinfo to be global only.
This assumption is not satisfied due to global mergeing.
Workaround the issue by temporary disablinge mergeing of const globals.
Also, ignore LLVM "special" globals. This fixes PR7716

llvm-svn: 109423
2010-07-26 18:45:39 +00:00
Evan Cheng
1566171daa ARM fastisel isn't ready.
llvm-svn: 109421
2010-07-26 18:32:55 +00:00
Douglas Gregor
caa8768635 Remove extraneous semicolon
llvm-svn: 109373
2010-07-25 17:34:42 +00:00
Douglas Gregor
dc72ace097 Unbreak CMake build
llvm-svn: 109372
2010-07-25 17:10:14 +00:00
Anton Korobeynikov
7ae895e007 Hook in GlobalMerge pass
llvm-svn: 109359
2010-07-24 21:52:08 +00:00
Jim Grosbach
4b7545413d Use the appropriate register class for an i32 when adding ARM::LR to the
function live in set. This will give us tGPR for Thumb1 and GPR otherwise,
so the copy will be spillable. rdar://8224931

llvm-svn: 109293
2010-07-23 23:50:35 +00:00
Dale Johannesen
50d2bc2942 Revert 109076. It is wrong and was causing regressions. Add some
comments explaining why it was wrong.  8225024.

Fix the real problem in 8213383: the code that splits very large
blocks when no other place to put constants can be found was not
considering the case that the block contained a Thumb tablejump.

llvm-svn: 109282
2010-07-23 22:50:23 +00:00
Evan Cheng
f215e55d5f - Allow target to specify when is register pressure "too high". In most cases,
it's too late to start backing off aggressive latency scheduling when most
  of the registers are in use so the threshold should be a bit tighter.
- Correctly handle live out's and extract_subreg etc.
- Enable register pressure aware scheduling by default for hybrid scheduler.
  For ARM, this is almost always a win on # of instructions. It's runtime
  neutral for most of the tests. But for some kernels with high register
  pressure it can be a huge win. e.g. 464.h264ref reduced number of spills by
  54 and sped up by 20%.

llvm-svn: 109279
2010-07-23 22:39:59 +00:00
Chris Lattner
a1dcdf0bd4 eliminate the TargetInstrInfo::GetInstSizeInBytes hook.
ARM/PPC/MSP430-specific code (which are the only targets that
implement the hook) can directly reference their target-specific
instrinfo classes.

llvm-svn: 109171
2010-07-22 21:27:00 +00:00
Chris Lattner
9c30949ae1 switch a private implementation of GetFunctionSizeInBytes.
This is probably not the best way to implement "Force LR to 
be spilled if the Thumb function size is > 2048." do this, 
it should use the branch shortening infrastructure, but I'm
just preserving functionality here.

llvm-svn: 109165
2010-07-22 21:14:33 +00:00
Xerxes Ranby
c7a04bcaa5 ARMv4 JIT forgets to set the lr register when making a indirect function call. Fixes PR7608
llvm-svn: 109125
2010-07-22 17:28:34 +00:00
Chandler Carruth
e10953d673 Mark an assert-only variable as used.
llvm-svn: 109091
2010-07-22 08:02:25 +00:00
Chandler Carruth
4810e179e9 Fix the generated file name for CMake.
llvm-svn: 109090
2010-07-22 08:00:52 +00:00
Chandler Carruth
66edf31b8e Attempt to fix linking issues with CMake. Please review other CMake users,
especially on other platforms. Is there a better way to fix this.

llvm-svn: 109084
2010-07-22 06:27:45 +00:00
Owen Anderson
01e73ac583 Update CMake files.
llvm-svn: 109081
2010-07-22 06:00:01 +00:00
Evan Cheng
32f6aba7d8 Fix constant island pass's handling of tBR_JTr. The offset of the instruction does not have to be 4-byte aligned. Rather, it's the offset + 2 that must be aligned since the instruction expands into:
mov     pc, r1
        .align  2
LJTI0_0_0:
        .long    LBB0_14

This fixes rdar://8213383. No test case since it's not possible to come up with a suitable small one.

llvm-svn: 109076
2010-07-22 02:09:47 +00:00
Evan Cheng
5aa6a25102 More register pressure aware scheduling work.
llvm-svn: 109064
2010-07-21 23:53:58 +00:00
Jim Grosbach
489d758ea8 For ARM/Darwin, add a dwarf entry indicating whether a function is arm or thumb
rdar://8202967

llvm-svn: 109057
2010-07-21 23:03:52 +00:00
Eric Christopher
3d118d5e8a Baby steps towards ARM fast-isel.
llvm-svn: 109047
2010-07-21 22:26:11 +00:00
Rafael Espindola
9aab8413b8 Fix calling convention on ARM if vfp2+ is enabled.
llvm-svn: 109009
2010-07-21 11:38:30 +00:00
Evan Cheng
df725c25dd Teach bottom up pre-ra scheduler to track register pressure. Work in progress.
llvm-svn: 108991
2010-07-21 06:09:07 +00:00
Chris Lattner
fd071c0bd8 prune #includes a little.
llvm-svn: 108929
2010-07-20 21:17:29 +00:00
Jim Grosbach
30f1b06af3 Using BIC for immediates needs an extra bump for its complexity to get
instruction selection to prefer it when possible. rdar://7903972

llvm-svn: 108844
2010-07-20 16:07:04 +00:00
Jim Grosbach
fa61724ac3 Removed un-used code.
llvm-svn: 108841
2010-07-20 14:51:32 +00:00
Eric Christopher
ff47f8d94f Constify some arguments.
llvm-svn: 108812
2010-07-20 06:52:21 +00:00
Daniel Dunbar
15f94c52e6 Update CMake files.
llvm-svn: 108787
2010-07-20 00:08:13 +00:00
Chris Lattner
9ae74337ef sink the arm implementations of ASmPrinter and MCInstLower
out of the AsmPrinter directory into libarm.  Now the
ARM InstPrinters depend jsut on the MC stuff, not on vmcore
or codegen.

llvm-svn: 108783
2010-07-19 23:44:46 +00:00
Evan Cheng
b2ad0066f5 ARM has to provide its own TargetLowering::findRepresentativeClass because its scalar floating point registers alias its vector registers.
llvm-svn: 108761
2010-07-19 22:15:08 +00:00
Jim Grosbach
dc21ac2e0a Since ARM emits inline jump tables as part of the ConstantIsland pass,
it should set the jump table encloding the EK_Inline. This prevents
a second, unused, copy of the table from being emitted after the function
body. PR6581.

llvm-svn: 108730
2010-07-19 17:20:38 +00:00
Jim Grosbach
5b8c14ce8a revert so I can get the right PR# in the log message.
llvm-svn: 108727
2010-07-19 17:19:40 +00:00
Jim Grosbach
42f3134738 Since ARM emits inline jump tables as part of the ConstantIsland pass,
it should set the jump table encloding the EK_Inline. This prevents
a second, unused, copy of the table from being emitted after the function
body. PR7499.

llvm-svn: 108722
2010-07-19 17:18:28 +00:00
Daniel Dunbar
150021561c Target: Give the TargetAsmParser access to the TargetMachine.
- Unfortunate, but necessary for now to handle subtarget instruction matching. Eventually we should factor out the lower level target machine information so we don't need to do this.

llvm-svn: 108664
2010-07-19 00:33:49 +00:00
Jim Grosbach
270540da7b Add combiner patterns to more effectively utilize the BFI (bitfield insert)
instruction for non-constant operands. This includes the case referenced
in the README.txt regarding a bitfield copy.

llvm-svn: 108608
2010-07-17 03:30:54 +00:00
Jim Grosbach
e52a4aff12 add BFI to getTargetNodeName()
llvm-svn: 108603
2010-07-17 01:50:57 +00:00
Jim Grosbach
5e095020ae Fix logic think-o
llvm-svn: 108601
2010-07-17 01:22:19 +00:00
Eric Christopher
00b8fa89c8 Remove unnecessary check that was subsumed into canRealignStack.
llvm-svn: 108588
2010-07-17 00:33:04 +00:00
Eric Christopher
033201e862 Make more explicit and add some currently disabled error messages for
stack realignment on ARM.

Also check for function attributes as we do on X86 as well as
make explicit that we're checking can as well as needs in this function.

llvm-svn: 108582
2010-07-17 00:27:24 +00:00
Jim Grosbach
749f4fca0a Add basic support to code-gen the ARM/Thumb2 bit-field insert (BFI) instruction
and a combine pattern to use it for setting a bit-field to a constant
value. More to come for non-constant stores.

llvm-svn: 108570
2010-07-16 23:05:05 +00:00
Jakob Stoklund Olesen
44949b2e1b Remove the isMoveInstr() hook.
llvm-svn: 108567
2010-07-16 22:35:46 +00:00
Jakob Stoklund Olesen
d073973e61 Use a small local function for a single remaining late isMoveInstr call in
Thumb2ITBlockPass.

llvm-svn: 108564
2010-07-16 22:35:32 +00:00
Bill Wendling
e2833a21c2 Rename DBG_LABEL PROLOG_LABEL, because it's only used during prolog emission and
thus is a much more meaningful name.

llvm-svn: 108563
2010-07-16 22:20:36 +00:00
Evan Cheng
ffbae6ad52 Split -enable-finite-only-fp-math to two options:
-enable-no-nans-fp-math and -enable-no-infs-fp-math. All of the current codegen fp math optimizations only care whether the fp arithmetics arguments and results can never be NaN.

llvm-svn: 108465
2010-07-15 22:07:12 +00:00
Eli Friedman
fc1680a9af Random note about bswap.
llvm-svn: 108396
2010-07-15 02:20:38 +00:00
Bob Wilson
27e348cfa5 Remove restriction on NEON alignment values. Some of the NEON ld/st
instructions use different values (e.g., 2-byte or 4-byte alignment).
Also fix ARMInstPrinter to print these alignments as bits instead of bytes.

llvm-svn: 108386
2010-07-14 23:54:43 +00:00
Benjamin Kramer
da3e6cdb26 Don't pass StringRef by reference.
llvm-svn: 108366
2010-07-14 22:38:02 +00:00
Jim Grosbach
e2d1ecbe70 Improve 64-subtraction of immediates when parts of the immediate can fit
in the literal field of an instruction. E.g.,
long long foo(long long a) {
  return a - 734439407618LL;
}

rdar://7038284

llvm-svn: 108339
2010-07-14 17:45:16 +00:00
Bob Wilson
f60d34bfad Add missing address register update to t2LDM_RET instruction.
Patch by Brian Lucas. PR7636.

llvm-svn: 108332
2010-07-14 16:02:13 +00:00
Eli Friedman
7175d7558d A couple potential optimizations inspired by comment 4 in PR6773.
llvm-svn: 108328
2010-07-14 06:58:26 +00:00
Bob Wilson
34f481e895 Add support for NEON VMVN immediate instructions.
llvm-svn: 108324
2010-07-14 06:31:50 +00:00
Bob Wilson
298c5c46c1 The bits in the cmode field of 32-bit VMOV immediate instructions all depend
of the value of the immediate.

llvm-svn: 108323
2010-07-14 06:30:44 +00:00
Bob Wilson
0f581a998c Add an ARM-specific DAG combining to avoid redundant VDUPLANE nodes.
Radar 7373643.

llvm-svn: 108303
2010-07-14 01:22:12 +00:00
Bob Wilson
7feb850d36 Use a target-specific VMOVIMM DAG node instead of BUILD_VECTOR to represent
NEON VMOV-immediate instructions.  This simplifies some things.

llvm-svn: 108275
2010-07-13 21:16:48 +00:00
Evan Cheng
069f1f7c9a Extend the r107852 optimization which turns some fp compare to code sequence using only i32 operations. It now optimize some f64 compares when fp compare is exceptionally slow (e.g. cortex-a8). It also catches comparison against 0.0.
llvm-svn: 108258
2010-07-13 19:27:42 +00:00
Evan Cheng
67743f2057 Add an ARM "feature". Cortex-a8 fp comparison is very slow (> 20 cycles).
llvm-svn: 108256
2010-07-13 19:21:50 +00:00
Bob Wilson
8c1f6adf81 Move NEON "modified immediate" encode/decode into ARMAddressingModes.h to
avoid replicated code.

llvm-svn: 108227
2010-07-13 04:44:34 +00:00
Bob Wilson
33acb6130e Remove some code that doesn't appear to do anything. All the ARM call
instructions already have implicit defs of LR.  The comment suggests that
this is intended to fix something like pr6111, but it doesn't really do
that either.

llvm-svn: 108186
2010-07-12 20:22:45 +00:00
Duncan Sands
f7b98e2b1e Convert some tab stops into spaces.
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Jakob Stoklund Olesen
7af3eff94d RISC architectures get their memory operand folding for free.
The only folding these load/store architectures can do is converting COPY into a
load or store, and the target independent part of foldMemoryOperand already
knows how to do that.

llvm-svn: 108099
2010-07-11 19:19:13 +00:00
Rafael Espindola
68bbc41d5e Make getPhysicalRegisterRegClass non-virtual. Should be able to remove it soon.
llvm-svn: 108094
2010-07-11 16:49:10 +00:00
Jakob Stoklund Olesen
938e41c1fa Replace copyRegToReg with copyPhysReg for ARM.
llvm-svn: 108078
2010-07-11 06:33:54 +00:00
Rafael Espindola
84716579d4 Fix va_arg for doubles. With this patch VAARG nodes always contain the
correct alignment information, which simplifies ExpandRes_VAARG a bit.

The patch introduces a new alignment information to TargetLoweringInfo. This is
needed since the two natural candidates cannot be used:

* The 's' in target data: If this is set to the minimal alignment of any
  argument, getCallFrameTypeAlignment would return 4 for doubles on ARM for
  example.
* The getTransientStackAlignment method. It is possible for an architecture to
  have argument less aligned than what we maintain the stack pointer.

llvm-svn: 108072
2010-07-11 04:01:49 +00:00
Chandler Carruth
1efbf423c5 Add parentheses yet again to satisfy GCC's warnings.
llvm-svn: 108043
2010-07-10 12:06:22 +00:00
Jakob Stoklund Olesen
d7c882a505 Automatically fold COPY instructions into stack load/store.
llvm-svn: 108012
2010-07-09 20:43:13 +00:00
Jim Grosbach
b591b3b48d In the presence of variable sized objects, allocate an emergency spill slot.
rdar://8131327

llvm-svn: 108008
2010-07-09 20:27:06 +00:00
Bob Wilson
f15e542bdc Print "dregpair" NEON operands with a space between them, for readability and
consistency with other instructions that have lists of register operands.

llvm-svn: 107944
2010-07-09 00:47:20 +00:00
Evan Cheng
5307ec12d7 Check for FiniteOnlyFPMath as well.
llvm-svn: 107904
2010-07-08 20:12:24 +00:00
Bob Wilson
12922e6bec The NEONPreAllocPass should never have to assign fixed registers anymore.
This pass can go away entirely soon.

llvm-svn: 107892
2010-07-08 17:45:26 +00:00
Bob Wilson
fca7a252fb For big-endian systems, VLD2/VST2 with 32-bit vector elements will swap the
words within the 64-bit D registers.  Use VLD1/VST1 with 64-bit elements
instead.

llvm-svn: 107890
2010-07-08 17:44:00 +00:00
Bob Wilson
b07d97d333 Clean up a comment.
llvm-svn: 107882
2010-07-08 16:54:45 +00:00
Jakob Stoklund Olesen
30aacf68b9 Convert EXTRACT_SUBREG to COPY when emitting machine instrs.
EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead.

Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg().
The isMoveInstr hook will be removed later.

llvm-svn: 107879
2010-07-08 16:40:22 +00:00
Evan Cheng
3e8530bf14 r107852 is only safe with -enable-unsafe-fp-math to account for +0.0 == -0.0.
llvm-svn: 107856
2010-07-08 06:01:49 +00:00
Evan Cheng
ed3f224f04 Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met:
1. The arguments are f32.
2. The arguments are loads and they have no uses other than the comparison.
3. The comparison code is EQ or NE.

e.g.
        vldr.32 s0, [r1]
        vldr.32 s1, [r0]
        vcmpe.f32       s1, s0
        vmrs    apsr_nzcv, fpscr
	beq     LBB0_2
=>
        ldr     r1, [r1]
        ldr     r0, [r0]
        cmp     r0, r1
        beq     LBB0_2

More complicated cases will be implemented in subsequent patches.

llvm-svn: 107852
2010-07-08 02:08:50 +00:00
Dale Johannesen
2df647f882 Changes to ARM tail calls, mostly cosmetic.
Add explicit testcases for tail calls within the same module.
Duplicate some code to humor those who think .w doesn't apply on ARM.
Leave this disabled on Thumb1, and add some comments explaining why it's hard
and won't gain much.

llvm-svn: 107851
2010-07-08 01:18:23 +00:00
Jim Grosbach
46d94f1c1e grammar
llvm-svn: 107831
2010-07-07 22:53:35 +00:00
Jim Grosbach
8f27ad0d9d Handle cases where the post-RA scheduler may move instructions between the
address calculation instructions leading up to a jump table when we're trying
to convert them into a TB[H] instruction in Thumb2. This realistically
shouldn't happen much, if at all, for well formed inputs, but it's more correct
to handle it. rdar://7387682

llvm-svn: 107830
2010-07-07 22:51:22 +00:00
Jim Grosbach
d13cc7716e grammar and trailing whitespace
llvm-svn: 107811
2010-07-07 21:06:51 +00:00
Dan Gohman
c768525273 Split the SDValue out of OutputArg so that SelectionDAG-independent
code can do calling-convention queries. This obviates OutputArgReg.

llvm-svn: 107786
2010-07-07 15:54:55 +00:00
Bob Wilson
822b21f0de Also use REG_SEQUENCE for VTBX instructions.
llvm-svn: 107743
2010-07-07 00:08:54 +00:00
Jim Grosbach
71b7efe8ad Mark eh.sjlj.set/longjmp custom lowerings as Darwin-only since that's where
they've been tested to work.

llvm-svn: 107742
2010-07-07 00:07:57 +00:00
Jim Grosbach
657ab4a8ee By default, the eh.sjlj.setjmp/longjmp intrinsics should just do nothing rather
than assuming a target will custom lower them. Targets which do so should
exlicitly mark them as having custom lowerings. PR7454.

llvm-svn: 107734
2010-07-06 23:44:52 +00:00
Bob Wilson
ce80768ebf Use REG_SEQUENCE nodes to make the table registers for VTBL instructions be
allocated to consecutive registers.

llvm-svn: 107730
2010-07-06 23:36:25 +00:00
Jakob Stoklund Olesen
44c333e87c Track defs for all aliases in NEONMoveFix.
This means that an instruction defining an S register will affect the domain of
the parent D register.

llvm-svn: 107725
2010-07-06 23:26:23 +00:00
Devang Patel
7ab104353b Propagate debug loc.
llvm-svn: 107710
2010-07-06 22:08:15 +00:00
Bob Wilson
084a11cb59 Represent NEON load/store alignments in bytes, not bits.
llvm-svn: 107701
2010-07-06 21:26:18 +00:00
Dan Gohman
808f334f79 Reapply r107655 with fixes; insert the pseudo instruction into
the block before calling the expansion hook. And don't
put EFLAGS in a mbb's live-in list twice.

llvm-svn: 107691
2010-07-06 20:24:04 +00:00
Rafael Espindola
e5689571a1 Don't create neon moves in CopyRegToReg. NEONMoveFixPass will do the conversion
if profitable.

llvm-svn: 107673
2010-07-06 16:24:34 +00:00
Dan Gohman
4d264f7e51 Revert r107655.
llvm-svn: 107668
2010-07-06 15:49:48 +00:00
Dan Gohman
6a73079aba Fix a bunch of custom-inserter functions to handle the case where
the pseudo instruction is not at the end of the block.

llvm-svn: 107655
2010-07-06 15:18:19 +00:00
Evan Cheng
47f3a2db40 Remove isSS argument from CreateFixedObject. Fixed objects cannot be spill slots so it's always false.
llvm-svn: 107550
2010-07-03 00:40:23 +00:00
Evan Cheng
8c4e6ba789 Remove early IT block formation. It's not used.
llvm-svn: 107513
2010-07-02 21:07:09 +00:00
Bob Wilson
f96aab3079 Fix incorrect asm-printing of some NEON immediates. Fix weak testcase so
that it checks the immediate values, not just the instructions opcodes.
Radar 8110263.

llvm-svn: 107487
2010-07-02 17:23:44 +00:00
Bob Wilson
17dc7d716b ARM function alignments were off by a power of two. svn 83242 changed
getFunctionAlignment and the corresponding use of that value in the ARM
asm printer, but now we're using the standard asm printer.  The result of
this was that function alignments were dropped completely for Thumb functions.
Radar 8143571.

llvm-svn: 107435
2010-07-01 22:26:26 +00:00
Bob Wilson
1b4210315e Add support for encoding VDUP (ARM core register) instructions.
llvm-svn: 107201
2010-06-29 20:13:29 +00:00
Bob Wilson
be81c92b41 Add support for encoding NEON VMOV (from core register to scalar) instructions.
The encoding is the same as VMOV (from scalar to core register) except that
the operands are in different places.

llvm-svn: 107167
2010-06-29 17:34:07 +00:00
Jim Grosbach
151bec3c2d skip dbg_value instructions
llvm-svn: 107154
2010-06-29 16:55:24 +00:00
Bob Wilson
74996289e3 The t2MOVi16 and t2MOVTi16 instructions do not set CPSR. Trying to add
a CPSR operand to them causes an assertion failure, so apparently these
instructions haven't been getting a lot of use.

llvm-svn: 107147
2010-06-29 16:25:11 +00:00
Rafael Espindola
832e4ddde7 Add a VT argument to getMinimalPhysRegClass and replace the copy related uses
of getPhysicalRegisterRegClass with it.

If we want to make a copy (or estimate its cost), it is better to use the
smallest class as more efficient operations might be possible.

llvm-svn: 107140
2010-06-29 14:02:34 +00:00
Duncan Sands
1a45e3dbce Remove pointless variable LastDef.
llvm-svn: 107135
2010-06-29 13:23:22 +00:00
Duncan Sands
9eff796264 Remove unused variable Loc and pointless variables unified_syntax
and thumb_mode.

llvm-svn: 107133
2010-06-29 13:04:35 +00:00
Duncan Sands
25a2d02c5c Remove an unused and a pointless variable.
llvm-svn: 107131
2010-06-29 13:00:29 +00:00
Duncan Sands
b955b3bf92 Remove initialized but otherwise unused variables.
llvm-svn: 107127
2010-06-29 11:22:26 +00:00
Evan Cheng
6349fa5ec4 PR7503: uxtb16 is not available for ARMv7-M. Patch by Brian G. Lucas.
llvm-svn: 107122
2010-06-29 05:38:36 +00:00
Evan Cheng
9883684f03 Change if-cvt options to something that actually as useable.
llvm-svn: 107121
2010-06-29 05:37:59 +00:00
Jakob Stoklund Olesen
b72b136170 When no memoperands are present, assume unaligned, volatile.
llvm-svn: 107114
2010-06-29 01:13:07 +00:00
Bob Wilson
2a4e6d0e34 Fix Thumb encoding of VMOV (scalar to ARM core register). The encoding is
the same as ARM except that the condition code field is always set to ARMCC::AL.

llvm-svn: 107107
2010-06-29 00:26:13 +00:00
Bob Wilson
aee90dacaa Make the ARMCodeEmitter identify Thumb functions via ARMFunctionInfo instead
of the Subtarget.

llvm-svn: 107086
2010-06-28 22:23:17 +00:00
Jim Grosbach
8441e67098 tidy up style. no functional change.
llvm-svn: 107073
2010-06-28 21:29:17 +00:00
Bob Wilson
378395412f Refactor encoding function for NEON 1-register with modified immediate format.
llvm-svn: 107070
2010-06-28 21:16:30 +00:00
Bob Wilson
6385cb2386 Support Thumb mode encoding of NEON instructions.
llvm-svn: 107068
2010-06-28 21:12:19 +00:00
Jim Grosbach
a0473aa51c minor housekeeping cleanup: 80-column, trailing whitespace, spelling, etc.. No functional change.
llvm-svn: 106988
2010-06-28 04:27:01 +00:00
Eli Friedman
893ce468be Followup to r106770: actually generate SXTB and SXTH for sign-extensions.
llvm-svn: 106940
2010-06-26 04:36:50 +00:00
Bob Wilson
aff7e7c1cc Add support for encoding NEON VMOV (from scalar to core register) instructions.
llvm-svn: 106938
2010-06-26 04:07:15 +00:00
Evan Cheng
f222c09b61 It's now possible to run code placement pass for ARM.
llvm-svn: 106935
2010-06-26 01:52:05 +00:00
Bob Wilson
a3b10d15f2 Renumber NEON instruction formats to be consecutive.
llvm-svn: 106927
2010-06-26 00:05:09 +00:00
Bob Wilson
b8eaf1ed72 Rename ARM instruction formats NEONGetLnFrm, NEONSetLnFrm and NEONDupFrm to
"N..." instead of "NEON..." for consistency with the other NEON format names.

llvm-svn: 106921
2010-06-25 23:56:05 +00:00
Bob Wilson
3ace799cfe Remove unused NEONFrm and ThumbMiscFrm ARM instruction formats.
Renumber MiscFrm to 25.

llvm-svn: 106916
2010-06-25 23:45:37 +00:00
Daniel Dunbar
c0c37cea64 Thumb2ITBlockPass: Fix a possible dereference of an invalid iterator. This was
introduced in r106343, but only showed up recently (with a particular compiler &
linker combination) because of the particular check, and because we have no
builtin checking for dereferencing the end of an array, which is truly
unfortunate.

llvm-svn: 106908
2010-06-25 23:14:54 +00:00
Evan Cheng
346aecdb8b Change if-conversion block size limit checks to add some flexibility.
llvm-svn: 106901
2010-06-25 22:42:03 +00:00
Bob Wilson
d1e4e67954 Add support for encoding 3-register NEON instructions, and fix
emitNEON2RegInstruction's handling of 2-address operands.

llvm-svn: 106900
2010-06-25 22:40:46 +00:00
Dale Johannesen
b1fc776fca The hasMemory argument is irrelevant to how the argument
for an "i" constraint should get lowered; PR 6309.  While
this argument was passed around a lot, this is the only
place it was used, so it goes away from a lot of other
places.

llvm-svn: 106893
2010-06-25 21:55:36 +00:00
Bob Wilson
a1739048a1 Add support for encoding 2-register NEON instructions.
llvm-svn: 106891
2010-06-25 21:17:19 +00:00
Bob Wilson
4d54e03068 Fix indentation.
llvm-svn: 106881
2010-06-25 20:54:44 +00:00
Jim Grosbach
584fae6cc4 IT instructions are considered to be scheduling hazards, but are scheduled
with the following instructions. This is done via trickery by considering the
instruction preceding the IT to be the hazard. Care must be taken to ensure
it's the first non-debug instruction, or the presence of debug info will
affect codegen.

Part of the continuing work for rdar://7797940, making ARM code-gen unaffected
by the presence of debug information.

llvm-svn: 106871
2010-06-25 18:43:14 +00:00
Bob Wilson
a779332a5e Add missing ARM and Thumb data layout info for vector types.
Radar 8128745.

llvm-svn: 106820
2010-06-25 04:41:08 +00:00
Bob Wilson
0a84b9b677 Reduce indentation.
llvm-svn: 106819
2010-06-25 04:12:31 +00:00
Evan Cheng
c3976de390 Oops. IT block formation pass needs to be run at any optimization level.
llvm-svn: 106775
2010-06-24 19:10:14 +00:00
Eli Friedman
0698ec53f6 Always allow Thumb-2 SXTB, SXTH, UXTB, and UXTH. Fixes PR7324.
llvm-svn: 106770
2010-06-24 18:20:04 +00:00
Bob Wilson
26297589b7 PR7458: Try commuting Thumb2 instruction operands to put them into 2-address
form so they can be narrowed to 16-bit instructions.

llvm-svn: 106762
2010-06-24 16:50:20 +00:00
Bill Wendling
777c025ad8 We are missing opportunites to use ldm. Take code like this:
void t(int *cp0, int *cp1, int *dp, int fmd) {
  int c0, c1, d0, d1, d2, d3;
  c0 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000);
  c1 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000);
  /* ... */
}

It code gens into something pretty bad. But with this change (analogous to the
X86 back-end), it will use ldm and generate few instructions.

llvm-svn: 106693
2010-06-23 23:00:16 +00:00
Dale Johannesen
e618e80a13 Do not do tail calls to external symbols. If the
branch turns out to be ARM-to-Thumb or vice versa
the linker cannot resolve this.  8120438.

If this optimization is going to be useful we probably
need a compiler flag "assume callees are same architecture"
or something like that.

llvm-svn: 106662
2010-06-23 18:52:34 +00:00
Jim Grosbach
414eb48a14 When using libcall expansions for the atomic intrinsics, the explicit
MEMBARRIER fences aren't necessary for ARM. Tell the combiner to fold them
away.

llvm-svn: 106631
2010-06-23 16:08:49 +00:00
Bob Wilson
cb414cca8d Thumb1 functions using @llvm.returnaddress were not saving the incoming LR.
Radar 8031193.

llvm-svn: 106582
2010-06-22 22:04:24 +00:00
Dan Gohman
74d5144414 Use pre-increment instead of post-increment when the result is not used.
llvm-svn: 106542
2010-06-22 15:08:57 +00:00
Evan Cheng
a1ebf91a39 Tail merging pass shall not break up IT blocks. rdar://8115404
llvm-svn: 106517
2010-06-22 01:18:16 +00:00
Bob Wilson
ef565a2ffd sign_extend_inreg needs to be expanded for pre-v6 Thumb as well as ARM.
Radar 8104310.

llvm-svn: 106484
2010-06-21 21:27:34 +00:00
Jim Grosbach
bc31f7a24b LEApcrelJT shouldn't be marked as neverHasSideEffects, as we don't want it
being moved around away from the jump table it references. rdar://8104340

llvm-svn: 106483
2010-06-21 21:27:27 +00:00
Evan Cheng
167a8655c7 Fix PR7421: bug in kill transferring logic. It was ignoring loads / stores which have already been processed.
llvm-svn: 106481
2010-06-21 21:21:14 +00:00
Dale Johannesen
ef3db5dea3 Fix PR 7433. Silly typo in non-Darwin ARM tail call
handling, plus correct R9 handling in that mode.

llvm-svn: 106434
2010-06-21 18:21:49 +00:00
Jim Grosbach
e35d35fd0a early exit for dbg_value instructions
llvm-svn: 106430
2010-06-21 17:49:23 +00:00
Evan Cheng
c18fbafa74 Fix a crash caused by dereference of MBB.end(). rdar://8110842
llvm-svn: 106399
2010-06-20 00:54:38 +00:00
Bob Wilson
059880161b Remove a fixme comment that is no longer relevant.
llvm-svn: 106382
2010-06-19 05:32:41 +00:00
Bob Wilson
44afe2065d Fix error message to match function name.
llvm-svn: 106381
2010-06-19 05:32:09 +00:00
Evan Cheng
142feca0de Ignore dbg_value's.
llvm-svn: 106373
2010-06-19 02:36:21 +00:00
Evan Cheng
f40b8f0e32 Disable sibcall optimization for Thumb1 for now since Thumb1RegisterInfo::emitEpilogue is not expecting them.
llvm-svn: 106368
2010-06-19 01:01:32 +00:00
Evan Cheng
604fd85b52 Indentation and remove dead code.
llvm-svn: 106362
2010-06-19 00:11:54 +00:00
Dan Gohman
8f0bc55ea5 Silence compiler warnings.
llvm-svn: 106360
2010-06-19 00:02:06 +00:00
Evan Cheng
e9ba3241a3 Move ARM if-conversion before post-ra scheduling.
llvm-svn: 106355
2010-06-18 23:32:07 +00:00
Evan Cheng
5e2c36c202 Update cmake list.
llvm-svn: 106348
2010-06-18 23:12:10 +00:00
Evan Cheng
f776ed836b Thumb2 hazard recognizer.
llvm-svn: 106347
2010-06-18 23:11:35 +00:00
Evan Cheng
b5fadc47e0 Allow ARM if-converter to be run after post allocation scheduling.
- This fixed a number of bugs in if-converter, tail merging, and post-allocation
  scheduler. If-converter now runs branch folding / tail merging first to
  maximize if-conversion opportunities.
- Also changed the t2IT instruction slightly. It now defines the ITSTATE
  register which is read by instructions in the IT block.
- Added Thumb2 specific hazard recognizer to ensure the scheduler doesn't
  change the instruction ordering in the IT block (since IT mask has been
  finalized). It also ensures no other instructions can be scheduled between
  instructions in the IT block.

This is not yet enabled.

llvm-svn: 106344
2010-06-18 23:09:54 +00:00
Jim Grosbach
b8c94667a8 back-end libcall handling for ATOMIC_SWAP (__sync_lock_test_and_set)
llvm-svn: 106342
2010-06-18 23:03:10 +00:00
Jim Grosbach
c599143b45 Enable Expand handling of atomics for subtargets that can't do them inline.
llvm-svn: 106336
2010-06-18 22:35:32 +00:00
Bob Wilson
e77d313369 Rewrite chained if's as switches and replace assertions with llvm_unreachable
(as suggested in radar 8104405).

llvm-svn: 106318
2010-06-18 21:32:42 +00:00
Dale Johannesen
3f9da2755d Fix ARM/Thumb reversal in previous attempt.
llvm-svn: 106314
2010-06-18 21:07:47 +00:00
Jakob Stoklund Olesen
a1d49fabaf When using ADDri to get the address of a stack object, 255 is a conservative
limit on the offset that can be materialized without using the register
scavenger.

llvm-svn: 106312
2010-06-18 20:59:25 +00:00
Dale Johannesen
81914dea4e An attempt to fix the problem Anton reported with
ARM tail calls.  Don't know if it works, but it
doesn't break Darwin.

llvm-svn: 106309
2010-06-18 20:44:28 +00:00
Dale Johannesen
a441c8fd45 Enable tail calls on ARM by default, with some
basic tests.

This has been well tested on Darwin but not elsewhere.
It should work provided the linker correctly resolves
  B.W  <label in other function>
which it has not seen before, at least from llvm-based
compilers.  I'm leaving the arm-tail-calls switch in
until I see if there's any problems because of that;
it might need to be disabled for some environments.

llvm-svn: 106299
2010-06-18 19:00:18 +00:00
Dan Gohman
1ccf40774e Start TargetRegisterClass indices at 0 instead of 1, so that
MachineRegisterInfo doesn't have to confusingly allocate an extra
entry.

llvm-svn: 106296
2010-06-18 18:13:55 +00:00
Dale Johannesen
9f18fc3fa2 Last round of changes for ARM tail calls.
Not turning them on yet.

llvm-svn: 106295
2010-06-18 18:13:11 +00:00
Jakob Stoklund Olesen
6c387d99ca Treat the ARM inline asm {cc} constraint as a physreg (%CPSR), just like X86
does for {flags}. If we create virtual registers of the CCR class, RegAllocFast
may try to spill them, and we can't do that.

llvm-svn: 106289
2010-06-18 16:49:33 +00:00
Dan Gohman
0b5b93b20d Eliminate unnecessary uses of getZExtValue().
llvm-svn: 106279
2010-06-18 14:22:04 +00:00
Stuart Hastings
bd7194d21c Add a DebugLoc parameter to TargetInstrInfo::InsertBranch(). This
addresses a longstanding deficiency noted in many FIXMEs scattered
across all the targets.

This effectively moves the problem up one level, replacing eleven
FIXMEs in the targets with eight FIXMEs in CodeGen, plus one path
through FastISel where we actually supply a DebugLoc, fixing Radar
7421831.

llvm-svn: 106243
2010-06-17 22:43:56 +00:00
Jim Grosbach
f3f401f911 Thumb1 and any pre-v6 ARM target should use the libcall expansion of
ISD::MEMBARRIER. v7 and v7 ARM mode continue to use the custom lowering.

llvm-svn: 106204
2010-06-17 02:02:03 +00:00
Jim Grosbach
8d77e0298c simplify code a bit and add a more explanatory assert for cases that
previously would result in 'cannot yet select' errors.

llvm-svn: 106199
2010-06-17 01:37:00 +00:00
Jim Grosbach
b5bea8fdba format and 80-column cleanup
llvm-svn: 106173
2010-06-16 23:45:49 +00:00
Jakob Stoklund Olesen
a97220ab96 Don't attempt preserving conservative kill flags. We were doing it wrong.
This is before LiveVariables anyway, where these kill flags are recalculated.

llvm-svn: 106157
2010-06-16 22:11:08 +00:00
Bob Wilson
d81a716d59 Remove the hidden "neon-reg-sequence" option. The reg sequences are working
now, so there's no need to disable them.

llvm-svn: 106155
2010-06-16 21:34:01 +00:00
Evan Cheng
46b89e05fd Make post-ra scheduling, anti-dep breaking, and register scavenger (conservatively) aware of predicated instructions. This enables ARM to move if-conversion before post-ra scheduler.
llvm-svn: 106091
2010-06-16 07:35:02 +00:00
Dale Johannesen
f35ca445f6 Add file missing from previous commit.
llvm-svn: 106058
2010-06-15 22:24:08 +00:00
Dale Johannesen
e60351e83a Next round of tail call changes. Register used in a tail
call must not be callee-saved; following x86, add a new
regclass to represent this.  Also fixes a couple of bugs.
Still disabled by default; Thumb doesn't work yet.

llvm-svn: 106053
2010-06-15 22:08:33 +00:00
Bob Wilson
56db632295 Add basic support for NEON modified immediates besides VMOV.
llvm-svn: 106030
2010-06-15 19:05:35 +00:00
Daniel Dunbar
5af7430c07 Add <cstddef> include to get ptrdiff_t, for gcc-4.6; patch by Dimitry Andric.
llvm-svn: 105994
2010-06-15 14:50:42 +00:00
Bob Wilson
0fef606ca6 VMOVQQ and VMOVQQQQ are pseudo instructions and not predicable.
llvm-svn: 105990
2010-06-15 05:51:27 +00:00
Jim Grosbach
739bfe2577 Make sure to skip dbg_value instructions when finding an insertion point for
the combined load/store instruction. rdar://7797940

llvm-svn: 105982
2010-06-15 00:41:09 +00:00
Bob Wilson
32016c38ee Rename functions referring to VMOV immediates to refer to NEON "modified
immediate" operands.  These functions have so far only been used for VMOV
but they also apply to other NEON instructions with modified immediate
operands.  No functional changes.

llvm-svn: 105969
2010-06-14 22:19:57 +00:00
Bob Wilson
470551e0ef Add a missing bitcast. This code used to only handle conversions between
i64 and f64 types, but now it also handle Neon vector types, so the f64 result
of VMOVDRR may need to be converted to a Neon type.  Radar 8084742.

llvm-svn: 105845
2010-06-11 22:45:25 +00:00
Bob Wilson
5e3c60fb63 Add instruction encoding for the Neon VMOV immediate instruction. This changes
the machine instruction representation of the immediate value to be encoded
into an integer with similar fields as the actual VMOV instruction.  This makes
things easier for the disassembler, since it can just stuff the bits into the
immediate operand, but harder for the asm printer since it has to decode the
value to be printed.  Testcase for the encoding will follow later when MC has
more support for ARM.

llvm-svn: 105836
2010-06-11 21:34:50 +00:00
Evan Cheng
3635f03b88 Delete code that's not safe.
llvm-svn: 105774
2010-06-10 02:08:20 +00:00
Jim Grosbach
a239e93a5c be slightly more subtle about skipping dbg_value instructions; otherwise, if a
dbg_value immediately follows a sequence of ldr/str instructions that should
be combined into an ldm/stm and is the last instruction in the block, then
combine may end up being skipped.

llvm-svn: 105758
2010-06-09 22:21:24 +00:00
Evan Cheng
501c37c9ca Allow target to place 2-address pass inserted copies in better spots. Thumb2 will use this to try to avoid breaking up IT blocks.
llvm-svn: 105745
2010-06-09 19:26:01 +00:00
Evan Cheng
9f80ad5683 Typo.
llvm-svn: 105677
2010-06-09 03:49:12 +00:00
Evan Cheng
a1940f03f6 Thumb2 IT blocks are fairly expensive. When there are multiple selects using
the same condition, it's important to make sure they are scheduled together
to avoid forming multiple IT blocks. I'm adding a pre-regalloc pass that forms
IT blocks early (by re-scheduling instructions and split basic blocks) to
attempt to fix this. This is not turned on by default since I am not sure this
is the right fix.

Another issue is llvm selects are modeled as two-address conditional moves.
This can be very bad when the copies before the conditional moves are not
coalesced away. Teach IT formation pass to move the copies above the IT block
(when legal) to avoid breaking the IT block.

llvm-svn: 105669
2010-06-09 01:46:50 +00:00
Jim Grosbach
a21cfe3462 fix copy/paste/modify think-o
llvm-svn: 105653
2010-06-08 22:53:32 +00:00
Bruno Cardoso Lopes
255fda615d Reapply r105521, this time appending "LLU" to 64 bit
immediates to avoid breaking the build.

llvm-svn: 105652
2010-06-08 22:51:23 +00:00
Jim Grosbach
4060c0dd54 fix typo
llvm-svn: 105634
2010-06-08 20:06:55 +00:00
Bob Wilson
10073024f6 Fix up a comment.
llvm-svn: 105591
2010-06-08 00:42:08 +00:00
Bob Wilson
9cf6656d4b Further changes for Neon vector shuffles:
- change isShuffleMaskLegal to show that all shuffles with 32-bit and 64-bit
  elements are legal
- the Neon shuffle instructions do not support 64-bit elements, but we were
  not checking for that before lowering shuffles to use them
- remove some 64-bit element vduplane patterns that are no longer needed

llvm-svn: 105586
2010-06-07 23:53:38 +00:00
Jim Grosbach
bb979e722d Handle dbg_value instructions (i.e., skip them) when generating IT blocks.
rdar://7797940

llvm-svn: 105557
2010-06-07 21:48:47 +00:00
Chris Lattner
33d0622cdc revert r105521, which is breaking the buildbots with stuff like this:
In file included from X86InstrInfo.cpp:16:
X86GenInstrInfo.inc:2789: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2790: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2792: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2793: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2808: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2809: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2816: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2817: error: integer constant is too large for 'long' type

llvm-svn: 105524
2010-06-05 04:17:30 +00:00
Bruno Cardoso Lopes
b05131d907 Initial AVX support for some instructions. No patterns matched
yet, only assembly encoding support.

llvm-svn: 105521
2010-06-05 03:53:24 +00:00
Dale Johannesen
df4dc9ed33 Improvements to tail call code. No functional effect
unless using -arm-tail-calls.

llvm-svn: 105515
2010-06-05 00:51:39 +00:00
Dale Johannesen
f47a852290 More thoroughly disable tails calls by default.
8060143, although this doesn't fix the real problem with tail call.

llvm-svn: 105472
2010-06-04 18:04:24 +00:00
Jim Grosbach
ab666c3d62 Another fix to prevent debug info from affecting codegen. rdar://7797940
llvm-svn: 105470
2010-06-04 17:57:34 +00:00
Jim Grosbach
b9367dadcf more dbg_value adjustments so debug info doesn't affect codegen
llvm-svn: 105454
2010-06-04 01:23:30 +00:00
Jim Grosbach
4064cf20dd fix typo
llvm-svn: 105441
2010-06-04 00:15:00 +00:00
Bob Wilson
2945a0ac66 For NEON vectors with 32- or 64-bit elements, select BUILD_VECTORs and
VECTOR_SHUFFLEs to REG_SEQUENCE instructions.  The standard ISD::BUILD_VECTOR
node corresponds closely to REG_SEQUENCE but I couldn't use it here because
its operands do not get legalized.  That is pretty awful, but I guess it
makes sense for other targets.  Instead, I have added an ARM-specific version
of BUILD_VECTOR that will have its operands properly legalized.
This fixes the rest of Radar 7872877.

llvm-svn: 105439
2010-06-04 00:04:02 +00:00
Jim Grosbach
5d75d732ae Teach the ARM load-store optimizer to deal with dbg_value instructions.
llvm-svn: 105427
2010-06-03 22:41:15 +00:00
Dale Johannesen
891a19d5ae Early implementation of tail call for ARM.
A temporary flag -arm-tail-calls defaults to off,
so there is no functional change by default.
Intrepid users may try this; simple cases work
but there are bugs.

llvm-svn: 105413
2010-06-03 21:09:53 +00:00
Jakob Stoklund Olesen
f0226fee37 Slightly change the meaning of the reMaterialize target hook when the original
instruction defines subregisters.

Any existing subreg indices on the original instruction are preserved or
composed with the new subreg index.

Also substitute multiple operands mentioning the original register by using the
new MachineInstr::substituteRegister() function. This is necessary because there
will soon be <imp-def> operands added to non read-modify-write partial
definitions. This instruction:

  %reg1234:foo = FLAP %reg1234<imp-def>

will reMaterialize(%reg3333, bar) like this:

  %reg3333:bar-foo = FLAP %reg333:bar<imp-def>

Finally, replace the TargetRegisterInfo pointer argument with a reference to
indicate that it cannot be NULL.

llvm-svn: 105358
2010-06-02 22:47:25 +00:00
Jim Grosbach
f3bd81ce11 Clean up 80 column violations. No functional change.
llvm-svn: 105350
2010-06-02 21:53:11 +00:00
Rafael Espindola
f7170870cf Remove the TargetRegisterClass member from CalleeSavedInfo
llvm-svn: 105344
2010-06-02 20:02:30 +00:00
Bob Wilson
fd208cef5d Rename canCombinedSubRegIndex method to something more grammatically correct
and tidy up the comment describing it.

llvm-svn: 105339
2010-06-02 18:54:47 +00:00
Rafael Espindola
aa18562c5c Replace ARM's getCalleeSavedRegClasses with a simpler solution
llvm-svn: 105335
2010-06-02 17:54:50 +00:00
Anton Korobeynikov
d8f3fc0f33 Some A9 load/store cleanups
llvm-svn: 105109
2010-05-29 19:25:39 +00:00
Anton Korobeynikov
16e9c73153 Some rough approximations for load/stores on A9
llvm-svn: 105108
2010-05-29 19:25:34 +00:00
Anton Korobeynikov
fb3252df43 NEON/VFP stuff can be issued only via Pipe1 on A9
llvm-svn: 105107
2010-05-29 19:25:29 +00:00
Anton Korobeynikov
ba7aa2f492 Add some integer instruction itineraries for A9
llvm-svn: 105106
2010-05-29 19:25:17 +00:00
Evan Cheng
01ab4e1d5a Schedule high latency instructions for latency reduction even if they are not vfp / NEON instructions.
llvm-svn: 105060
2010-05-28 23:25:23 +00:00
Jim Grosbach
7dd85bebee correct retattr
llvm-svn: 104980
2010-05-28 18:03:48 +00:00
Jim Grosbach
f4442c2ca2 Cosmetic cleanup. No functional change.
llvm-svn: 104974
2010-05-28 17:51:20 +00:00
Jim Grosbach
2eb2c2d257 make sure accesses to set up the jmpbuf don't get moved after it by the scheduler. Add a missing \n.
llvm-svn: 104967
2010-05-28 17:37:40 +00:00
Bob Wilson
e2ff075e4c Add the cc_out operand for t2RSBrs instructions. I missed this when I changed
the instruction class for t2RSB to add that operand in svn r104582.
Radar 8033757.

llvm-svn: 104907
2010-05-28 00:27:15 +00:00
Jim Grosbach
b004e2cf0f Update the saved stack pointer in the sjlj function context following either
an alloca() or an llvm.stackrestore(). rdar://8031573

llvm-svn: 104900
2010-05-27 23:49:24 +00:00