Commit Graph

41610 Commits

Author SHA1 Message Date
Dale Johannesen
52664c8efe Add intrinsic-based patterns for MMX PINSRW and PEXTRW.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113420 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 22:08:40 +00:00
Eric Christopher
30b663339e Make the loads/stores match the type we really want to store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 21:49:50 +00:00
Dale Johannesen
ab1deb998e Check in forgotten file. Should fix build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 21:09:48 +00:00
Dale Johannesen
246658f158 Slight cleanup, use only one form of MMXI_binop_rm_int.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 20:54:00 +00:00
Jim Grosbach
d0bd76b0fb Re-enable usage of the ARM base pointer. r113394 fixed the known failures.
Re-running some nightly testers w/ it enabled to verify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 20:12:02 +00:00
Jim Grosbach
951f699afb Fix errant fall-throughs causing the base pointer to be used when the frame
pointer was intended. rdar://8401980

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 19:55:28 +00:00
Dale Johannesen
af4748168c 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 19:15:38 +00:00
Eric Christopher
845c5757ed Rewrite TargetMaterializeConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 18:56:34 +00:00
Jakob Stoklund Olesen
4a4bc3fba6 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 18:50:24 +00:00
Bruno Cardoso Lopes
0a7dd4fa40 Minor change. Fix comments and remove unused and redundant code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 18:12:31 +00:00
Roman Divacky
b629dcca72 ELF_STB_Local is 0 so setting and checking it must be done specially
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 18:08:40 +00:00
Owen Anderson
30268be89d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 18:03:32 +00:00
Bruno Cardoso Lopes
1485cc2bb3 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 17:43:25 +00:00
Jim Grosbach
30c93e1cd3 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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 17:22:12 +00:00
Jim Grosbach
6b53834d5f Add missing assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113365 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 17:05:45 +00:00
Roman Divacky
563b38a89a Unresolved weak symbols have value equal zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 14:29:45 +00:00
Kalle Raiskila
0b4ab0cfe0 Fix CellSPU vector shuffles, again.
Some cases of lowering to rotate were miscompiled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 11:53:38 +00:00
Chris Lattner
c8ae35a8e8 add support for the commuted form of the test instruction, rdar://8018260.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113352 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 05:51:12 +00:00
Chris Lattner
ba8e81cca2 implement proper support for sysret{,l,q}, rdar://8403907
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 05:45:34 +00:00
Chris Lattner
ba8cea450f implement the iret suite of instructions properly,
fixing rdar://8403974



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 05:38:31 +00:00
Chris Lattner
2544f42692 add support for instruction prefixes on the same line as the instruction,
implementing rdar://8033482 and PR7254.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 05:17:37 +00:00
Chris Lattner
34e53140c2 change the MC "ParseInstruction" interface to make it the
implementation's job to check for and lex the EndOfStatement
marker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 05:10:46 +00:00
Chris Lattner
9607c40601 gas accepts xchg <mem>, <reg> as a synonym for xchg <reg>, <mem>.
Add this to the mc assembler, fixing PR8061


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 04:53:27 +00:00
NAKAMURA Takumi
186acea746 ARM/Disassembler: Fix definitions incompatible(unsigned and uint32_t) to Cygwin-1.5, following up to r113255.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 04:48:17 +00:00
Chris Lattner
a247685b30 fix the encoding of the "jump on *cx" family of instructions,
rdar://8061602


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113343 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 04:30:51 +00:00
Jim Grosbach
4725ca746a remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 03:54:02 +00:00
Jim Grosbach
707fb648d2 remove obsolete comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 03:51:44 +00:00
Jim Grosbach
e1e6d18786 disable for the moment while tracking down a few Thumb2-O0 failure that look
related. (attempt deux, complete w/ test update this time)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113333 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 02:00:34 +00:00
Jim Grosbach
8b95dfe2b6 woops. need to update a test along with this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 01:49:09 +00:00
Jim Grosbach
8a076eb79d disable temporarily while sorting out a few test failures in Thumb2-O0 tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 01:47:49 +00:00
Dan Gohman
65924111bf 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 01:32:20 +00:00
Jim Grosbach
0cfcf93c95 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 00:26:59 +00:00
Jim Grosbach
72db182438 VFP/NEON load/store multiple instructions are addrmode4, not 5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113322 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 00:25:50 +00:00
Owen Anderson
e9f1882406 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 23:15:30 +00:00
Jakob Stoklund Olesen
6b964cd211 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 22:38:45 +00:00
Jim Grosbach
447e7ac913 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 22:30:53 +00:00
Jim Grosbach
e2f70d1724 grammar tweak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 21:30:25 +00:00
Bruno Cardoso Lopes
90462b4ae1 Factor out some x86 vector shuffle rewriting and add comments about the direction the shuffle lowering is heading to
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113286 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 21:03:14 +00:00
Owen Anderson
381f17ee7c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113283 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 20:48:10 +00:00
Bruno Cardoso Lopes
0d1340b181 Move code around to prepare for moving some of the logic together to another function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 20:20:27 +00:00
Bill Wendling
d8dd5757e0 Add an MVT::x86mmx type. It will take the place of all current MMX vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 20:03:56 +00:00
Chris Lattner
979ed44feb 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).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113260 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 20:01:38 +00:00
Evan Cheng
dc0b06c815 Remove a dead comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 20:01:10 +00:00
Chris Lattner
6cd5db41f7 hopefully fix a problem building on cygwin-1.5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 19:50:53 +00:00
Owen Anderson
6bcd3a0265 Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 19:16:25 +00:00
Bruno Cardoso Lopes
58277b17c3 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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113247 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 18:41:45 +00:00
Bruno Cardoso Lopes
673bf78bb5 Remove now useless check, because the code can be matched below, no need to leave it for isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 18:29:03 +00:00
Dan Gohman
b52d44a0e6 Issue a #error if the host doesn't have an implementation for
GetMainExecutable yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 18:26:49 +00:00
Bruno Cardoso Lopes
67fc1e76d4 Minor change. Since the checks are equivalent, use isMMX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113239 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 18:24:00 +00:00
Nick Lewycky
f7a3c50183 Create PTX backend. Patch by Che-Liang Chiou!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 18:14:24 +00:00
Dale Johannesen
86097c384f Add patterns for MMX that use the new intrinsics.
Enable palignr intrinsic.
These may need adjustment for a new VT in due course.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 18:10:56 +00:00
Bruno Cardoso Lopes
70e81f1517 Remove unused target specific node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 17:38:55 +00:00
Benjamin Kramer
aceeb3a4e2 Don't leak the old operand when transforming "sldt" into "sldtw".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 14:40:58 +00:00
Nick Lewycky
198381e542 Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 05:39:02 +00:00
Nick Lewycky
2b6c01b40b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 01:42:10 +00:00
Chris Lattner
e9e0fc5eed add missing cmov aliases, this resolves rdar://8208499
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 00:05:45 +00:00
Chris Lattner
7d284de955 remove duplicated entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113188 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 23:57:24 +00:00
Nick Lewycky
32cda119ef 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 23:52:49 +00:00
Chris Lattner
c5cebeb3cb "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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 23:51:44 +00:00
Chris Lattner
d68c474ec5 fix rdar://8017621 - llvm-mc can't guess encoding for "push $(1000)"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113184 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 23:40:56 +00:00
Chris Lattner
9389b60a03 fix the operand constraints of the immediate form of in/out,
allowing unsigned 8-bit operands.  This fixes rdar://8208481



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 23:29:05 +00:00
Chris Lattner
ce4a3355d9 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113178 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 22:11:18 +00:00
Chris Lattner
a008e8ac73 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"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 21:54:15 +00:00
Chris Lattner
69c7249a6f simplify the hacks around jrcxz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 20:10:12 +00:00
Chris Lattner
ec6789f4f9 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 20:08:02 +00:00
Chris Lattner
79ed3f77e8 change MatchInstructionImpl to return an enum instead of bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 19:22:17 +00:00
Chris Lattner
0692ee676f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 19:11:01 +00:00
Roman Divacky
436c54a186 Redefine LOOP* instructions from I to Ii8PCRel as they take an i8 argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 18:43:14 +00:00
Chris Lattner
47ab90bfa8 random cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 18:32:06 +00:00
Benjamin Kramer
a9eadca2fd MCELF: Align symtab, relocation sections and section headers properly. Patch by Krister Wombell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 16:11:52 +00:00
Chris Lattner
9c7f075270 compute the HasSSE3 bit correctly, patch by Nikolai Saoukh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 05:19:44 +00:00
Chris Lattner
0cccd7633e fix PR8067, an over-aggressive assertion in LICM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 05:11:24 +00:00
Chris Lattner
09981982f1 cleanup some of the lifetime/invariant marker stuff, add a big fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 03:58:04 +00:00
Chris Lattner
c5a5cf26fd speed up -gvn 3.4% on the testcase in PR7023
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:26:29 +00:00
Chris Lattner
50fb46983c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:10:22 +00:00
Chris Lattner
adc799112d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:05:37 +00:00
Chris Lattner
979b061819 remove some dead code. t2addrmode_imm8s4 is never used in a
pattern, so there is no need to define a matching function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 22:51:11 +00:00
Chris Lattner
252b491875 cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 21:18:45 +00:00
Chris Lattner
dfe254b86e add a comment about where this should eventually move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:33:40 +00:00
Chris Lattner
f0f5780b39 update this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:22:09 +00:00
Chris Lattner
3ae0924d6b more cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:13:07 +00:00
Chris Lattner
bdabacdcca Change lower atomic pass to use IntrinsicInst to simplify it a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:10:47 +00:00
Chris Lattner
906a675db8 eliminate some non-obvious casts. UndefValue isa Constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:03:09 +00:00
Chris Lattner
e971131695 fix PR8063, a crash in globalopt in the malloc analysis code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 17:20:46 +00:00
Lang Hames
b76d20969f Added initialisers for reduction rule counters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 13:42:32 +00:00
Nick Lewycky
e110abb313 Fix warning reported by MSVC++ builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 09:11:38 +00:00
Nick Lewycky
b0e17779ba Switch FnSet to containing the ComparableFunction instead of a pointer to one.
This reduces malloc traffic (yay!) and removes MergeFunctionsEqualityInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 09:00:32 +00:00
Nick Lewycky
b0104e1bb5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 08:22:49 +00:00
Chris Lattner
beac75da37 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 02:18:34 +00:00
Jakob Stoklund Olesen
07c2b7ff68 Remove dead code.
Clobber ranges are no longer used when joining physical registers.
Instead, all aliases are checked for interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 21:09:33 +00:00
Chris Lattner
ab2cee6d51 dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:19:16 +00:00
Chris Lattner
17aa68055b zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:12:00 +00:00
Chris Lattner
89f87e8f5a remove dead code, mblaze uses SelectAddrRegImm/SelectAddrRegReg,
not SelectAddr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:02:47 +00:00
Bruno Cardoso Lopes
2eb63dfa0a Remove the last bit of isShuffleMaskLegal checks and improve the comment regarding mmx shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:58:56 +00:00
Bruno Cardoso Lopes
828f6ae03c make explicit that we not handle several mmx shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:50:13 +00:00
Dan Gohman
ffa75cdcf8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:42:48 +00:00
Bruno Cardoso Lopes
aace0f295b Emit target specific nodes to handle palignr. Do not touch it for MMX versions yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:36:07 +00:00
Bruno Cardoso Lopes
c800c0d25f Emit target specific nodes to handle splats starting at zero indicies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113055 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:02:14 +00:00
Bruno Cardoso Lopes
bbfc31012b Emit target specific nodes for isPSHUFHWMask and isPSHUFLWMask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 01:36:45 +00:00
Bruno Cardoso Lopes
4c827f5ae1 Emit target specific nodes for isSHUFPMask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 01:22:57 +00:00
Bruno Cardoso Lopes
d344f28b9d Previous isMOVLMask matching already emits targets nodes, remove check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:50:08 +00:00
Bruno Cardoso Lopes
e09abcd3c4 One more check from the original isShuffleMaskLegal goes away
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:46:16 +00:00
Bruno Cardoso Lopes
b733996110 Remove a duplicated but useless check that i've inserted in the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:43:12 +00:00
Bruno Cardoso Lopes
a22c84571a Refactor some code and remove the extra checks for unpckl_undef and unpckh_undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:39:43 +00:00
Chris Lattner
469996400c 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:12:30 +00:00
Bruno Cardoso Lopes
43c05744b5 Remove check for unpckh mask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 23:32:47 +00:00
Bruno Cardoso Lopes
ef3adb3243 Remove check for unpckl mask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 23:31:50 +00:00
Bruno Cardoso Lopes
7256e22f77 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 23:24:06 +00:00
Owen Anderson
597dad35b8 Propagate non-local comparisons. Fixes PR1757.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 22:47:08 +00:00
Dan Gohman
46ffb231c6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 22:12:56 +00:00
Bruno Cardoso Lopes
e8f279cbd4 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 22:09:41 +00:00
Jim Grosbach
ee72651df4 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 21:45:15 +00:00
Dale Johannesen
caa9ba228d Remove the rest of the nonexistent 64-bit AVX instructions.
Bruno, please review.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 21:23:00 +00:00
Bruno Cardoso Lopes
190d0a54c1 Reapply last harmless part of r112934, the pattern fragment to match X86Unpcklpd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 20:44:26 +00:00
Bruno Cardoso Lopes
2a4460606e Reintroduce a simple function refactoring done in r112934, also without any functionality changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 20:20:02 +00:00
Bruno Cardoso Lopes
be8b084d8a Reapply piecies of r112942 and r112934 which don't do
functional changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 20:10:35 +00:00
Bruno Cardoso Lopes
b3e0669b8e Reapply Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:55:05 +00:00
Daniel Dunbar
3139422058 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:38:11 +00:00
Daniel Dunbar
78541f258c Revert r112938 "Fix comment", which depends on r112934, which introduced some
infinite loop and select failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:38:08 +00:00
Daniel Dunbar
a87ccce95b 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:38:05 +00:00
Bob Wilson
ef134d02e0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:20:37 +00:00
Bill Wendling
7d49f2b1bf Get rid of "passing signed into unsigned parameter" warning on PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:09:46 +00:00
Owen Anderson
1593dd6779 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:08:37 +00:00
Jim Grosbach
65482b1bb8 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 18:37:12 +00:00
Jakob Stoklund Olesen
1e3aeefc08 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 18:36:56 +00:00
Jim Grosbach
fc63300233 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 18:28:19 +00:00
Bob Wilson
f572191fe4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112983 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 18:16:02 +00:00
Daniel Dunbar
6a8700301c 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 15:26:42 +00:00
Benjamin Kramer
df3f25656d Zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 12:13:18 +00:00
Duncan Sands
850fcd4705 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 :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 08:31:48 +00:00
Bruno Cardoso Lopes
95f1e2d6b5 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112944 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 02:08:45 +00:00
Bruno Cardoso Lopes
4b0c9f3e73 Use punpckh and unpckh family of nodes instead of using unpckh mask pattern fragment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 01:39:08 +00:00
Bob Wilson
eb0c3d3729 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 01:35:08 +00:00
Bruno Cardoso Lopes
01f0847ce8 Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 01:28:51 +00:00
Bruno Cardoso Lopes
5e5342b0a8 - 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 01:24:00 +00:00
Eric Christopher
e5734105da Simple branch instruction support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 00:35:47 +00:00
Jakob Stoklund Olesen
3061c4442e Don't call Predicate_* from X86 target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 00:35:18 +00:00
Jakob Stoklund Olesen
7853cd0bea Remove Predicate_* calls from MBlaze and XCore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 00:35:16 +00:00
Jakob Stoklund Olesen
7fa846f7d9 Remove Predicate_* calls from Mips
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 00:35:13 +00:00
Eric Christopher
56d2b72884 Add basic support for materializing constants (including fp) and
stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:43:26 +00:00
Chris Lattner
1dbb3879e8 lets get crazy and name the header file the exact class name,
not a scrunched version of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:09:42 +00:00
Anton Korobeynikov
ace53f2fbc Properly emit __chkstk call instead of __alloca on non-mingw windows targets.
Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:03:46 +00:00
Chris Lattner
831c8ec016 stop forcing a noop AssemblyAnnotationWriter to silence #uses
comments, these don't happen anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:03:10 +00:00
Devang Patel
a660be7587 There is no need to use .set here.
Thanks Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:01:10 +00:00
Chris Lattner
91fb4070e5 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:52:10 +00:00
Bruno Cardoso Lopes
ed5c711a6e Move insertps mask decoding to header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:43:39 +00:00
Chris Lattner
7e5c1a9790 revert patch, need to update clang tests too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:42:07 +00:00
Chris Lattner
39653a4e6c 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:41:24 +00:00
Dan Gohman
776339ee27 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:32:38 +00:00
Anton Korobeynikov
c7c62bb3ca Revert win64 changes. They seem to be incomplete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:31:32 +00:00
Jim Grosbach
1755b3964f 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:29:01 +00:00
Chris Lattner
9c282011e6 fix more AST updating bugs, correcting miscompilation in PR8041
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:19:10 +00:00
Owen Anderson
4caef6001d Remove incorrect and poorly tested code for trying to reason about values on default edges of
switches.  Just return the conservatively correct answer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:16:52 +00:00
Anton Korobeynikov
2f4fad99ea Properly allocate win64 shadow reg area.
Patch by Jan Sjodin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:16:28 +00:00
John McCall
2a9a2dba4c 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:55:03 +00:00
Bruno Cardoso Lopes
5594560766 Move decoding of insertps back to avoid unused warnings in x86 isel lowering, and fix movlhps/movhlps to decode 4 elements shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:51:11 +00:00
Devang Patel
3f74a116c8 Detect undef value early and save unnecessary NodeMap query.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:29:42 +00:00
Dan Gohman
24bde5bce1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:18:42 +00:00
Devang Patel
8e741ed2fa Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:02:27 +00:00
Jim Grosbach
5c33f5bf67 trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 19:52:39 +00:00
Benjamin Kramer
1674b0b0e4 Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:53:37 +00:00
Jim Grosbach
3e234e7579 remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:44:51 +00:00
Bruno Cardoso Lopes
6b1d0a3b36 Move x86 specific shuffle mask decoding to its own header, it's also going to be used elsewhere. Also trim trailing whitespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:40:13 +00:00
Jim Grosbach
9204ddad5c The scavenger should just use getAllocatableSet() rather than reinventing it
locally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:29:04 +00:00
Dan Gohman
86759acf01 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112844 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:24:46 +00:00
Owen Anderson
66048c2169 Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not
be treated as equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:23:58 +00:00
Jim Grosbach
bb5a039b76 handle case where a register class is specified
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:18:52 +00:00
Jim Grosbach
e7c1416263 Now that register allocation properly considers reserved regs, simplify the
ARM register class allocation order functions to take advantage of that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:14:29 +00:00
Benjamin Kramer
230c274724 Allow MCSA_WeakRef in ELF. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 17:18:32 +00:00
Jim Grosbach
9b041c92ef Anti-dependency breaking needs to be careful not to use reserved regs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 17:12:55 +00:00
Devang Patel
b1fcfbe89b Fix .debug_range for linux. Patch by Krister Wombell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 16:43:44 +00:00
Jim Grosbach
5a0fabae5a Mask out reserved registers when constructing the set of allocatable regs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112828 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 16:31:21 +00:00
Bob Wilson
82a9c8480e Fill in a missing comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 16:17:29 +00:00
Bob Wilson
ffde080ae6 Convert VLD1 and VLD2 instructions to use pseudo-instructions until
after regalloc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112825 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 16:00:54 +00:00
Duncan Sands
8cf2663227 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 08:52:23 +00:00
Lang Hames
33198391d6 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 08:27:00 +00:00
Duncan Sands
fc6e29d4ab 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112810 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 08:14:03 +00:00
Chandler Carruth
4315093eb7 Silence an ambiguous else warning from GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 07:08:05 +00:00
Lang Hames
7642572e6d Added counters for PBQP reduction rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 05:37:52 +00:00
Bruno Cardoso Lopes
3722f007b6 Replace unpckl_undef and unpckh_undef matching with target specific opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112806 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 05:23:12 +00:00
Bruno Cardoso Lopes
dd69db858c Move condition out to prepare for more matching
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 04:20:26 +00:00
Bruno Cardoso Lopes
ad10fb2b56 Remove checking for isUNPCKL_v_undef_Mask, the specific node is already emitted for it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 03:57:58 +00:00
NAKAMURA Takumi
1b68af4183 llvm::FindExecutable(): Retrieve the name with suffix.exe, if available.
bugpoint uses it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 03:46:04 +00:00
Bruno Cardoso Lopes
d00bfe1f8d become more strict about when it's safe to use X86ISD::MOVLPS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 02:35:51 +00:00
Eric Christopher
1f58741aab 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 02:30:46 +00:00
Eric Christopher
1b61ef4b22 This should be TargetMaterializeConstant instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 01:48:11 +00:00
Eric Christopher
eaa204b2f8 One definition of isThumb is plenty, thanks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 01:39:14 +00:00
Jim Grosbach
b0739b7833 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 01:02:06 +00:00
Eric Christopher
318b6eec8d Rework arm fast-isel load and store handling. Move offset computation
into the "address selection" routine and handle constant materialization
for stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 00:53:56 +00:00
Jim Grosbach
d273a003b6 Add a bit of debug output for register scavenging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 00:51:37 +00:00
Jim Grosbach
7af3a345a9 trivial cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 00:02:26 +00:00
Jim Grosbach
352f23529c Simplify the tGPR register class now that the register allocators know not
to try to allocate reserved registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 23:50:23 +00:00
Bob Wilson
d0b69cf119 Remove NEON vmull, vmlal, and vmlsl intrinsics, replacing them with multiply,
add, and subtract operations with zero-extended or sign-extended vectors.
Update tests.  Add auto-upgrade support for the old intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 23:50:19 +00:00
Chris Lattner
72eaa0e5eb deepen my MMX/SRoA hack to avoid hurting non-x86 codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 23:09:27 +00:00
Bruno Cardoso Lopes
4783a3ee13 Revert r112689, avoid those kind of checks cause they mess up with mmx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:59:03 +00:00
Jim Grosbach
188da252ab Tweak to ignoring reserved regs. The allocator was occasionally still looking
at them since they'd end up in the register weights list. Tell it to stop
doing that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:48:34 +00:00
Bruno Cardoso Lopes
29c353b9c3 Using target specific nodes for shuffle nodes makes the mask
check more strict, breaking some cases not checked in the
testsuite, but also exposes some foldings not done before,
as this example:

  movaps  (%rdi), %xmm0
  movaps  (%rax), %xmm1
  movaps  %xmm0, %xmm2
  movss %xmm1, %xmm2
  shufps  $36, %xmm2, %xmm0

