oota-llvm.git
14 years agoTeach liveintervalanalysis about virtual registers which are defined by reg_sequence...
Evan Cheng [Wed, 5 May 2010 18:27:40 +0000 (18:27 +0000)]
Teach liveintervalanalysis about virtual registers which are defined by reg_sequence instructions that are formed by registers defined by distinct instructions. e.g.
80      %reg1041:6<def> = VSHRNv4i16 %reg1034<kill>, 12, pred:14, pred:%reg0
. . .
120     %reg1041:5<def> = VSHRNv4i16 %reg1039<kill>, 12, pred:14, pred:%reg0

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

14 years agoAdd a suppressions file for an intermittent "leak" under RegisterPass.
Jeffrey Yasskin [Wed, 5 May 2010 18:15:26 +0000 (18:15 +0000)]
Add a suppressions file for an intermittent "leak" under RegisterPass.

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

14 years agoMC: Rename MCSymbol::{g,s}etValue -> MCSymbol::{g,s}etVariableValue.
Daniel Dunbar [Wed, 5 May 2010 17:41:00 +0000 (17:41 +0000)]
MC: Rename MCSymbol::{g,s}etValue -> MCSymbol::{g,s}etVariableValue.

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

14 years agoMC/Mach-O/x86_64: Relocations in debug sections should use local relocations
Daniel Dunbar [Wed, 5 May 2010 17:22:39 +0000 (17:22 +0000)]
MC/Mach-O/x86_64: Relocations in debug sections should use local relocations
when possible.
 - <rdar://problem/7934873>

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

14 years agolit: Allow test_format to be None.
Daniel Dunbar [Wed, 5 May 2010 17:22:35 +0000 (17:22 +0000)]
lit: Allow test_format to be None.

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

14 years agoTry again if write(2) reports an recoverable error.
Benjamin Kramer [Wed, 5 May 2010 15:17:47 +0000 (15:17 +0000)]
Try again if write(2) reports an recoverable error.

This should fix mysteriously crashing boost regression tests when stderr is
managed by bjam (PR7043).

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

14 years agoAdd newline to end of file to avoid warning
Shantonu Sen [Wed, 5 May 2010 13:56:46 +0000 (13:56 +0000)]
Add newline to end of file to avoid warning
when building llvm with clang

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

14 years agoRevert 102941, we're going to do this via attr and can just
Eric Christopher [Wed, 5 May 2010 07:35:59 +0000 (07:35 +0000)]
Revert 102941, we're going to do this via attr and can just
hack the code to turn it off when debugging.

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

14 years agoInclude the right header for toupper
Sean Hunt [Wed, 5 May 2010 04:31:44 +0000 (04:31 +0000)]
Include the right header for toupper

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

14 years agoAdd an emitter to handle the list of clang statement nodes.
Sean Hunt [Wed, 5 May 2010 04:13:08 +0000 (04:13 +0000)]
Add an emitter to handle the list of clang statement nodes.

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

14 years agoCombine the implementations of the core part of the SSAUpdater and
Bob Wilson [Tue, 4 May 2010 23:18:19 +0000 (23:18 +0000)]
Combine the implementations of the core part of the SSAUpdater and
MachineSSAUpdater to avoid duplicating all the code.

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

14 years agoUpdate comment.
Eric Christopher [Tue, 4 May 2010 22:13:03 +0000 (22:13 +0000)]
Update comment.

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

14 years agoadd the ability to associate 'category' names with clang diagnostics
Chris Lattner [Tue, 4 May 2010 20:44:23 +0000 (20:44 +0000)]
add the ability to associate 'category' names with clang diagnostics
and diagnostic groups.  This allows the compiler to group
diagnostics together (e.g. "Logic Warning",
"Format String Warning", etc) like the static analyzer does.
This is not exposed through anything in the compiler yet.

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

14 years agoWith -neon-reg-sequence, models forming a Q register from a pair of consecutive D...
Evan Cheng [Tue, 4 May 2010 20:39:49 +0000 (20:39 +0000)]
With -neon-reg-sequence, models forming a Q register from a pair of consecutive D registers as a REG_SEQUENCE.

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

