Commit Graph

41492 Commits

Author SHA1 Message Date
Bob Wilson 359f8ba337 Clean up a comment.
llvm-svn: 113442
2010-09-08 23:39:54 +00:00
Eric Christopher c3e9c404aa Very basic compare support.
llvm-svn: 113440
2010-09-08 23:13:45 +00:00
Owen Anderson 8084dbaf8e Relax the "don't unroll loops containing calls" rule. Instead, when a loop contains a call, lower the
unrolling threshold to the optimize-for-size threshold.  Basically, for loops containing calls, unrolling
can still be profitable as long as the loop is REALLY small.

llvm-svn: 113439
2010-09-08 23:10:07 +00:00
Eric Christopher 5838af54bf Delete dead code.
llvm-svn: 113436
2010-09-08 22:58:35 +00:00
Evan Cheng 722cd122dc Fix LDM_RET schedule itinery.
llvm-svn: 113435
2010-09-08 22:57:08 +00:00
Chris Lattner 28a9c2f89a fix rdar://8407548, I missed the commuted form of xchg/test without a suffix.
llvm-svn: 113427
2010-09-08 22:27:05 +00:00
Chris Lattner d7aba234c2 fix wonky formatting.
llvm-svn: 113426
2010-09-08 22:22:10 +00:00
Owen Anderson 3fe002dfb5 Generalize instcombine's support for combining multiple bit checks into a single test. Patch by Dirk Steinke!
llvm-svn: 113423
2010-09-08 22:16:17 +00:00
Chris Lattner 8ead237758 fix bugs in push/pop segment support, rdar://8407242
llvm-svn: 113422
2010-09-08 22:13:08 +00:00
Dale Johannesen 0d2e6ad504 Add intrinsic-based patterns for MMX PINSRW and PEXTRW.
llvm-svn: 113420
2010-09-08 22:08:40 +00:00
Eric Christopher 6489df7c8c Make the loads/stores match the type we really want to store.
llvm-svn: 113417
2010-09-08 21:49:50 +00:00
Dale Johannesen e54dba94f9 Check in forgotten file. Should fix build.
llvm-svn: 113409
2010-09-08 21:09:48 +00:00
Dale Johannesen 4dae01781f Slight cleanup, use only one form of MMXI_binop_rm_int.
llvm-svn: 113406
2010-09-08 20:54:00 +00:00
Jim Grosbach 504d23bd05 Re-enable usage of the ARM base pointer. r113394 fixed the known failures.
Re-running some nightly testers w/ it enabled to verify.

llvm-svn: 113399
2010-09-08 20:12:02 +00:00
Jim Grosbach 21c9471706 Fix errant fall-throughs causing the base pointer to be used when the frame
pointer was intended. rdar://8401980

llvm-svn: 113394
2010-09-08 19:55:28 +00:00
Dale Johannesen d79bb127dd Add intrinsic forms of mmx<->sse conversions. Notes:
Omission of memory form of PI2PD is intentional; this
does not use an MMX register and does not put the chip
into MMX mode (PI2PS, oddly enough, does).
Operands of PI2PS follow the gcc builtin, not Intel.

llvm-svn: 113388
2010-09-08 19:15:38 +00:00
Eric Christopher f5dd1929a2 Rewrite TargetMaterializeConstant.
llvm-svn: 113387
2010-09-08 18:56:34 +00:00
Jakob Stoklund Olesen 79e838b0a8 Remove dead code.
llvm-svn: 113386
2010-09-08 18:50:24 +00:00
Bruno Cardoso Lopes 99a9f4661a Minor change. Fix comments and remove unused and redundant code
llvm-svn: 113378
2010-09-08 18:12:31 +00:00
Roman Divacky 2ef1a589c5 ELF_STB_Local is 0 so setting and checking it must be done specially
llvm-svn: 113375
2010-09-08 18:08:40 +00:00
Owen Anderson 8e89e41faf Clarify the ownership model of LLVMContext and Module. Namely, contexts own
modules are instantiated in them.  If the context is deleted, all of its owned
modules are also deleted.

llvm-svn: 113374
2010-09-08 18:03:32 +00:00
Bruno Cardoso Lopes f7fee1c185 x86 vector shuffle lowering now relies only on target specific
nodes to emit shuffles and don't do isel mask matching anymore.
- Add the selection of the remaining shuffle opcode (movddup)
- Introduce two new functions to "recognize" where we may get
potential folds and add several comments to them explaining why
they are not yet in the desidered shape.
- Add more patterns to fallback the case where we select
a specific shuffle opcode as if it could fold a load, but it
can't, so remap to a valid instruction.
- Add a couple of FIXMEs to address in the following days once
there's a good solution to the current folding problem.