now is generated as:

  movaps  (%rdi), %xmm0
  movaps  %xmm0, %xmm1
  movlps  (%rax), %xmm1
  shufps  $36, %xmm1, %xmm0



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:33:20 +00:00
Eric Christopher
543cf05b9c Some basic store support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:16:27 +00:00
Jakob Stoklund Olesen
0077114efc Teach RemoveCopyByCommutingDef to check all aliases, not just subregisters.
This caused a miscompilation in WebKit where %RAX had conflicting defs when
RemoveCopyByCommutingDef was commuting a %EAX use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:15:35 +00:00
Jim Grosbach
662fb77687 tidy up trailing whitespace and an 80 column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:48:06 +00:00
Dan Gohman
b0a57210a4 Fix loop unswitching's assumption that a code path which either
infinite loops or exits will eventually exit. This fixes PR5373.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:46:45 +00:00
Jim Grosbach
5a4cbea312 cleanup per feedback. use a helper function for getting the first non-reserved
physical register in a register class. Make sure to assert if the register
class is empty.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:34:41 +00:00
Jim Grosbach
269354e570 The register allocator shouldn't consider allocating reserved registers. PBQP version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:23:03 +00:00
Jim Grosbach
067a648599 The register allocator shouldn't consider allocating reserved registers.
r112728 did this for fast regalloc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:04:27 +00:00
Jim Grosbach
1f758831cb The register allocator shouldn't consider allocating reserved registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 19:28:41 +00:00
Jim Grosbach
07cb689d62 tidy up a few 80-column and trailing whitespace bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 19:16:29 +00:00
Owen Anderson
9bfa6fec06 JumpThreading keeps LazyValueInfo up to date, so we don't need to rerun it
if we schedule another LVI-using pass afterwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 18:27:22 +00:00
Eric Christopher
4e68c7cca4 Add some more load types in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112721 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 18:01:32 +00:00
Eric Christopher
adc581f5cb Speculatively revert 112699 and 112702, they seem to be causing
self host errors on clang-x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 17:29:10 +00:00
Chris Lattner
f636aa9c7e have the makefiles check the llvm-config error code instead of charging
on an producing weird link errors.  Patch by Yuri Gribov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112714 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 16:11:17 +00:00
Chris Lattner
0b5b18340b dead code patrol
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 16:06:39 +00:00
Chris Lattner
14ab39e43f zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 16:04:34 +00:00
Chris Lattner
5bcb8a6112 temporarily revert r112664, it is causing a decoding conflict, and
the testcases should be merged.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 16:00:50 +00:00
Dan Gohman
d4c454317a Make tool_output_file's raw_ostream instance a member variable instead
of a base class.