14 years agoDo not pre-allocate for registers which form a REG_SEQUENCE.
Evan Cheng [Tue, 4 May 2010 20:38:12 +0000 (20:38 +0000)]
Do not pre-allocate for registers which form a REG_SEQUENCE.

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

14 years agoTeach PHI elimination to remove REG_SEQUENCE instructions and update references of...
Evan Cheng [Tue, 4 May 2010 20:26:52 +0000 (20:26 +0000)]
Teach PHI elimination to remove REG_SEQUENCE instructions and update references of the source operands with references of the destination with subreg indices. e.g.
%reg1029<def>, %reg1030<def> = VLD1q16 %reg1024<kill>, ...
%reg1031<def> = REG_SEQUENCE %reg1029<kill>, 5, %reg1030<kill>, 6
=>
%reg1031:5<def>, %reg1031:6<def> = VLD1q16 %reg1024<kill>, ...

PHI elimination now does more than phi elimination. It is really a de-SSA pass.

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

14 years agoUse llvm.foo as the intrinsic, rather than llvm.dbg.value. Since the
Duncan Sands [Tue, 4 May 2010 20:09:25 +0000 (20:09 +0000)]
Use llvm.foo as the intrinsic, rather than llvm.dbg.value.  Since the
values passed to llvm.dbg.value were not valid for the intrinsic, it
might have caused trouble one day if the verifier ever started checking
for valid debug info.

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

14 years agoDefer adding critical edges to the "toSplit" list until after checking for
Bob Wilson [Tue, 4 May 2010 20:03:21 +0000 (20:03 +0000)]
Defer adding critical edges to the "toSplit" list until after checking for
indirect branches in all the predecessors.  This avoids unnecessarily
splitting edges in cases where load PRE is not possible anyway.
Thanks to Jakub Staszak for pointing this out.

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

14 years agoone more thing.
Chris Lattner [Tue, 4 May 2010 18:16:00 +0000 (18:16 +0000)]
one more thing.

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

14 years agoupdate instructions for llvm-gcc4, the brave new world! PR7037
Chris Lattner [Tue, 4 May 2010 18:15:33 +0000 (18:15 +0000)]
update instructions for llvm-gcc4, the brave new world!  PR7037

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

14 years ago"on the rare occasion the SPU BE produces illegal assembly - it tries to emit an...
Chris Lattner [Tue, 4 May 2010 17:58:46 +0000 (17:58 +0000)]
"on the rare occasion the SPU BE produces illegal assembly - it tries to emit an add instruction of the form 'a reg, reg, imm'."

Patch by Kalle Raiskila!

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

14 years agoMC/X86: Chris pointed that 'as' isn't consistent in accepting the long form of
Daniel Dunbar [Tue, 4 May 2010 17:31:02 +0000 (17:31 +0000)]
MC/X86: Chris pointed that 'as' isn't consistent in accepting the long form of
instructions which have no direct register usage.

Darwin 'as' accepts:
  add $0, (%rax)
but rejects
  mov $0, (%rax)
for example.

Given that, only accept suffix matches which match exactly one form. We still
need to emit nice diagnostics for failures...

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

14 years agoRename variables for consistency.
Evan Cheng [Tue, 4 May 2010 17:12:26 +0000 (17:12 +0000)]
Rename variables for consistency.

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

14 years agoMC/X86: Add "support" for matching ATT style mnemonic prefixes.
Daniel Dunbar [Tue, 4 May 2010 16:12:42 +0000 (16:12 +0000)]
MC/X86: Add "support" for matching ATT style mnemonic prefixes.
 - The idea is that when a match fails, we just try to match each of +'b', +'w',
   +'l'. If exactly one matches, we assume this is a mnemonic prefix and accept
   it. If all match, we assume it is width generic, and take the 'l' form.

 - This would be a horrible hack, if it weren't so simple. Therefore it is an
   elegant solution! Chris gets the credit for this particular elegant
   solution. :)

 - Next step to making this more robust is to have the X86 matcher generate the
   mnemonic prefix information. Ideally we would also compute up-front exactly
   which mnemonic to attempt to match, but this may require more custom code in
   the matcher than is really worth it.

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