llvm-svn: 113369
2010-09-08 17:43:25 +00:00
Jim Grosbach 7dfca6fb51 Be more careful about when to do dynamic stack realignment. Since we have an
option to disable base pointer usage, pay attention to it when deciding
if we can realign (if no base pointer and VLAs, we can't).

llvm-svn: 113366
2010-09-08 17:22:12 +00:00
Jim Grosbach 53aa5e31e1 Add missing assert
llvm-svn: 113365
2010-09-08 17:05:45 +00:00
Roman Divacky 6c27de28b5 Unresolved weak symbols have value equal zero.
llvm-svn: 113358
2010-09-08 14:29:45 +00:00
Kalle Raiskila e542972828 Fix CellSPU vector shuffles, again.
Some cases of lowering to rotate were miscompiled.

llvm-svn: 113355
2010-09-08 11:53:38 +00:00
Chris Lattner 2907d2e419 add support for the commuted form of the test instruction, rdar://8018260.
llvm-svn: 113352
2010-09-08 05:51:12 +00:00
Chris Lattner a9ca7837e4 implement proper support for sysret{,l,q}, rdar://8403907
llvm-svn: 113350
2010-09-08 05:45:34 +00:00
Chris Lattner 063363fa80 implement the iret suite of instructions properly,
fixing rdar://8403974

llvm-svn: 113349
2010-09-08 05:38:31 +00:00
Chris Lattner 086a83afb1 add support for instruction prefixes on the same line as the instruction,
implementing rdar://8033482 and PR7254.

llvm-svn: 113348
2010-09-08 05:17:37 +00:00
Chris Lattner 91689c1d0f change the MC "ParseInstruction" interface to make it the
implementation's job to check for and lex the EndOfStatement
marker.

llvm-svn: 113347
2010-09-08 05:10:46 +00:00
Chris Lattner 8caea68a4f gas accepts xchg <mem>, <reg> as a synonym for xchg <reg>, <mem>.
Add this to the mc assembler, fixing PR8061

llvm-svn: 113346
2010-09-08 04:53:27 +00:00
NAKAMURA Takumi 7a23aa081a ARM/Disassembler: Fix definitions incompatible(unsigned and uint32_t) to Cygwin-1.5, following up to r113255.
llvm-svn: 113345
2010-09-08 04:48:17 +00:00
Chris Lattner 4703cb4a96 fix the encoding of the "jump on *cx" family of instructions,
rdar://8061602

llvm-svn: 113343
2010-09-08 04:30:51 +00:00
Jim Grosbach 535d3b4e09 remove trailing whitespace
llvm-svn: 113338
2010-09-08 03:54:02 +00:00
Jim Grosbach 19cb2f4c67 remove obsolete comment
llvm-svn: 113337
2010-09-08 03:51:44 +00:00
Jim Grosbach 261df12f64 disable for the moment while tracking down a few Thumb2-O0 failure that look
related. (attempt deux, complete w/ test update this time)

llvm-svn: 113333
2010-09-08 02:00:34 +00:00
Jim Grosbach b2c950187e woops. need to update a test along with this.
llvm-svn: 113332
2010-09-08 01:49:09 +00:00
Jim Grosbach 7cda56ea6a disable temporarily while sorting out a few test failures in Thumb2-O0 tests.
llvm-svn: 113331
2010-09-08 01:47:49 +00:00
Dan Gohman 64d842ec72 Add a new experimental generalized dependence query interface to
AliasAnalysis, and some code for implementing the new query on top of
existing implementations by making standard alias and getModRefInfo
queries.

llvm-svn: 113329
2010-09-08 01:32:20 +00:00
Jim Grosbach 136d035e45 correct spill code to properly determine if dynamic stack realignment is
present in the function and thus whether aligned load/store instructions can
be used.

llvm-svn: 113323
2010-09-08 00:26:59 +00:00
Jim Grosbach abcbe2474d VFP/NEON load/store multiple instructions are addrmode4, not 5.
llvm-svn: 113322
2010-09-08 00:25:50 +00:00
Owen Anderson a4d9c78aa1 Add a separate unrolling threshold when the current function is being optimized for size.
The threshold value of 50 is arbitrary, and I chose it simply by analogy to the inlining thresholds, where
the baseline unrolling threshold is slightly smaller than the baseline inlining threshold.  This could
undoubtedly use some tuning.

llvm-svn: 113306
2010-09-07 23:15:30 +00:00
Jakob Stoklund Olesen 4d19d2651d Don't add <imp-def> operands during register rewriting.
LiveIntervals already adds <imp-def> operands for super-registers when a subreg
def defines the whole register. Thus, it is not necessary to do it again when
rewriting.

In fact, the super-register imp-defs caused miscompilations because the late
scheduler couldn't see that the super-register was read.

We still add super-reg <imp-use,kill> operands when rewriting virtuals to
physicals.

llvm-svn: 113299
2010-09-07 22:38:45 +00:00
Jim Grosbach 88628e9738 To shrink a t2LDM instruction to the 16-bit wide tLDM instruction, the base
register must be one of the destination registers for the load. Otherwise,
the tLDM instruction will write-back to the base register, which isn't what's
desired (otherwise, we'd have a t2LDM_UPD instead).

rdar://8394087

llvm-svn: 113297
2010-09-07 22:30:53 +00:00
Jim Grosbach 9877af3b46 grammar tweak
llvm-svn: 113289
2010-09-07 21:30:25 +00:00
Bruno Cardoso Lopes 6b1d62c529 Factor out some x86 vector shuffle rewriting and add comments about the direction the shuffle lowering is heading to
llvm-svn: 113286
2010-09-07 21:03:14 +00:00
Owen Anderson d12ea002b8 Fix PR7972, in which the PassRegistry was being leaked. As part of this,
switch to using a ManagedStatic for the global PassRegistry instead of a
ManagedCleanup, and fix a destruction ordering bug this exposed.

llvm-svn: 113283
2010-09-07 20:48:10 +00:00
Bruno Cardoso Lopes 7c483028fb Move code around to prepare for moving some of the logic together to another function
llvm-svn: 113267
2010-09-07 20:20:27 +00:00
Bill Wendling 353802114f Add an MVT::x86mmx type. It will take the place of all current MMX vector types.
llvm-svn: 113261
2010-09-07 20:03:56 +00:00
Chris Lattner 6e27b3e004 Fix a serious performance regression introduced by r108687 on linux:
turning (fptrunc (sqrt (fpext x))) -> (sqrtf x)  is great, but we have
to delete the original sqrt as well.  Not doing so causes us to do 
two sqrt's when building with -fmath-errno (the default on linux).

llvm-svn: 113260
2010-09-07 20:01:38 +00:00
Evan Cheng 5444b36e01 Remove a dead comment.
llvm-svn: 113259
2010-09-07 20:01:10 +00:00
Chris Lattner 091012d5d5 hopefully fix a problem building on cygwin-1.5
llvm-svn: 113255
2010-09-07 19:50:53 +00:00
Owen Anderson a74fa15f32 Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details.

llvm-svn: 113252
2010-09-07 19:16:25 +00:00
Bruno Cardoso Lopes 5a45db3e6c decouple MMX check from regular splat checks. Some refactoring is coming, and MMX should be left alone to be easily removed after moving to intrinsics
llvm-svn: 113247
2010-09-07 18:41:45 +00:00
Bruno Cardoso Lopes 4f5d4b4a6e Remove now useless check, because the code can be matched below, no need to leave it for isel
llvm-svn: 113242
2010-09-07 18:29:03 +00:00
Dan Gohman d51b43181e Issue a #error if the host doesn't have an implementation for
GetMainExecutable yet.

llvm-svn: 113240
2010-09-07 18:26:49 +00:00
Bruno Cardoso Lopes c9b3316fea Minor change. Since the checks are equivalent, use isMMX
llvm-svn: 113239
2010-09-07 18:24:00 +00:00
Nick Lewycky 4c82c6c6fe Create PTX backend. Patch by Che-Liang Chiou!
llvm-svn: 113235
2010-09-07 18:14:24 +00:00
Dale Johannesen 605acfe533 Add patterns for MMX that use the new intrinsics.
Enable palignr intrinsic.
These may need adjustment for a new VT in due course.

llvm-svn: 113233
2010-09-07 18:10:56 +00:00
Bruno Cardoso Lopes f0ea222255 Remove unused target specific node
llvm-svn: 113224
2010-09-07 17:38:55 +00:00
Benjamin Kramer 1ecb978214 Don't leak the old operand when transforming "sldt" into "sldtw".
llvm-svn: 113200
2010-09-07 14:40:58 +00:00
Nick Lewycky ad48e01eef Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.

llvm-svn: 113196
2010-09-07 05:39:02 +00:00
Nick Lewycky 71972d45dc Fix major bug in thunk detection. Also verify the calling convention.
Switch from isWeakForLinker to mayBeOverridden which is more accurate.

Add more statistics and debugging info. Add comments. Move static function
outside anonymous namespace.

llvm-svn: 113190
2010-09-07 01:42:10 +00:00
Chris Lattner 30bb384944 add missing cmov aliases, this resolves rdar://8208499
llvm-svn: 113189
2010-09-07 00:05:45 +00:00
Chris Lattner 3ae9398d5f remove duplicated entry
llvm-svn: 113188
2010-09-06 23:57:24 +00:00
Nick Lewycky a35462da3d Add a new isSignWrappedSet() method to ConstantRange.
Fix zeroExtend and signExtend to support empty sets, and to return the smallest
possible result set which contains the extension of each element in their
inputs. For example zext i8 [100, 10) to i16 is now [0, 256), not i16 [100, 10)
which contains 63446 members.

llvm-svn: 113187
2010-09-06 23:52:49 +00:00
Chris Lattner 7ece716da2 "sldt <mem>" is ambiguous in 64-bit mode, but should
always be disambiguated as sldtw.  sldtw and sldtq with
a mem operands have the same effect, but sldtw is more
compact.  Force it to sldtw, resolving rdar://8017530

llvm-svn: 113186
2010-09-06 23:51:44 +00:00
Chris Lattner 415e04fad2 fix rdar://8017621 - llvm-mc can't guess encoding for "push $(1000)"
llvm-svn: 113184
2010-09-06 23:40:56 +00:00
Chris Lattner 34e366b45c fix the operand constraints of the immediate form of in/out,
allowing unsigned 8-bit operands.  This fixes rdar://8208481

llvm-svn: 113182
2010-09-06 23:29:05 +00:00
Chris Lattner 339cc7bfef in the case where an instruction only has one implementation
of a mneumonic, report operand errors with better location
info.  For example, we now report:

t.s:6:14: error: invalid operand for instruction
        cwtl $1
             ^

but we fail for common cases like:

t.s:11:4: error: invalid operand for instruction
   addl $1, $1
   ^

because we don't know if this is supposed to be the reg/imm or imm/reg
form.

llvm-svn: 113178
2010-09-06 22:11:18 +00:00
Chris Lattner 628fbecf4f Now that we know if we had a total fail on the instruction mnemonic,
give a more detailed error.  Before:

t.s:11:4: error: unrecognized instruction
   addl $1, $1
   ^
t.s:12:4: error: unrecognized instruction
   f2efqefa $1
   ^

After:

t.s:11:4: error: invalid operand for instruction
   addl $1, $1
   ^
t.s:12:4: error: invalid instruction mnemonic 'f2efqefa'
   f2efqefa $1
   ^

This fixes rdar://8017912 - llvm-mc says "unrecognized instruction" when it means "invalid operands"

llvm-svn: 113176
2010-09-06 21:54:15 +00:00
Chris Lattner 31c63fb518 simplify the hacks around jrcxz.
llvm-svn: 113167
2010-09-06 20:10:12 +00:00
Chris Lattner b4be28f33d have tblgen detect when an instruction would have matched, but
failed because a subtarget feature was not enabled.  Use this to
remove a bunch of hacks from the X86AsmParser for rejecting things
like popfl in 64-bit mode.  Previously these hacks weren't needed,
but were important to get a message better than "invalid instruction"
when used in the wrong mode.

This also fixes bugs where pushal would not be rejected correctly in
32-bit mode (just pusha).

llvm-svn: 113166
2010-09-06 20:08:02 +00:00
Chris Lattner a22a368e7c change MatchInstructionImpl to return an enum instead of bool.
llvm-svn: 113165
2010-09-06 19:22:17 +00:00
Chris Lattner 3e4582ada5 have AsmMatcherEmitter.cpp produce the hunk of code that gets included
into the middle of the class, and rework how the different sections of
the generated file are conditionally included for simplicity.

llvm-svn: 113163
2010-09-06 19:11:01 +00:00
Roman Divacky e1278b57f9 Redefine LOOP* instructions from I to Ii8PCRel as they take an i8 argument.
llvm-svn: 113158
2010-09-06 18:43:14 +00:00
Chris Lattner 4cfbcdc7b6 random cleanups
llvm-svn: 113157
2010-09-06 18:32:06 +00:00
Benjamin Kramer 3723ba1fe0 MCELF: Align symtab, relocation sections and section headers properly. Patch by Krister Wombell.
llvm-svn: 113155
2010-09-06 16:11:52 +00:00
Chris Lattner 963debc109 compute the HasSSE3 bit correctly, patch by Nikolai Saoukh.
llvm-svn: 113147
2010-09-06 05:19:44 +00:00
Chris Lattner be9019090e fix PR8067, an over-aggressive assertion in LICM.
llvm-svn: 113146
2010-09-06 05:11:24 +00:00
Chris Lattner a58edd1df3 cleanup some of the lifetime/invariant marker stuff, add a big fixme.
llvm-svn: 113144
2010-09-06 03:58:04 +00:00
Chris Lattner e34c835bde speed up -gvn 3.4% on the testcase in PR7023
llvm-svn: 113135
2010-09-06 01:26:29 +00:00
Chris Lattner b01c24a945 Teach loop rotate to hoist trivially invariant instructions
in the duplicated block instead of duplicating them.  

Duplicating them into the end of the loop and the preheader 
means that we got a phi node in the header of the loop, 
which prevented LICM from hoisting them.  GVN would
usually come around later and merge the duplicated 
instructions so we'd get reasonable output... except that
anything dependent on the shoulda-been-hoisted value can't
be hoisted.  In PR5319 (which this fixes), a memory value
didn't get promoted.

llvm-svn: 113134
2010-09-06 01:10:22 +00:00
Chris Lattner da24b9a49a pull a simple method out of LICM into a new
Loop::hasLoopInvariantOperands method. Remove
a useless and confusing Loop::isLoopInvariant(Instruction)
method, which didn't do what you thought it did.

No functionality change.

llvm-svn: 113133
2010-09-06 01:05:37 +00:00
Chris Lattner f43cb302ca remove some dead code. t2addrmode_imm8s4 is never used in a
pattern, so there is no need to define a matching function.

llvm-svn: 113122
2010-09-05 22:51:11 +00:00
Chris Lattner e40007a71b cleanups.
llvm-svn: 113119
2010-09-05 21:18:45 +00:00
Chris Lattner 419d0aa0ed add a comment about where this should eventually move.
llvm-svn: 113117
2010-09-05 20:33:40 +00:00
Chris Lattner 5cac0f71ca update this.
llvm-svn: 113116
2010-09-05 20:22:09 +00:00
Chris Lattner 1edf7434cf more cleanups
llvm-svn: 113115
2010-09-05 20:13:07 +00:00
Chris Lattner e6214557e7 Change lower atomic pass to use IntrinsicInst to simplify it a bit.
llvm-svn: 113114
2010-09-05 20:10:47 +00:00
Chris Lattner 05ef361b5e eliminate some non-obvious casts. UndefValue isa Constant.
llvm-svn: 113113
2010-09-05 20:03:09 +00:00
Chris Lattner 72d283c826 fix PR8063, a crash in globalopt in the malloc analysis code.
llvm-svn: 113109
2010-09-05 17:20:46 +00:00
Lang Hames 64a4a13617 Added initialisers for reduction rule counters.
llvm-svn: 113108
2010-09-05 13:42:32 +00:00
Nick Lewycky e3ac69eca3 Fix warning reported by MSVC++ builder.
llvm-svn: 113106
2010-09-05 09:11:38 +00:00
Nick Lewycky f3a07ec394 Switch FnSet to containing the ComparableFunction instead of a pointer to one.
This reduces malloc traffic (yay!) and removes MergeFunctionsEqualityInfo.

llvm-svn: 113105
2010-09-05 09:00:32 +00:00
Nick Lewycky 0095937b13 Fix many bugs when merging weak-strong and weak-weak pairs. We now merge all
strong functions first to make sure they're the canonical definitions and then
do a second pass looking only for weak functions.

llvm-svn: 113104
2010-09-05 08:22:49 +00:00
Chris Lattner eeba0c73e5 implement rdar://6653118 - fastisel should fold loads where possible.
Since mem2reg isn't run at -O0, we get a ton of reloads from the stack,
for example, before, this code:

int foo(int x, int y, int z) {
  return x+y+z;
}

used to compile into:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	movl	4(%rsp), %esi
	addl	%edx, %esi
	movl	(%rsp), %edx
	addl	%esi, %edx
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Now we produce:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	addl	4(%rsp), %edx    ## Folded load
	addl	(%rsp), %edx     ## Folded load
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Fewer instructions and less register use = faster compiles.

llvm-svn: 113102
2010-09-05 02:18:34 +00:00
Jakob Stoklund Olesen 313358fef9 Remove dead code.
Clobber ranges are no longer used when joining physical registers.
Instead, all aliases are checked for interference.

llvm-svn: 113084
2010-09-04 21:09:33 +00:00
Chris Lattner 0963048185 dead method.
llvm-svn: 113077
2010-09-04 18:19:16 +00:00
Chris Lattner 65b48b5dfc zap dead code.
llvm-svn: 113073
2010-09-04 18:12:00 +00:00
Chris Lattner 55118e7224 remove dead code, mblaze uses SelectAddrRegImm/SelectAddrRegReg,
not SelectAddr

llvm-svn: 113072
2010-09-04 18:02:47 +00:00
Bruno Cardoso Lopes c6accda78e Remove the last bit of isShuffleMaskLegal checks and improve the comment regarding mmx shuffles
llvm-svn: 113059
2010-09-04 02:58:56 +00:00
Bruno Cardoso Lopes 731bcc1abf make explicit that we not handle several mmx shuffles
llvm-svn: 113058
2010-09-04 02:50:13 +00:00
Dan Gohman 487e250109 Fix LoopSimplify to notify ScalarEvolution when splitting a loop backedge
into an inner loop, as the new loop iteration may differ substantially.
This fixes PR8078.

llvm-svn: 113057
2010-09-04 02:42:48 +00:00
Bruno Cardoso Lopes 20779ee157 Emit target specific nodes to handle palignr. Do not touch it for MMX versions yet.
llvm-svn: 113056
2010-09-04 02:36:07 +00:00
Bruno Cardoso Lopes cff7cd18ab Emit target specific nodes to handle splats starting at zero indicies
llvm-svn: 113055
2010-09-04 02:02:14 +00:00
Bruno Cardoso Lopes 95759917eb Emit target specific nodes for isPSHUFHWMask and isPSHUFLWMask
llvm-svn: 113050
2010-09-04 01:36:45 +00:00
Bruno Cardoso Lopes 2b57008c72 Emit target specific nodes for isSHUFPMask
llvm-svn: 113048
2010-09-04 01:22:57 +00:00
Bruno Cardoso Lopes 2f7af36134 Previous isMOVLMask matching already emits targets nodes, remove check
llvm-svn: 113047
2010-09-04 00:50:08 +00:00
Bruno Cardoso Lopes 9f8e704151 One more check from the original isShuffleMaskLegal goes away
llvm-svn: 113045
2010-09-04 00:46:16 +00:00
Bruno Cardoso Lopes 16959372bb Remove a duplicated but useless check that i've inserted in the previous commit.
llvm-svn: 113044
2010-09-04 00:43:12 +00:00
Bruno Cardoso Lopes 44578d38d3 Refactor some code and remove the extra checks for unpckl_undef and unpckh_undef
llvm-svn: 113043
2010-09-04 00:39:43 +00:00
Chris Lattner 50506787d1 fix a bug in my licm rewrite when a load from the promoted memory
location is being re-stored to the memory location.  We would get
a dangling pointer from the SSAUpdate data structure and miss a 
use.  This fixes PR8068

llvm-svn: 113042
2010-09-04 00:12:30 +00:00
Bruno Cardoso Lopes 7829d0e74b Remove check for unpckh mask
llvm-svn: 113035
2010-09-03 23:32:47 +00:00
Bruno Cardoso Lopes d1dacc57aa Remove check for unpckl mask
llvm-svn: 113034
2010-09-03 23:31:50 +00:00
Bruno Cardoso Lopes 207b9d6218 Inline isShuffleMaskLegal into LowerVECTOR_SHUFFLE, so we can start
checking each standalone condition and decide whether emit target
specific nodes or remove the condition if it's already matched before.

llvm-svn: 113031
2010-09-03 23:24:06 +00:00
Owen Anderson c91c1a205a Propagate non-local comparisons. Fixes PR1757.
llvm-svn: 113025
2010-09-03 22:47:08 +00:00
Dan Gohman 47bec3cb57 Disable the asserts that check that normalization is perfectly
invertible. ScalarEvolution's folding routines don't always succeed
in canonicalizing equal expressions to a single canonical form, and
this can cause these asserts to fail, even though there's no actual
correctness problem. This fixes PR8066.

llvm-svn: 113021
2010-09-03 22:12:56 +00:00
Bruno Cardoso Lopes 2bef20eda7 Reapply considered harmfull part of rr112934 and r112942.
"Use target specific nodes instead of relying in unpckl and
unpckh pattern fragments during isel time. Also place a
depth limit in getShuffleScalarElt.

llvm-svn: 113020
2010-09-03 22:09:41 +00:00
Jim Grosbach 005155e236 previous patch was a little too tricky for its own good. Don't try to
overload UserInInstr. Explicitly check Allocatable. The early exit in the
condition will mean the performance impact of the extra test should be
minimal.

llvm-svn: 113016
2010-09-03 21:45:15 +00:00
Dale Johannesen 367afb5a00 Remove the rest of the nonexistent 64-bit AVX instructions.
Bruno, please review.

llvm-svn: 113014
2010-09-03 21:23:00 +00:00
Bruno Cardoso Lopes a750d994fe Reapply last harmless part of r112934, the pattern fragment to match X86Unpcklpd
llvm-svn: 113009
2010-09-03 20:44:26 +00:00
Bruno Cardoso Lopes fe8717c573 Reintroduce a simple function refactoring done in r112934, also without any functionality changes
llvm-svn: 113008
2010-09-03 20:20:02 +00:00
Bruno Cardoso Lopes 48e589b122 Reapply piecies of r112942 and r112934 which don't do
functional changes

llvm-svn: 113007
2010-09-03 20:10:35 +00:00
Bruno Cardoso Lopes 6979cf0808 Reapply Fix comment
llvm-svn: 113006
2010-09-03 19:55:05 +00:00
Daniel Dunbar 6f3da24d70 Revert r112934, "- Use specific nodes to match unpckl masks.", which introduced
some infinite loop and select failures.
 - Apologies for eager reverting, but its branch day.

llvm-svn: 113000
2010-09-03 19:38:11 +00:00
Daniel Dunbar f1aacd55c0 Revert r112938 "Fix comment", which depends on r112934, which introduced some
infinite loop and select failures.

llvm-svn: 112999
2010-09-03 19:38:08 +00:00
Daniel Dunbar 0ffe4db45c Revert r112942, "Use punpckh and unpckh family of nodes instead of using unpckh
mask pattern fragment", which depends on r112934, which introduced some infinite
loop and select failures.

llvm-svn: 112998
2010-09-03 19:38:05 +00:00
Bob Wilson 3626a8c136 Add a missing check when legalizing a vector extending load. This doesn't
solve the root problem, but it corrects the bug in the code I added to
support legalizing in the case where the non-extended type is also legal.

llvm-svn: 112997
2010-09-03 19:20:37 +00:00
Bill Wendling 78395e4b8a Get rid of "passing signed into unsigned parameter" warning on PPC.
llvm-svn: 112995
2010-09-03 19:09:46 +00:00
Owen Anderson c725462245 Add support for simplifying a load from a computed value to a load from a global when it
is provable that they're equivalent.  This fixes PR4855.

llvm-svn: 112994
2010-09-03 19:08:37 +00:00
Jim Grosbach 03f4be86ba Re-apply r112883:
"For ARM stack frames that utilize variable sized objects and have either
large local stack areas or require dynamic stack realignment, allocate a
base register via which to access the local frame. This allows efficient
access to frame indices not accessible via the FP (either due to being out
of range or due to dynamic realignment) or the SP (due to variable sized
object allocation). In particular, this greatly improves efficiency of access
to spill slots in Thumb functions which contain VLAs."

r112986 fixed a latent bug exposed by the above.

llvm-svn: 112989
2010-09-03 18:37:12 +00:00
Jakob Stoklund Olesen 662fecd654 VirtRegRewriter checks for early clobbers before it reuses an available stack
slot.

Teach it to also check for early clobbered aliases, and early clobber operands
following the current operand.

This fixes the miscompilation in PR8044 where EC registers eax and ecx were
being used for inputs.

llvm-svn: 112988
2010-09-03 18:36:56 +00:00
Jim Grosbach 21a2a2579f Check the local frame alignment for determining whether dynamic stack
alignment should be performed. Otherwise dynamic realignment may trigger
when the register allocator has already used the frame pointer as a general
purpose register. That is, we need to make sure that the list of reserved
registers doesn't change after register allocation.

llvm-svn: 112986
2010-09-03 18:28:19 +00:00
Bob Wilson 35fafca587 Finish converting the rest of the NEON VLD instructions to use pseudo-
instructions prior to regalloc.  Since it's getting a little close to
the 2.8 branch deadline, I'll have to leave the rest of the instructions
handled by the NEONPreAllocPass for now, but I didn't want to leave half
of the VLD instructions converted and the other half not.

llvm-svn: 112983
2010-09-03 18:16:02 +00:00
Daniel Dunbar 2ac3386ef3 Revert "For ARM stack frames that utilize variable sized objects and have either", it is breaking oggenc with Clang for ARMv6.
This reverts commit 8d6e29cfda270be483abf638850311670829ee65.

llvm-svn: 112962
2010-09-03 15:26:42 +00:00
Benjamin Kramer 8fd07c026e Zap dead code.
llvm-svn: 112955
2010-09-03 12:13:18 +00:00
Duncan Sands bc42c906bb Reapply commit 112702 which was speculatively reverted by echristo.
Original commit message:
Use the SSAUpdator to turn calls to eh.exception that are not in a
landing pad into uses of registers rather than loads from a stack
slot.  Doesn't touch the 'orrible hack code - Bill needs to persuade
me harder :)

llvm-svn: 112952
2010-09-03 08:31:48 +00:00
Bruno Cardoso Lopes d6634a5b2e AVX doesn't support mm operations neither its instrinsics.
The AVX versions of PALIGN and PABS* should only exist for
128-bit. Remove the unnecessary stuff.

llvm-svn: 112944
2010-09-03 02:08:45 +00:00
Bruno Cardoso Lopes a85ec10483 Use punpckh and unpckh family of nodes instead of using unpckh mask pattern fragment
llvm-svn: 112942
2010-09-03 01:39:08 +00:00
Bob Wilson f65c9ef720 Replace NEON vabdl, vaba, and vabal intrinsics with combinations of the
vabd intrinsic and add and/or zext operations.  In the case of vaba, this
also avoids the need for a DAG combine pattern to combine vabd with add.
Update tests.  Auto-upgrade the old intrinsics.

llvm-svn: 112941
2010-09-03 01:35:08 +00:00
Bruno Cardoso Lopes adc6bca2dd Fix comment
llvm-svn: 112938
2010-09-03 01:28:51 +00:00
Bruno Cardoso Lopes cce44678b4 - Use specific nodes to match unpckl masks.
- Teach getShuffleScalarElt how to handle more target
specific nodes, so the DAGCombine can make use of it.
- Add another hack to avoid the node update problem
during legalization. More description on the comments

llvm-svn: 112934
2010-09-03 01:24:00 +00:00
Eric Christopher 6aaed72949 Simple branch instruction support.
llvm-svn: 112923
2010-09-03 00:35:47 +00:00
Jakob Stoklund Olesen 08aede2538 Don't call Predicate_* from X86 target.
llvm-svn: 112921
2010-09-03 00:35:18 +00:00
Jakob Stoklund Olesen d7dcbb57fb Remove Predicate_* calls from MBlaze and XCore
llvm-svn: 112920
2010-09-03 00:35:16 +00:00
Jakob Stoklund Olesen 44a2797e02 Remove Predicate_* calls from Mips
llvm-svn: 112919
2010-09-03 00:35:13 +00:00
Eric Christopher c3e118ef3d Add basic support for materializing constants (including fp) and
stores.

llvm-svn: 112912
2010-09-02 23:43:26 +00:00
Chris Lattner ad074cb3f2 lets get crazy and name the header file the exact class name,
not a scrunched version of it.

llvm-svn: 112904
2010-09-02 23:09:42 +00:00
Anton Korobeynikov a5a645559c Properly emit __chkstk call instead of __alloca on non-mingw windows targets.
Patch by Cameron Esfahani!

llvm-svn: 112902
2010-09-02 23:03:46 +00:00
Chris Lattner 19199cce55 stop forcing a noop AssemblyAnnotationWriter to silence #uses
comments, these don't happen anymore.

llvm-svn: 112901
2010-09-02 23:03:10 +00:00
Devang Patel 854ad26ae2 There is no need to use .set here.
Thanks Chris!

llvm-svn: 112900
2010-09-02 23:01:10 +00:00
Chris Lattner fb483625b1 reapply 112894:
Remove #uses comments from functions: they we're padded out to column 50
and were potentially confusing for externally visible functions.

going further, remove the "<i8**> [#uses=3]" comments entirely. They
add a lot of noise, confuse people about what the IR is, and don't add 
any particular value.  When the types are long it makes it really really
hard to read IR.

If someone is interested in this sort of thing, the right way to do this
is to implement an AsmAnnotationWriter that produces the same output, and
add a flag to llvm-dis (only) to produce this output.

llvm-svn: 112899
2010-09-02 22:52:10 +00:00
Bruno Cardoso Lopes 02a05a6a89 Move insertps mask decoding to header file
llvm-svn: 112896
2010-09-02 22:43:39 +00:00
Chris Lattner 0744bfa2a8 revert patch, need to update clang tests too
llvm-svn: 112895
2010-09-02 22:42:07 +00:00
Chris Lattner 86599cc088 Remove #uses comments from functions: they we're padded out to column 50
and were potentially confusing for externally visible functions.

going further, remove the "<i8**> [#uses=3]" comments entirely. They
add a lot of noise, confuse people about what the IR is, and don't add 
any particular value.  When the types are long it makes it really really
hard to read IR.

If someone is interested in this sort of thing, the right way to do this
is to implement an AsmAnnotationWriter that produces the same output, and
add a flag to llvm-dis (only) to produce this output.

llvm-svn: 112894
2010-09-02 22:41:24 +00:00
Dan Gohman 2adf2f2714 Use the FindProgramByName fallback only with known absolute paths.
I wasn't able to convince myself that all GetMainExecutable
implementations always return absolute paths; this prevents
unexpected behavior in case they ever don't.

llvm-svn: 112888
2010-09-02 22:32:38 +00:00
Anton Korobeynikov a689c5b2c0 Revert win64 changes. They seem to be incomplete
llvm-svn: 112885
2010-09-02 22:31:32 +00:00
Jim Grosbach 7fd9aea67c For ARM stack frames that utilize variable sized objects and have either
large local stack areas or require dynamic stack realignment, allocate a
base register via which to access the local frame. This allows efficient
access to frame indices not accessible via the FP (either due to being out
of range or due to dynamic realignment) or the SP (due to variable sized
object allocation). In particular, this greatly improves efficiency of access
to spill slots in Thumb functions which contain VLAs.

rdar://7352504
rdar://8374540
rdar://8355680

llvm-svn: 112883
2010-09-02 22:29:01 +00:00
Chris Lattner affc0e42f0 fix more AST updating bugs, correcting miscompilation in PR8041
llvm-svn: 112878
2010-09-02 22:19:10 +00:00
Owen Anderson 2912df072d Remove incorrect and poorly tested code for trying to reason about values on default edges of
switches.  Just return the conservatively correct answer.

llvm-svn: 112876
2010-09-02 22:16:52 +00:00
Anton Korobeynikov 56291f7e53 Properly allocate win64 shadow reg area.
Patch by Jan Sjodin!

llvm-svn: 112875
2010-09-02 22:16:28 +00:00
John McCall 7f55c258c6 After some discussion with djg, teach SmallVector to grow from a zero
capacity and remove the workaround in SmallVector<T,0>.  There are some
theoretical benefits to a N->2N+1 growth policy anyway.

llvm-svn: 112870
2010-09-02 21:55:03 +00:00
Bruno Cardoso Lopes 814a69c330 Move decoding of insertps back to avoid unused warnings in x86 isel lowering, and fix movlhps/movhlps to decode 4 elements shuffles
llvm-svn: 112869
2010-09-02 21:51:11 +00:00
Devang Patel 3bffd52d78 Detect undef value early and save unnecessary NodeMap query.
llvm-svn: 112864
2010-09-02 21:29:42 +00:00
Dan Gohman 3c9b5f394b Don't narrow the load and store in a load+twiddle+store sequence unless
there are clearly no stores between the load and the store. This fixes
this miscompile reported as PR7833.

This breaks the test/CodeGen/X86/narrow_op-2.ll optimization, which is
safe, but awkward to prove safe. Move it to X86's README.txt.

llvm-svn: 112861
2010-09-02 21:18:42 +00:00
Devang Patel 98d3edfe2a Tidy up.
llvm-svn: 112858
2010-09-02 21:02:27 +00:00
Jim Grosbach b2a9025bad trailing whitespace
llvm-svn: 112852
2010-09-02 19:52:39 +00:00
Benjamin Kramer e39017cb97 Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
llvm-svn: 112849
2010-09-02 18:53:37 +00:00
Jim Grosbach 6040995128 remove trailing whitespace
llvm-svn: 112847
2010-09-02 18:44:51 +00:00
Bruno Cardoso Lopes c79f50170a Move x86 specific shuffle mask decoding to its own header, it's also going to be used elsewhere. Also trim trailing whitespaces
llvm-svn: 112846
2010-09-02 18:40:13 +00:00
Jim Grosbach 35f3252036 The scavenger should just use getAllocatableSet() rather than reinventing it
locally.

llvm-svn: 112845
2010-09-02 18:29:04 +00:00
Dan Gohman 9e857449de Apply a patch from Kees van Reeuwijk to add support for Minix.
Minix apparently doesn't like double-slash separators, and there's
no apparent need for them here.

llvm-svn: 112844
2010-09-02 18:24:46 +00:00
Owen Anderson a8c896b704 Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not
be treated as equivalent.

llvm-svn: 112843
2010-09-02 18:23:58 +00:00
Jim Grosbach aec776fd2a handle case where a register class is specified
llvm-svn: 112842
2010-09-02 18:18:52 +00:00
Jim Grosbach 66c681a644 Now that register allocation properly considers reserved regs, simplify the
ARM register class allocation order functions to take advantage of that.

llvm-svn: 112841
2010-09-02 18:14:29 +00:00
Benjamin Kramer 5af02b0360 Allow MCSA_WeakRef in ELF. Patch by Roman Divacky.
llvm-svn: 112834
2010-09-02 17:18:32 +00:00
Jim Grosbach 944aece38a Anti-dependency breaking needs to be careful not to use reserved regs
llvm-svn: 112832
2010-09-02 17:12:55 +00:00
Devang Patel da3ef85460 Fix .debug_range for linux. Patch by Krister Wombell.
llvm-svn: 112830
2010-09-02 16:43:44 +00:00
Jim Grosbach 5d43a35e6d Mask out reserved registers when constructing the set of allocatable regs.
llvm-svn: 112828
2010-09-02 16:31:21 +00:00
Bob Wilson 5a1df805e5 Fill in a missing comment.
llvm-svn: 112826
2010-09-02 16:17:29 +00:00
Bob Wilson 75a6408f88 Convert VLD1 and VLD2 instructions to use pseudo-instructions until
after regalloc.

llvm-svn: 112825
2010-09-02 16:00:54 +00:00
Duncan Sands 8dda07428a Print the number of uses of a function in the .ll since it can be informative
and there seems to be no reason not to.

llvm-svn: 112812
2010-09-02 08:52:23 +00:00
Lang Hames 9a6f8ee32c Added support for register allocators to record which intervals are spill intervals, and where the uses and defs of the original intervals were in the original code.
Spill intervals can be hidden using the "-rmf-intervals=virt-nospills*" option.

llvm-svn: 112811
2010-09-02 08:27:00 +00:00
Duncan Sands 6778149f7e Reapply commit 112699, speculatively reverted by echristo, since
I'm sure it is harmless.  Original commit message:
If PrototypeValue is erased in the middle of using the SSAUpdator
then the SSAUpdator may access freed memory.  Instead, simply pass
in the type and name explicitly, which is all that was used anyway.

llvm-svn: 112810
2010-09-02 08:14:03 +00:00
Chandler Carruth d30f8ec11e Silence an ambiguous else warning from GCC.
llvm-svn: 112809
2010-09-02 07:08:05 +00:00
Lang Hames b59620f519 Added counters for PBQP reduction rules.
llvm-svn: 112807
2010-09-02 05:37:52 +00:00
Bruno Cardoso Lopes 489613f1e5 Replace unpckl_undef and unpckh_undef matching with target specific opcodes
llvm-svn: 112806
2010-09-02 05:23:12 +00:00
Bruno Cardoso Lopes e4e4be3885 Move condition out to prepare for more matching
llvm-svn: 112805
2010-09-02 04:20:26 +00:00
Bruno Cardoso Lopes bf7fd146c7 Remove checking for isUNPCKL_v_undef_Mask, the specific node is already emitted for it
llvm-svn: 112804
2010-09-02 03:57:58 +00:00
NAKAMURA Takumi 4fa39acb53 llvm::FindExecutable(): Retrieve the name with suffix.exe, if available.
bugpoint uses it.

llvm-svn: 112803
2010-09-02 03:46:04 +00:00
Bruno Cardoso Lopes 6a7f634487 become more strict about when it's safe to use X86ISD::MOVLPS
llvm-svn: 112799
2010-09-02 02:35:51 +00:00
Eric Christopher 2020d69800 Clang's -ccc-host-triple was ignoring the arch specifier on my triple,
I don't need to implement this quite yet - and not for ConstantInt anyhow.

llvm-svn: 112798
2010-09-02 02:30:46 +00:00
Eric Christopher 92db201e23 This should be TargetMaterializeConstant instead.
llvm-svn: 112795
2010-09-02 01:48:11 +00:00
Eric Christopher 6a0333c1ed One definition of isThumb is plenty, thanks.
llvm-svn: 112793
2010-09-02 01:39:14 +00:00
Jim Grosbach 8ee5cd99ef Remove trailing whitespace
llvm-svn: 112790
2010-09-02 01:02:06 +00:00
Eric Christopher 74487fcbe7 Rework arm fast-isel load and store handling. Move offset computation
into the "address selection" routine and handle constant materialization
for stores.

llvm-svn: 112788
2010-09-02 00:53:56 +00:00
Jim Grosbach 64df92a9b2 Add a bit of debug output for register scavenging
llvm-svn: 112787
2010-09-02 00:51:37 +00:00
Jim Grosbach 6f2067659d trivial cleanup
llvm-svn: 112779
2010-09-02 00:02:26 +00:00