This makes it possible to unregister the file from FilesToRemove when
the file is done. Also, this eliminates the need for
formatted_tool_output_file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 14:20:41 +00:00
Dan Gohman
41154114f6 Add an interface for unregistering a file from the FilesToRemove list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 14:17:34 +00:00
Duncan Sands
fb4e8ab200 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 :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 14:07:47 +00:00
Duncan Sands
4d588bceb0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 10:29:33 +00:00
Chris Lattner
91abace4ef add a gross hack to work around a problem that Argiris reported
on llvmdev: SRoA is introducing MMX datatypes like <1 x i64>,
which then cause random problems because the X86 backend is
producing mmx stuff without inserting proper emms calls.

In the short term, force off MMX datatypes.  In the long term,
the X86 backend should not select generic vector types to MMX
registers.  This is being worked on, but won't be done in time
for 2.8.  rdar://8380055


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 05:14:33 +00:00
Bruno Cardoso Lopes
56098f5d26 Use movlps, movlpd, movss and movsd specific nodes instead of pattern matching with movlp pattern fragment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112694 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 05:08:25 +00:00
Dan Gohman
191bd64a39 Revert 112442 and 112440 until the compile time problems introduced
by 112440 are resolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 01:45:53 +00:00
Bruno Cardoso Lopes
9cfad89a68 minor change, simplify some logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112689 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 00:57:08 +00:00
Bruno Cardoso Lopes
e654b56eb1 Move some functions around so they can be used for some other to come function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 00:51:36 +00:00
Devang Patel
ae84d5b9ba Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
This patch was developed on top of original patch by Artur Pietrek.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112678 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 23:50:19 +00:00
Chris Lattner
2ac6e2354a licm is wasting time hoisting constant foldable operations,
instead of hoisting them, just fold them away.  This occurs in the
testcase for PR8041, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112669 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 23:00:16 +00:00
Kevin Enderby
232ab949d5 This is the second of three patches to implement support for the .loc directive
and output the dwarf line number tables.  This takes the current loc info after
an instruction is assembled and saves the needed info into an object that has
vector and for each section.  These objects will be used for the final patch to 
build and emit the encoded dwarf line number tables.  Again for now this is only
in the Mach-O streamer but at some point will move to a more generic place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:55:11 +00:00
Dan Gohman
3f19c091bf Reapply r112432, now that the real problem is addressed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:53:17 +00:00
Dan Gohman
6a0c125ed5 Reapply r112433, now that the real problem is addressed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:52:12 +00:00
Dan Gohman
90b5f25e8d Revert r110916. This patch is buggy because the code inside the
inner loop doesn't update all the variables in the outer loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:50:31 +00:00
Bill Wendling
43a6c5e2fc We have a chance for an optimization. Consider this code:
int x(int t) {
  if (t & 256)
    return -26;
  return 0;
}