14 years agoFix a problem exposed by my previous commit and noticed by a release-asserts
Duncan Sands [Tue, 4 May 2010 14:25:42 +0000 (14:25 +0000)]
Fix a problem exposed by my previous commit and noticed by a release-asserts
buildbot: the debugging and non-debugging versions of getFunction were not
functionally equivalent: the non-debugging version wrongly assumed that if a
metadata operand was not metadata, then it had a non-null containing function.
This is not true, since the operand might be a global value, constant etc.

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

14 years agoFix a variant of PR6112 found by thinking about it: when doing
Duncan Sands [Tue, 4 May 2010 12:43:36 +0000 (12:43 +0000)]
Fix a variant of PR6112 found by thinking about it: when doing
RAUW of a global variable with a local variable in function F,
if function local metadata M in function G was using the global
then M would become function-local to both F and G, which is not
allowed.  See the testcase for an example.  Fixed by detecting
this situation and zapping the metadata operand when it occurs.

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

14 years agofix operand indexes when outputting InvokeInsts
Gabor Greif [Tue, 4 May 2010 09:23:54 +0000 (09:23 +0000)]
fix operand indexes when outputting InvokeInsts

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

14 years agoSet DW_AT_APPLE_omit_frame_ptr in endFunction() where MachineFunction is available...
Devang Patel [Tue, 4 May 2010 06:15:30 +0000 (06:15 +0000)]
Set DW_AT_APPLE_omit_frame_ptr in endFunction() where MachineFunction is available all the time.

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

14 years agoUse the SCEVAddRecExpr::getPostIncExpr utility function instead
Dan Gohman [Tue, 4 May 2010 01:12:27 +0000 (01:12 +0000)]
Use the SCEVAddRecExpr::getPostIncExpr utility function instead
of doing the same thing manually.

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

14 years agoFix a copy+pasto.
Dan Gohman [Tue, 4 May 2010 01:11:15 +0000 (01:11 +0000)]
Fix a copy+pasto.

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

14 years agoDo not ignore debug loc attached with llvm.dbg.declare while collecting debug info...
Devang Patel [Tue, 4 May 2010 01:05:02 +0000 (01:05 +0000)]
Do not ignore debug loc attached with llvm.dbg.declare while collecting debug info used by a module.

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

14 years agoInstruction selection optimizations may have moved the def of a function argument...
Evan Cheng [Tue, 4 May 2010 00:58:39 +0000 (00:58 +0000)]
Instruction selection optimizations may have moved the def of a function argument out of the entry block. rdar://7937489

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

14 years agoFix to r102952. The MOV64toSDrm record in X86Instr64bit.td needed the opcode
Kevin Enderby [Tue, 4 May 2010 00:42:46 +0000 (00:42 +0000)]
Fix to r102952.  The MOV64toSDrm record in X86Instr64bit.td needed the opcode
changed to 0x7E from 0x6E as well as the previous change of RPDI to S3SI.

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

14 years agoMC/Matcher: Add support for over-riding the default MatchInstruction function
Daniel Dunbar [Tue, 4 May 2010 00:33:13 +0000 (00:33 +0000)]
MC/Matcher: Add support for over-riding the default MatchInstruction function
name (for example, to allow targets to interpose the actual MatchInstruction
function).

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

14 years agollvm-mc: Fix case were we would skip a line in the .s file after an instruction
Daniel Dunbar [Tue, 4 May 2010 00:33:07 +0000 (00:33 +0000)]
llvm-mc: Fix case were we would skip a line in the .s file after an instruction
match failure.

Also, fixes a few memory leak FIXMEs.

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

14 years agoTeach scheduler about REG_SEQUENCE.
Evan Cheng [Tue, 4 May 2010 00:22:40 +0000 (00:22 +0000)]
Teach scheduler about REG_SEQUENCE.

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

14 years agoAdd a polygen rule that reflects the fact that nsw and nuw can be
Dan Gohman [Tue, 4 May 2010 00:13:24 +0000 (00:13 +0000)]
Add a polygen rule that reflects the fact that nsw and nuw can be
used together in either order.

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

14 years agoRe-enable isel kill flags, now that the local allocator is ignoring them.
Dan Gohman [Tue, 4 May 2010 00:12:15 +0000 (00:12 +0000)]
Re-enable isel kill flags, now that the local allocator is ignoring them.

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

14 years agordar://7937137 - dbg values not being handled in thumb1 version of
Jim Grosbach [Tue, 4 May 2010 00:11:37 +0000 (00:11 +0000)]
rdar://7937137 - dbg values not being handled in thumb1 version of
eliminateFrameIndex(), leading to llvm_unreachable() assertion failure.

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

14 years agoUpdate one more 2.7 to 2.8.
Dan Gohman [Mon, 3 May 2010 23:52:21 +0000 (23:52 +0000)]
Update one more 2.7 to 2.8.

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

14 years agoMinimally update ReleaseNotes.html for 2.8 development; uncomment and
Dan Gohman [Mon, 3 May 2010 23:51:05 +0000 (23:51 +0000)]
Minimally update ReleaseNotes.html for 2.8 development; uncomment and
update the big red warning at the top. Most of the old content remains
and awaits revision.

Clear out the API changes section, and start it up again with a
mention of the add->fadd transition.

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

14 years agoRemove preexisting kill flags in RegAllocLocal, just like LiveVariables does.
Jakob Stoklund Olesen [Mon, 3 May 2010 23:49:20 +0000 (23:49 +0000)]
Remove preexisting kill flags in RegAllocLocal, just like LiveVariables does.

This should make it possible to start producing kill flags in isel without
breaking stuff.

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

14 years agoFactor out FastISel's code for materializing constants and other values
Dan Gohman [Mon, 3 May 2010 23:36:34 +0000 (23:36 +0000)]
Factor out FastISel's code for materializing constants and other values
in registers into a separate function to de-couple it from the
top-down-specific logic in getRegForValue.

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

14 years agoImplement builtin_return_address(x) and builtin_frame_address(x)
Dale Johannesen [Mon, 3 May 2010 22:59:34 +0000 (22:59 +0000)]
Implement builtin_return_address(x) and builtin_frame_address(x)
on PPC for x!=0.  7624113.

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

14 years agoRemove the API compatibility layer which converted add, sub, and mul
Dan Gohman [Mon, 3 May 2010 22:44:19 +0000 (22:44 +0000)]
Remove the API compatibility layer which converted add, sub, and mul
to fadd, fsub, and fmul, when used with a floating-point type. LLVM
has supported the new instructions since 2.6, so it's time to get
on board.

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

14 years agoCheck that subregisters don't have independent values in RemoveCopyByCommutingDef().
Jakob Stoklund Olesen [Mon, 3 May 2010 22:40:32 +0000 (22:40 +0000)]
Check that subregisters don't have independent values in RemoveCopyByCommutingDef().

This fixes PR6941.

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

14 years agoFix tests to use fadd, fsub, and fmul, instead of add, sub, and mul,
Dan Gohman [Mon, 3 May 2010 22:36:46 +0000 (22:36 +0000)]
Fix tests to use fadd, fsub, and fmul, instead of add, sub, and mul,
when the type is floating-point.

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

14 years agoReword a comment slightly.
Eric Christopher [Mon, 3 May 2010 22:18:49 +0000 (22:18 +0000)]
Reword a comment slightly.

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

14 years agoUse getConstant instead of getIntegerSCEV. The two are basically the
Dan Gohman [Mon, 3 May 2010 22:09:21 +0000 (22:09 +0000)]
Use getConstant instead of getIntegerSCEV. The two are basically the
same, now that getConstant has overloads consistent with ConstantInt::get.

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

14 years agoRevert r102948.
Bill Wendling [Mon, 3 May 2010 21:51:21 +0000 (21:51 +0000)]
Revert r102948.

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

14 years agoRemove special case for llvmCore_Embedded project. This is no longer needed
Bob Wilson [Mon, 3 May 2010 21:41:24 +0000 (21:41 +0000)]
Remove special case for llvmCore_Embedded project.  This is no longer needed
since llvmCore is built as part of llvmgcc42 now.

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

14 years agoPrint basic block numbers in live interval debug output. Since the rest of the
Bob Wilson [Mon, 3 May 2010 21:38:11 +0000 (21:38 +0000)]
Print basic block numbers in live interval debug output. Since the rest of the
debug output is showing machine instructions, the IR-level basic block names
aren't very meaningful, and because multiple machine basic blocks may be
derived from one IR-level BB, they're also not unique.

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