We generate this:

     tst.w   r0, #256
     mvn     r0, #25
     it      eq
     moveq   r0, #0

while gcc generates this:

     ands    r0, r0, #256
     it      ne
     mvnne   r0, #25
     bx      lr

Scandalous really!

During ISel time, we can look for this particular pattern. One where we have a
"MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND
instruction to 0. Something like this (greatly simplified):

  %r0 = ISD::AND ...
  ARMISD::CMPZ %r0, 0         @ sets [CPSR]
  %r0 = ARMISD::MOVCC 0, -26  @ reads [CPSR]

All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR]
when it's zero. The zero value will all ready be in the %r0 register and we only
need to change it if the AND wasn't zero. Easy!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:41:22 +00:00
Anton Korobeynikov
1d76ab7f56 Some fixes for NetBSD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:38:00 +00:00
Bruno Cardoso Lopes
013bb3dee9 Use x86 specific MOVSLDUP node, add more patterns to match it and remove useless load nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:35:05 +00:00
Devang Patel
0b48eade42 Reapply r112623. Included additional check for unused byval argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112659 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:22:42 +00:00
Bruno Cardoso Lopes
5023ef281c Use x86 specific MOVSHDUP node and add more patterns to match it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112657 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:22:11 +00:00
Bill Wendling
2d811d38d4 And ANDS pattern to match the t2ANDS pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112654 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:05:37 +00:00
Jakob Stoklund Olesen
63b1dbaadd Make %EFLAGS unallocatable.
No CCR virtual registers should exist, and %EFLAGS is used in ways that can
surprise RegAllocFast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 21:51:07 +00:00
Jakob Stoklund Olesen
f14a648d80 Track liveness of unallocatable, unreserved registers in machine DCE.
Reserved registers are unpredictable, and are treated as always live by machine
DCE.

Allocatable registers are never reserved, and can be used for virtual registers.

Unreserved, unallocatable registers can not be used for virtual registers, but
otherwise behave like a normal allocatable register. Most targets only have
the flag register in this set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 21:51:05 +00:00
Bruno Cardoso Lopes
7ff30bb1a5 Use MOVHLPS node instead of matching using movhlps and movhlps_undef pattern fragments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112644 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 21:38:49 +00:00
Chris Lattner
b5d84d13bc tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 21:21:25 +00:00
Bruno Cardoso Lopes
f2db5b48d0 Use MOVLHPS and MOVHLPS x86 nodes whenever possible. Also remove some useless nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 21:15:21 +00:00
Dan Gohman
26125c65b9 Revert r112432. It appears to be exposing a problem in the emacs build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 20:58:44 +00:00
Owen Anderson
0eb355ab6b More cleanups of my JumpThreading transforms, including extracting some duplicated code into a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 20:26:04 +00:00
Jakob Stoklund Olesen
9d4b51b696 Ignore unallocatable registers in RegAllocFast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:54:25 +00:00
Devang Patel
81b79b5fa8 Revert r112623. It is causing self host build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:41:03 +00:00
Owen Anderson
9ba353627a Add an RAII helper to make cleanup of the RecursionSet more fool-proof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:24:27 +00:00
Owen Anderson
869a144f4e Only try to clean up the current block if we changed that block already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112625 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:55:52 +00:00
Jim Grosbach
c1dc78de76 SP relative offsets need to be adjusted by the local allocation size when
determining if they're likely to be in range of the SP when resolving
frame references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:52:31 +00:00
Devang Patel
8480c2e314 Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:50:09 +00:00
Jim Grosbach
d4511e947e this assert should just be a condition, since this function is just asking if
the offset is legally encodable, not actually trying to do the encoding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:49:31 +00:00
Owen Anderson
c1bdac66ff Refactor my fix for PR5652 to terminate the predecessor lookups after the first failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:48:48 +00:00
Jim Grosbach
864d22ea72 Improve virtual frame base register allocation heuristics.
1. Allocate them in the entry block of the function to enable function-wide
     re-use. The instructions to create them should be re-materializable, so
     there shouldn't be additional cost compared to creating them local
     to the basic blocks where they are used.
  2. Collect all of the frame index references for the function and sort them
     by the local offset referenced. Iterate over the sorted list to
     allocate the virtual base registers. This enables creation of base
     registers optimized for positive-offset access of frame references.
     (Note: This may be appropriate to later be a target hook to do the
     sorting in a target appropriate manner. For now it's done here for
     simplicity.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 17:58:19 +00:00