14 years agoFix function prototype mismatch in LLVMUnionType(). Fixes PR7019.
Nick Lewycky [Mon, 3 May 2010 21:36:51 +0000 (21:36 +0000)]
Fix function prototype mismatch in LLVMUnionType(). Fixes PR7019.

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

14 years agoChanged llvm-mc to use the same suffixes with floating point compare
Kevin Enderby [Mon, 3 May 2010 21:31:40 +0000 (21:31 +0000)]
Changed llvm-mc to use the same suffixes with floating point compare
instructions as the Mac OS X darwin assembler.  Some of which like 'fcoml'
assembled to different opcodes.  While some of the suffixes were just different.

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

14 years agoFixed the encoding of two of the X86 movq instuctions. The Move quadword from
Kevin Enderby [Mon, 3 May 2010 21:03:31 +0000 (21:03 +0000)]
Fixed the encoding of two of the X86 movq instuctions.  The Move quadword from
mm to mm/m64 and the Move quadword from xmm2/mem64 to xmm1 had the incorrect
encodings.

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

14 years agoFixed the encoding of the x86 push instructions. Using a 32-bit immediate value
Kevin Enderby [Mon, 3 May 2010 20:45:05 +0000 (20:45 +0000)]
Fixed the encoding of the x86 push instructions.  Using a 32-bit immediate value
caused the a pushl instruction to be incorrectly encoding using only two bytes
of immediate, causing the following 2 instruction bytes to be part of the 32-bit
immediate value.  Also fixed the one byte form of push to be used when the
immediate would fit in a signed extended byte.  Lastly changed the names to not
include the 32 of PUSH32 since they actually push the size of the stack pointer.

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

14 years agoTestcase for r102947.
Bill Wendling [Mon, 3 May 2010 20:39:35 +0000 (20:39 +0000)]
Testcase for r102947.

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

14 years agoSilence warnings about -1 being converted to an unsigned value.
Dan Gohman [Mon, 3 May 2010 20:23:47 +0000 (20:23 +0000)]
Silence warnings about -1 being converted to an unsigned value.

Also, pass true for isSigned even when creating constants for unsigned
comparisons, because the point is to create an all-ones constant,
rather than UINT64_MAX, even for integers wider than 64 bits.

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

14 years agoAdd an option, defaulting to off, to disable the sse domain crossing opts.
Eric Christopher [Mon, 3 May 2010 19:54:02 +0000 (19:54 +0000)]
Add an option, defaulting to off, to disable the sse domain crossing opts.

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

14 years agoCheck for side effects before splitting loop.
Devang Patel [Mon, 3 May 2010 18:06:58 +0000 (18:06 +0000)]
Check for side effects before splitting loop.
Patch by Jakub Staszak!

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

14 years agoUse isTrueWhenEqual and isFalseWhenEqual instead of assuming that
Dan Gohman [Mon, 3 May 2010 18:00:24 +0000 (18:00 +0000)]
Use isTrueWhenEqual and isFalseWhenEqual instead of assuming that
SimplifyICmpOperands will simplify such cases to EQ or NE. This makes
the correcntess of the code independent on SimplifyICmpOperands doing
certain simplifications.

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

14 years agoIn ScalarEvolution::print, don't bother printing out the SCEVs for
Dan Gohman [Mon, 3 May 2010 17:03:23 +0000 (17:03 +0000)]
In ScalarEvolution::print, don't bother printing out the SCEVs for
comparison instructions, since they aren't interesting, despite having
integer result types.

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

14 years agoIn SimplifyICmpOperands, avoid needlessly swapping the operands in the
Dan Gohman [Mon, 3 May 2010 17:00:11 +0000 (17:00 +0000)]
In SimplifyICmpOperands, avoid needlessly swapping the operands in the
case where both are addrecs in unrelated loops.

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

14 years agoFactor out the new <= and >= analysis code into SimplifyICmpOperands.
Dan Gohman [Mon, 3 May 2010 16:35:17 +0000 (16:35 +0000)]
Factor out the new <= and >= analysis code into SimplifyICmpOperands.

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

14 years agoUpdate this comment to note its relationship with the "happens-before"
Dan Gohman [Mon, 3 May 2010 14:59:34 +0000 (14:59 +0000)]
Update this comment to note its relationship with the "happens-before"
concept in the proposed memory model changes.

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

14 years agoDelete this comment. The behavior of struct loads and stores with
Dan Gohman [Mon, 3 May 2010 14:58:14 +0000 (14:58 +0000)]
Delete this comment. The behavior of struct loads and stores with
respect to padding bytes isn't something that the dependence text
needs to spell out.

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

14 years agoDescribe invoke instruction dependencies. Generalize the text for
Dan Gohman [Mon, 3 May 2010 14:55:22 +0000 (14:55 +0000)]
Describe invoke instruction dependencies. Generalize the text for
terminator instructions so that it applies to all terminators with
multiple successors, including invoke.

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

14 years agoSay "operations" instead of "instructions", as nsw can be applied to
Dan Gohman [Mon, 3 May 2010 14:51:43 +0000 (14:51 +0000)]
Say "operations" instead of "instructions", as nsw can be applied to
constant expressions as well as instructions.

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

14 years agoFix a bug which prevented tail merging of return instructions in
Dan Gohman [Mon, 3 May 2010 14:35:47 +0000 (14:35 +0000)]
Fix a bug which prevented tail merging of return instructions in
beneficial cases. See the changes in test/CodeGen/X86/tail-opts.ll and
test/CodeGen/ARM/ifcvt2.ll for details.

The fix is to change HashEndOfMBB to hash at most one instruction,
instead of trying to apply heuristics about when it will be profitable to
consider more than one instruction. The regular tail-merging heuristics
are already prepared to handle the same cases, and they're more precise.

Also, make test/CodeGen/ARM/ifcvt5.ll and
test/CodeGen/Thumb2/thumb2-branch.ll slightly more complex so that they
continue to test what they're intended to test.

And, this eliminates the problem in
test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll, the testcase from
PR5204. Update it accordingly.

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

14 years agoAdd a README entry.
Dan Gohman [Mon, 3 May 2010 14:31:00 +0000 (14:31 +0000)]
Add a README entry.

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

14 years agoRemove the -enable-sjlj-eh option, which doesn't do anything.
Duncan Sands [Sun, 2 May 2010 15:36:26 +0000 (15:36 +0000)]
Remove the -enable-sjlj-eh option, which doesn't do anything.
Remove the -enable-eh option which is only used by the JIT,
and replace it with -jit-enable-eh.

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

14 years agofix some inconsistent line endings, patch by Jakub Staszak!
Chris Lattner [Sat, 1 May 2010 17:36:49 +0000 (17:36 +0000)]
fix some inconsistent line endings, patch by Jakub Staszak!

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

14 years agorevert r102831. We already delete dead readonly calls in
Chris Lattner [Sat, 1 May 2010 17:19:38 +0000 (17:19 +0000)]
revert r102831.  We already delete dead readonly calls in
other places, killing a valid transformation is not the right
answer.

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

14 years agoDon't count debug info as instructions. This was
Dale Johannesen [Sat, 1 May 2010 16:41:11 +0000 (16:41 +0000)]
Don't count debug info as instructions.  This was
preventing the emission of the NOP on Darwin for a
function with no actual code.  From timberwolfmc
with TEST=optllcdbg.

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

14 years agoAdded a variant of InlineCostAnalyzer::getInlineCost() that takes the called function...
David Chisnall [Sat, 1 May 2010 15:47:41 +0000 (15:47 +0000)]
Added a variant of InlineCostAnalyzer::getInlineCost() that takes the called function as an explicit argument, for use when inlining function pointers.

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

14 years agoInsert ANY_EXTEND node instead of invalid truncate during DAG Combining (X & 1),
Anton Korobeynikov [Sat, 1 May 2010 12:52:34 +0000 (12:52 +0000)]
Insert ANY_EXTEND node instead of invalid truncate during DAG Combining (X & 1),
when needed. This fixes PR7001

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

14 years agoDo folding for indirect branches, where possible
Anton Korobeynikov [Sat, 1 May 2010 12:28:21 +0000 (12:28 +0000)]
Do folding for indirect branches, where possible

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

14 years agoImplement indirect branches on MSP430
Anton Korobeynikov [Sat, 1 May 2010 12:04:32 +0000 (12:04 +0000)]
Implement indirect branches on MSP430

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

14 years agoLong branch target oparands are not pc-rel.
Anton Korobeynikov [Sat, 1 May 2010 12:04:22 +0000 (12:04 +0000)]
Long branch target oparands are not pc-rel.
This should fix PR6603.

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

14 years agoDisable the call-deletion transformation introduced in r86975. Without
Owen Anderson [Sat, 1 May 2010 08:34:28 +0000 (08:34 +0000)]
Disable the call-deletion transformation introduced in r86975.  Without
halting analysis, it is illegal to delete a call to a read-only function.
The correct solution is almost certainly to add a "must halt" attribute and
only allow deletions in its presence.

XFAIL the relevant testcase for now.

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

14 years agofix PR5009 by making CGSCCPM realize that a call was devirtualized
Chris Lattner [Sat, 1 May 2010 06:38:43 +0000 (06:38 +0000)]
fix PR5009 by making CGSCCPM realize that a call was devirtualized
if an indirect call site was removed and a direct one was added, not
just if an indirect call site was modified to be direct.

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

14 years agorename test
Chris Lattner [Sat, 1 May 2010 06:34:13 +0000 (06:34 +0000)]
rename test

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

14 years agoRemove the code for special-casing byval for fast-isel. SelectionDAG
Dan Gohman [Sat, 1 May 2010 02:44:23 +0000 (02:44 +0000)]
Remove the code for special-casing byval for fast-isel. SelectionDAG
handles argument lowering anyway, so there's no need for special
casing here.

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

14 years agoFix an ancient FIXME.
Dan Gohman [Sat, 1 May 2010 02:43:10 +0000 (02:43 +0000)]
Fix an ancient FIXME.

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

14 years agoRe-disable kill flags, as there is more trouble.
Dan Gohman [Sat, 1 May 2010 01:57:56 +0000 (01:57 +0000)]
Re-disable kill flags, as there is more trouble.

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

14 years agorename InlineInfo.DevirtualizedCalls -> InlinedCalls to
Chris Lattner [Sat, 1 May 2010 01:26:13 +0000 (01:26 +0000)]
rename InlineInfo.DevirtualizedCalls -> InlinedCalls to
reflect that it includes all inlined calls now, not just
devirtualized ones.

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

14 years agoImplement rdar://6295824 and PR6724 with two tiny changes
Chris Lattner [Sat, 1 May 2010 01:15:56 +0000 (01:15 +0000)]
Implement rdar://6295824 and PR6724 with two tiny changes
that can have a big effect :).  The first is to enable the
iterative SCC passmanager juice that kicks in when the
scc passmgr detects that a function pass has devirtualized
a call.  In this case, it will rerun all the passes it
manages on the SCC, up to the iteration count limit (4). This
is useful because a function pass may devirualize a call, and
we want the inliner to inline it, or pruneeh to infer stuff
about it, etc.

The second patch is to add *all* call sites to the
DevirtualizedCalls list the inliner uses.  This list is
about to get renamed, but the jist of this is that the
inliner now reconsiders *all* inlined call sites as candidates
for further inlining.  The intuition is this that in cases
like this:

f() { g(1); }     g(int x) { h(x); }

We analyze this bottom up, and may decide that it isn't
profitable to inline H into G.  Next step, we decide that it is
profitable to inline G into F, and do so, which means that F
now calls H.  Even though the call from G -> H may not have been
profitable to inline, the call from F -> H may be (in this case
because a constant allows folding etc).

In my spot checks, this doesn't have a big impact on code.  For
example, the LLC output for 252.eon grew from 0.02% (from
317252 to 317308) and 176.gcc actually shrunk by .3% (from 1525612
to 1520964 bytes).  252.eon never iterated in the SCC Passmgr,
176.gcc iterated at most 1 time.

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

14 years agoThe inliner has traditionally not considered call sites
Chris Lattner [Sat, 1 May 2010 01:05:10 +0000 (01:05 +0000)]
The inliner has traditionally not considered call sites
that appear due to inlining a callee as candidates for
futher inlining, but a recent patch made it do this if
those call sites were indirect and became direct.

Unfortunately, in bizarre cases (see testcase) doing this
can cause us to infinitely inline mutually recursive
functions into callers not in the cycle.  Fix this by
keeping track of the inline history from which callsite
inline candidates got inlined from.

This shouldn't affect any "real world" code, but is required
for a follow on patch that is coming up next.

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

14 years agoRe-enable kill flags from SelectionDAGISel, with a fix: don't
Dan Gohman [Sat, 1 May 2010 00:50:53 +0000 (00:50 +0000)]
Re-enable kill flags from SelectionDAGISel, with a fix: don't
try to put a kill flag on a DBG_INFO instruction.

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

14 years agoFix a bug where debug info affected stack slot coloring.
Dale Johannesen [Sat, 1 May 2010 00:41:15 +0000 (00:41 +0000)]
Fix a bug where debug info affected stack slot coloring.
Seen in SingleSrc/Benchmarks/Misc/flops with TEST=optllcdbg.
7929951.

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

14 years agoFix whitespace.
Dan Gohman [Sat, 1 May 2010 00:33:28 +0000 (00:33 +0000)]
Fix whitespace.

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

14 years agoDon't pass SDValues by non-const reference unless they may be
Dan Gohman [Sat, 1 May 2010 00:33:16 +0000 (00:33 +0000)]
Don't pass SDValues by non-const reference unless they may be
modified.

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

14 years agoAdd a pseudo instruction REG_SEQUENCE that takes a list of registers and
Evan Cheng [Sat, 1 May 2010 00:28:44 +0000 (00:28 +0000)]
Add a pseudo instruction REG_SEQUENCE that takes a list of registers and
sub-register indices and outputs a single super register which is formed from
a consecutive sequence of registers.

This is used as register allocation / coalescing aid and it is useful to
represent instructions that output register pairs / quads. For example,
v1024, v1025 = vload <address>
where v1024 and v1025 forms a register pair.

This really should be modelled as
v1024<3>, v1025<4> = vload <address>
but it would violate SSA property before register allocation is done.

Currently we use insert_subreg to form the super register:
v1026 = implicit_def
v1027 - insert_subreg v1026, v1024, 3
v1028 = insert_subreg v1027, v1025, 4
...
      = use v1024
      = use v1028

But this adds pseudo live interval overlap between v1024 and v1025.

We can now modeled it as
v1024, v1025 = vload <address>
v1026 = REG_SEQUENCE v1024, 3, v1025, 4
...
      = use v1024
      = use v1026

After coalescing, it will be
v1026<3>, v1025<4> = vload <address>
...
      = use v1026<3>
      = use v1026

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

14 years agoReorgnaize more switch code lowering to clean up some tricky
Dan Gohman [Sat, 1 May 2010 00:25:44 +0000 (00:25 +0000)]
Reorgnaize more switch code lowering to clean up some tricky
code, and to eliminate the need for the SelectionDAGBuilder
state to be live during CodeGenAndEmitDAG calls.

Call SDB->clear() before CodeGenAndEmitDAG calls instead of
before it, and move the CurDAG->clear() out of SelectionDAGBuilder,
which doesn't own the DAG, and into CodeGenAndEmitDAG.

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

14 years agoTest failing too much on too many platforms.
Bill Wendling [Sat, 1 May 2010 00:12:33 +0000 (00:12 +0000)]
Test failing too much on too many platforms.

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

14 years agoDelete the EdgeMapping variable itself.
Dan Gohman [Sat, 1 May 2010 00:02:20 +0000 (00:02 +0000)]
Delete the EdgeMapping variable itself.

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

14 years agoGet rid of the EdgeMapping map. Instead, just check for BasicBlock
Dan Gohman [Sat, 1 May 2010 00:01:06 +0000 (00:01 +0000)]
Get rid of the EdgeMapping map. Instead, just check for BasicBlock
changes before doing phi lowering for switches.

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

14 years agoUpdate for CIndex rename.
Daniel Dunbar [Fri, 30 Apr 2010 23:36:47 +0000 (23:36 +0000)]
Update for CIndex rename.

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

14 years agoMaybe it needs sse2?
Bill Wendling [Fri, 30 Apr 2010 23:19:29 +0000 (23:19 +0000)]
Maybe it needs sse2?

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

14 years agoForce 64-bit.
Bill Wendling [Fri, 30 Apr 2010 22:45:20 +0000 (22:45 +0000)]
Force 64-bit.

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