oota-llvm.git
15 years agoThe instruction pointer %RIP is a reserved register on x86_64.
Jakob Stoklund Olesen [Fri, 13 Nov 2009 21:56:01 +0000 (21:56 +0000)]
The instruction pointer %RIP is a reserved register on x86_64.

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

15 years agoFix polarity of a CFG check in machine verifier.
Jakob Stoklund Olesen [Fri, 13 Nov 2009 21:55:54 +0000 (21:55 +0000)]
Fix polarity of a CFG check in machine verifier.

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

15 years agoUse .data() instead of .c_str() when nul-termination is not needed.
Dan Gohman [Fri, 13 Nov 2009 21:55:31 +0000 (21:55 +0000)]
Use .data() instead of .c_str() when nul-termination is not needed.

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

15 years agoDo not use value handle to wrap MDNode in DIDescriptor.
Devang Patel [Fri, 13 Nov 2009 21:45:04 +0000 (21:45 +0000)]
Do not use value handle to wrap MDNode in DIDescriptor.

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

15 years agoMove DebugInfo checks into EmitComments and remove them from
David Greene [Fri, 13 Nov 2009 21:34:57 +0000 (21:34 +0000)]
Move DebugInfo checks into EmitComments and remove them from
target-specific AsmPrinters.  Not all comments need DebugInfo.

Re-enable the line numbers comment test.

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

15 years agoWhen optimizing for size, don't tail-merge unless it's likely to be a
Dan Gohman [Fri, 13 Nov 2009 21:02:15 +0000 (21:02 +0000)]
When optimizing for size, don't tail-merge unless it's likely to be a
code-size win, and not when it's only likely to be code-size neutral,
such as when only a single instruction would be eliminated and a new
branch would be required.

This fixes rdar://7392894.

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

15 years agoFix PR5410: LiveVariables lost subreg def:
Evan Cheng [Fri, 13 Nov 2009 20:36:40 +0000 (20:36 +0000)]
Fix PR5410: LiveVariables lost subreg def:

D0<def,dead> = ...
...
             = S0<use, kill>
S0<def>      = ...
...
D0<def>      =

The first D0 def is correctly marked dead, however, livevariables should have
added an implicit def of S0 or we end up with a use without a def.

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

15 years agoAllow target to specify regclass for which antideps will only be broken along the...
David Goodwin [Fri, 13 Nov 2009 19:52:48 +0000 (19:52 +0000)]
Allow target to specify regclass for which antideps will only be broken along the critical path.

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

15 years agoSupport fp64 immediate zero, this fixes only part of PR5445
Bruno Cardoso Lopes [Fri, 13 Nov 2009 18:49:59 +0000 (18:49 +0000)]
Support fp64 immediate zero, this fixes only part of PR5445
because the testcase is triggering one more bug.

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

15 years agoDon't let a noalias difference disrupt the tailcall optimization.
Dan Gohman [Fri, 13 Nov 2009 18:49:38 +0000 (18:49 +0000)]
Don't let a noalias difference disrupt the tailcall optimization.

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

15 years agoRemove duplicate APIs and state WRT spill objects.
David Greene [Fri, 13 Nov 2009 14:42:06 +0000 (14:42 +0000)]
Remove duplicate APIs and state WRT spill objects.

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

15 years agoDistinguish "a," from "a". The first one splits into "a" + "" and the second one...
Rafael Espindola [Fri, 13 Nov 2009 04:55:09 +0000 (04:55 +0000)]
Distinguish "a," from "a". The first one splits into "a" + "" and the second one into
"a" + 0.

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

15 years agoRevert r87059 for now. It is failing clang tests.
Devang Patel [Fri, 13 Nov 2009 02:27:33 +0000 (02:27 +0000)]
Revert r87059 for now. It is failing clang tests.

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

15 years agoIgnore nameless variables.
Devang Patel [Fri, 13 Nov 2009 02:25:26 +0000 (02:25 +0000)]
Ignore nameless variables.

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

15 years agoSwitch to smallvector. Also fix issue with using unsigend for MaxSplit.
Rafael Espindola [Fri, 13 Nov 2009 02:18:25 +0000 (02:18 +0000)]
Switch to smallvector. Also fix issue with using unsigend for MaxSplit.

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

15 years agoAdjust isConstantSplat to allow for big-endian targets.
Dale Johannesen [Fri, 13 Nov 2009 01:45:18 +0000 (01:45 +0000)]
Adjust isConstantSplat to allow for big-endian targets.
PPC is such a target; make it work.

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

15 years agoRemove unnecessary llvm.dbg.declare bitcast
Victor Hernandez [Fri, 13 Nov 2009 01:44:55 +0000 (01:44 +0000)]
Remove unnecessary llvm.dbg.declare bitcast

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

15 years agoAdd a new split method to StringRef that puts the substrings in a vector.
Rafael Espindola [Fri, 13 Nov 2009 01:24:40 +0000 (01:24 +0000)]
Add a new split method to StringRef that puts the substrings in a vector.

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

15 years agoBlock renumbering
Jim Grosbach [Fri, 13 Nov 2009 01:19:24 +0000 (01:19 +0000)]
Block renumbering

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

15 years agouse lower case for readability
Jim Grosbach [Fri, 13 Nov 2009 01:17:22 +0000 (01:17 +0000)]
use lower case for readability

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

15 years agoUpdate test.
Daniel Dunbar [Fri, 13 Nov 2009 01:01:58 +0000 (01:01 +0000)]
Update test.

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

15 years agoFix a bootstrap failure.
David Greene [Fri, 13 Nov 2009 00:29:53 +0000 (00:29 +0000)]
Fix a bootstrap failure.

Provide special isLoadFromStackSlotPostFE and isStoreToStackSlotPostFE
interfaces to explicitly request checking for post-frame ptr elimination
operands.  This uses a heuristic so it isn't reliable for correctness.

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

15 years agoRe-enable this code, since redundant PHIs are now being better nuked.
Owen Anderson [Thu, 12 Nov 2009 23:22:41 +0000 (23:22 +0000)]
Re-enable this code, since redundant PHIs are now being better nuked.

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

15 years agoSimplify code a bit
Bill Wendling [Thu, 12 Nov 2009 23:13:08 +0000 (23:13 +0000)]
Simplify code a bit

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

15 years agoRefactor code that checks if it's a call to a "nounwind" function.
Bill Wendling [Thu, 12 Nov 2009 21:59:20 +0000 (21:59 +0000)]
Refactor code that checks if it's a call to a "nounwind" function.

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

15 years agouse isInstructionTriviallyDead, as pointed out by Duncan
Chris Lattner [Thu, 12 Nov 2009 21:58:18 +0000 (21:58 +0000)]
use isInstructionTriviallyDead, as pointed out by Duncan

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

15 years agoDo some cleanups suggested by Chris.
David Greene [Thu, 12 Nov 2009 21:49:55 +0000 (21:49 +0000)]
Do some cleanups suggested by Chris.

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

15 years agoStringRef(const char*) should not be used to turn null pointers into empty
Daniel Dunbar [Thu, 12 Nov 2009 21:26:11 +0000 (21:26 +0000)]
StringRef(const char*) should not be used to turn null pointers into empty
strings.

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

15 years agoSet the ReloadReuse AsmPrinter flag where appropriate.
David Greene [Thu, 12 Nov 2009 21:07:54 +0000 (21:07 +0000)]
Set the ReloadReuse AsmPrinter flag where appropriate.

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

15 years agoRemove my Value.h build fix.
Daniel Dunbar [Thu, 12 Nov 2009 21:07:02 +0000 (21:07 +0000)]
Remove my Value.h build fix.

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

15 years agoFix a build error by providing a missing enum value.
David Greene [Thu, 12 Nov 2009 21:04:19 +0000 (21:04 +0000)]
Fix a build error by providing a missing enum value.

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

15 years agoMake the MachineFunction argument of getFrameRegister const.
David Greene [Thu, 12 Nov 2009 21:00:03 +0000 (21:00 +0000)]
Make the MachineFunction argument of getFrameRegister const.

This also fixes a build error.

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

15 years agoAdd hasLoadFromStackSlot and hasStoreToStackSlot to return whether a
David Greene [Thu, 12 Nov 2009 20:55:29 +0000 (20:55 +0000)]
Add hasLoadFromStackSlot and hasStoreToStackSlot to return whether a
machine instruction loads or stores from/to a stack slot.  Unlike
isLoadFromStackSlot and isStoreFromStackSlot, the instruction may be
something other than a pure load/store (e.g. it may be an arithmetic
operation with a memory operand).  This helps AsmPrinter determine when
to print a spill/reload comment.

This is only a hint since we may not be able to figure this out in all
cases.  As such, it should not be relied upon for correctness.

Implement for X86.  Return false by default for other architectures.

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

15 years agoAttempt to unbreak LLVM build, David G. please check.
Daniel Dunbar [Thu, 12 Nov 2009 20:53:56 +0000 (20:53 +0000)]
Attempt to unbreak LLVM build, David G. please check.

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

15 years agoFix -Asserts warning.
Daniel Dunbar [Thu, 12 Nov 2009 20:53:43 +0000 (20:53 +0000)]
Fix -Asserts warning.

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

15 years agoIf there's more than one function operand to a call instruction, be conservative
Bill Wendling [Thu, 12 Nov 2009 20:51:53 +0000 (20:51 +0000)]
If there's more than one function operand to a call instruction, be conservative
and don't assume that the call doesn't throw. It would be nice if there were a
way to determine which is the callee and which is a parameter. In practice, the
architecture we care about normally only have one operand for a call instruction
(x86 and arm).

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

15 years agoAdd a bool flag to StackObjects telling whether they reference spill
David Greene [Thu, 12 Nov 2009 20:49:22 +0000 (20:49 +0000)]
Add a bool flag to StackObjects telling whether they reference spill
slots.  The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values.  It's too easy to pass a wrong argument
value when multiple arguments have default values.  Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..

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

15 years agoAdd compare_lower and equals_lower methods to StringRef. Switch all users of
Benjamin Kramer [Thu, 12 Nov 2009 20:36:59 +0000 (20:36 +0000)]
Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.

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

15 years agoMake FixedStackPseudoSourceValue a first-class PseudoSourceValue by
David Greene [Thu, 12 Nov 2009 20:25:07 +0000 (20:25 +0000)]
Make FixedStackPseudoSourceValue a first-class PseudoSourceValue by
making it visible to clients and adding LLVM-style cast capability.
This will be used by AsmPrinter to determine when to emit spill comments
for an instruction.

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

15 years agoAdd AsmPrinter comment flags to machine instructions so that AsmPrinter
David Greene [Thu, 12 Nov 2009 20:21:09 +0000 (20:21 +0000)]
Add AsmPrinter comment flags to machine instructions so that AsmPrinter
can emit extra information in comments.

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

15 years agoAdd comment flags so AsmPrinter can output additional information when
David Greene [Thu, 12 Nov 2009 20:13:34 +0000 (20:13 +0000)]
Add comment flags so AsmPrinter can output additional information when
emitting comments.  These flags carry semantic information not otherwise
easily derivable from the IR text.

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

15 years agoRename registers to break output dependencies in addition to anti-dependencies.
David Goodwin [Thu, 12 Nov 2009 19:08:21 +0000 (19:08 +0000)]
Rename registers to break output dependencies in addition to anti-dependencies.

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

15 years ago"Attach debug info with llvm instructions" mode was enabled a month ago. Now make...
Devang Patel [Thu, 12 Nov 2009 19:02:56 +0000 (19:02 +0000)]
"Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.

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

15 years agoMark DBG_LABEL, EH_LABEL, and GC_LABEL as not-duplicable, since
Dan Gohman [Thu, 12 Nov 2009 18:36:19 +0000 (18:36 +0000)]
Mark DBG_LABEL, EH_LABEL, and GC_LABEL as not-duplicable, since
they really are not duplicable.

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

15 years agoSilence a warning on targets with unsigned chars.
Benjamin Kramer [Thu, 12 Nov 2009 17:59:45 +0000 (17:59 +0000)]
Silence a warning on targets with unsigned chars.

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

15 years agoUpdate TB[BH] layout optimization. Add support for moving the target block
Jim Grosbach [Thu, 12 Nov 2009 17:25:07 +0000 (17:25 +0000)]
Update TB[BH] layout optimization. Add support for moving the target block
to directly follow the jump table. Move the layout changes to prior to any
constant island handling.

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

15 years agoClean up testcase a bit. Simplify case blocks and adjust switch instruction to not...
Jim Grosbach [Thu, 12 Nov 2009 17:19:09 +0000 (17:19 +0000)]
Clean up testcase a bit. Simplify case blocks and adjust switch instruction to not take an undefined value as input.

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

15 years agofix crash in my previous patch
Nuno Lopes [Thu, 12 Nov 2009 15:10:33 +0000 (15:10 +0000)]
fix crash in my previous patch

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

15 years agoimplement shl, ashr, and lshr methods. shl is not fully implemented as it is quite...
Nuno Lopes [Thu, 12 Nov 2009 14:53:53 +0000 (14:53 +0000)]
implement shl, ashr, and lshr methods. shl is not fully implemented as it is quite tricky.

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

15 years agoFix typo in run line.
Benjamin Kramer [Thu, 12 Nov 2009 12:35:27 +0000 (12:35 +0000)]
Fix typo in run line.

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

15 years agotypo
Gabor Greif [Thu, 12 Nov 2009 09:44:17 +0000 (09:44 +0000)]
typo

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

15 years agoimplement a nice little efficiency hack in the inliner. Since we're now
Chris Lattner [Thu, 12 Nov 2009 07:56:08 +0000 (07:56 +0000)]
implement a nice little efficiency hack in the inliner.  Since we're now
running IPSCCP early, and we run functionattrs interlaced with the inliner,
we often (particularly for small or noop functions) completely propagate
all of the information about a call to its call site in IPSSCP (making a call
dead) and functionattrs is smart enough to realize that the function is
readonly (because it is interlaced with inliner).

To improve compile time and make the inliner threshold more accurate, realize
that we don't have to inline dead readonly function calls.  Instead, just
delete the call.  This happens all the time for C++ codes, here are some
counters from opt/llvm-ld counting the number of times calls were deleted vs
inlined on various apps:

Tramp3d opt:
  5033 inline                - Number of call sites deleted, not inlined
 24596 inline                - Number of functions inlined
llvm-ld:
  667 inline           - Number of functions deleted because all callers found
  699 inline           - Number of functions inlined

483.xalancbmk opt:
  8096 inline                - Number of call sites deleted, not inlined
 62528 inline                - Number of functions inlined
llvm-ld:
   217 inline           - Number of allocas merged together
  2158 inline           - Number of functions inlined

471.omnetpp:
  331 inline                - Number of call sites deleted, not inlined
 8981 inline                - Number of functions inlined
llvm-ld:
  171 inline           - Number of functions deleted because all callers found
  629 inline           - Number of functions inlined

Deleting a call is much faster than inlining it, and is insensitive to the
size of the callee. :)

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

15 years agoRegScavenger::enterBasicBlock should always reset register state.
Evan Cheng [Thu, 12 Nov 2009 07:49:10 +0000 (07:49 +0000)]
RegScavenger::enterBasicBlock should always reset register state.

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

15 years ago- Teach LSR to avoid changing cmp iv stride if it will create an immediate that
Evan Cheng [Thu, 12 Nov 2009 07:35:05 +0000 (07:35 +0000)]
- Teach LSR to avoid changing cmp iv stride if it will create an immediate that
  cannot be folded into target cmp instruction.
- Avoid a phase ordering issue where early cmp optimization would prevent the
  later count-to-zero optimization.
- Add missing checks which could cause LSR to reuse stride that does not have
  users.
- Fix a bug in count-to-zero optimization code which failed to find the pre-inc
  iv's phi node.
- Remove, tighten, loosen some incorrect checks disable valid transformations.
- Quite a bit of code clean up.

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

15 years agoUse table to separate opcode from operands.
Evan Cheng [Thu, 12 Nov 2009 07:16:34 +0000 (07:16 +0000)]
Use table to separate opcode from operands.

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

15 years agoisLegalICmpImmediate should take a signed integer; code clean up.
Evan Cheng [Thu, 12 Nov 2009 07:13:11 +0000 (07:13 +0000)]
isLegalICmpImmediate should take a signed integer; code clean up.

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

15 years agoCMake: Hopefully unbreak the build by mimicking the changes on the
Oscar Fuentes [Thu, 12 Nov 2009 06:48:09 +0000 (06:48 +0000)]
CMake: Hopefully unbreak the build by mimicking the changes on the
other build system about the new C_INCLUDE_DIRS configure option.

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

15 years agoAdd the --with-c-include-dirs to llvm's configure.
Rafael Espindola [Thu, 12 Nov 2009 05:46:09 +0000 (05:46 +0000)]
Add the --with-c-include-dirs to llvm's configure.
The clang patch is next.

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

15 years agoCMake: Pass -lm to check_symbol_exists for detecting several math
Oscar Fuentes [Thu, 12 Nov 2009 05:36:09 +0000 (05:36 +0000)]
CMake: Pass -lm to check_symbol_exists for detecting several math
functions like floorf, ceilf, ... Add test for detecting nearbyintf.

This change was prompted by test/Transforms/SimplifyLibCalls/floor.ll

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

15 years agouse getPredicateOnEdge to fold comparisons through PHI nodes,
Chris Lattner [Thu, 12 Nov 2009 05:24:05 +0000 (05:24 +0000)]
use getPredicateOnEdge to fold comparisons through PHI nodes,
which implements GCC PR18046.  This also gets us 360 more
jump threads on 176.gcc.

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

15 years agovarious fixes to the lattice transfer functions.
Chris Lattner [Thu, 12 Nov 2009 04:57:13 +0000 (04:57 +0000)]
various fixes to the lattice transfer functions.

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

15 years agoswitch jump threading to use getPredicateOnEdge in one place
Chris Lattner [Thu, 12 Nov 2009 04:37:50 +0000 (04:37 +0000)]
switch jump threading to use getPredicateOnEdge in one place
making the new LVI stuff smart enough to subsume some special
cases in the old code.  Disable them when LVI is around, the
testcase still passes.

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

15 years agoAdd a new getPredicateOnEdge method which returns more rich information for
Chris Lattner [Thu, 12 Nov 2009 04:36:58 +0000 (04:36 +0000)]
Add a new getPredicateOnEdge method which returns more rich information for
constant constraints.  Improve the LVI lattice to include inequality
constraints.

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

15 years agoMove the utility function UpdateTerminator() from CodePlacementOpt() into
Jim Grosbach [Thu, 12 Nov 2009 03:55:33 +0000 (03:55 +0000)]
Move the utility function UpdateTerminator() from CodePlacementOpt() into
MachineBasicBlock so other passes can utilize it.

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

15 years agoRevert 86857. It's causing consumer-typeset to fail, and there's a better way to...
Jim Grosbach [Thu, 12 Nov 2009 03:28:35 +0000 (03:28 +0000)]
Revert 86857. It's causing consumer-typeset to fail, and there's a better way to do it forthcoming anyway.

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

15 years agoUse stubs when we have them, otherwise use code we already have,
Eric Christopher [Thu, 12 Nov 2009 03:12:18 +0000 (03:12 +0000)]
Use stubs when we have them, otherwise use code we already have,
otherwise create a stub.

Add a test to make sure we don't create extraneous stubs.

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

15 years agoAdd the braces gcc suggested.
Daniel Dunbar [Thu, 12 Nov 2009 02:52:56 +0000 (02:52 +0000)]
Add the braces gcc suggested.

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

15 years agoAdd CreateNUWAdd and CreateNUWSub to complement the existing CreateNSWAdd and
Nick Lewycky [Thu, 12 Nov 2009 02:08:11 +0000 (02:08 +0000)]
Add CreateNUWAdd and CreateNUWSub to complement the existing CreateNSWAdd and
CreateNSWSub functions.

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

15 years agoshould not commit when distracted.
Chris Lattner [Thu, 12 Nov 2009 02:04:17 +0000 (02:04 +0000)]
should not commit when distracted.

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

15 years agoMake the BranchFolderPass class local to BranchFolding.cpp.
Dan Gohman [Thu, 12 Nov 2009 01:59:26 +0000 (01:59 +0000)]
Make the BranchFolderPass class local to BranchFolding.cpp.

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

15 years agoWe now thread some impossible condition information with LVI.
Chris Lattner [Thu, 12 Nov 2009 01:55:20 +0000 (01:55 +0000)]
We now thread some impossible condition information with LVI.

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

15 years agoMinor code cleanups.
Dan Gohman [Thu, 12 Nov 2009 01:51:28 +0000 (01:51 +0000)]
Minor code cleanups.

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

15 years agowith the new code we can thread non-instruction values. This
Chris Lattner [Thu, 12 Nov 2009 01:41:34 +0000 (01:41 +0000)]
with the new code we can thread non-instruction values.  This
allows us to handle the test10 testcase.

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

15 years agothis argument can be an arbitrary value, it doesn't need to be an instruction.
Chris Lattner [Thu, 12 Nov 2009 01:37:43 +0000 (01:37 +0000)]
this argument can be an arbitrary value, it doesn't need to be an instruction.

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

15 years agoexpose edge information and switch j-t to use it.
Chris Lattner [Thu, 12 Nov 2009 01:29:10 +0000 (01:29 +0000)]
expose edge information and switch j-t to use it.

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

15 years agoFixed an iteration condition in PreAllocSplitting. This should fix some miscompilatio...
Lang Hames [Thu, 12 Nov 2009 01:24:08 +0000 (01:24 +0000)]
Fixed an iteration condition in PreAllocSplitting. This should fix some miscompilations casued by PreAllocSplitting.

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

15 years agomove some stuff into DEBUG's and turn on lazy-value-info for
Chris Lattner [Thu, 12 Nov 2009 01:22:16 +0000 (01:22 +0000)]
move some stuff into DEBUG's and turn on lazy-value-info for
the basic.ll testcase.

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

15 years agoFix typo, cleanup whitespace.
Eric Christopher [Thu, 12 Nov 2009 01:06:08 +0000 (01:06 +0000)]
Fix typo, cleanup whitespace.

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

15 years agoDo not use StringRef in DebugInfo interface.
Devang Patel [Thu, 12 Nov 2009 00:50:58 +0000 (00:50 +0000)]
Do not use StringRef in DebugInfo interface.
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!

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

15 years agoTail merge at any size when there are two potentials blocks and one
Dan Gohman [Thu, 12 Nov 2009 00:39:10 +0000 (00:39 +0000)]
Tail merge at any size when there are two potentials blocks and one
can be made to fall through into the other.

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

15 years agoDon't mark a call as potentially throwing if the function it's calling has the
Bill Wendling [Wed, 11 Nov 2009 23:17:02 +0000 (23:17 +0000)]
Don't mark a call as potentially throwing if the function it's calling has the
"nounwind" attribute.

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

15 years agoA real solution for the first part of PR5445
Bruno Cardoso Lopes [Wed, 11 Nov 2009 23:09:33 +0000 (23:09 +0000)]
A real solution for the first part of PR5445

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

15 years agomake LazyValueInfo actually to some stuff. This isn't very tested but improves
Chris Lattner [Wed, 11 Nov 2009 22:48:44 +0000 (22:48 +0000)]
make LazyValueInfo actually to some stuff.  This isn't very tested but improves
strswitch.

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

15 years agopass TD into a SimplifyCmpInst call. Add another case that
Chris Lattner [Wed, 11 Nov 2009 22:31:38 +0000 (22:31 +0000)]
pass TD into a SimplifyCmpInst call.  Add another case that
uses LVI info when -enable-jump-threading-lvi is passed.

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

15 years agoPromote MergePotentialsElt and SameTailElt to be regular classes
Dan Gohman [Wed, 11 Nov 2009 21:57:02 +0000 (21:57 +0000)]
Promote MergePotentialsElt and SameTailElt to be regular classes
instead of typedefs for std::pair. This simplifies the type of
SameTails, which previously was std::vector<std::pair<std::vector<std::pair<unsigned, MachineBasicBlock *> >::iterator, MachineBasicBlock::iterator>

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

15 years agox86 users can now return arbitrary sized structs. Structs too large to fit in return...
Kenneth Uildriks [Wed, 11 Nov 2009 19:59:24 +0000 (19:59 +0000)]
x86 users can now return arbitrary sized structs.  Structs too large to fit in return registers will be returned through a hidden sret parameter introduced during SelectionDAG construction.

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

15 years agoRevert this line of 86871.
Dan Gohman [Wed, 11 Nov 2009 19:56:05 +0000 (19:56 +0000)]
Revert this line of 86871.

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

15 years agoIf doesSupportDebugInformation() is false then do not try to emit dwarf debug info.
Devang Patel [Wed, 11 Nov 2009 19:55:08 +0000 (19:55 +0000)]
If doesSupportDebugInformation() is false then do not try to emit dwarf debug info.

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

15 years agoCheck in the changes to this file too.
Dan Gohman [Wed, 11 Nov 2009 19:49:34 +0000 (19:49 +0000)]
Check in the changes to this file too.

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

15 years agoAdd support for tail duplication to BranchFolding, and extend
Dan Gohman [Wed, 11 Nov 2009 19:48:59 +0000 (19:48 +0000)]
Add support for tail duplication to BranchFolding, and extend
tail merging support to handle more cases.
 - Recognize several cases where tail merging is beneficial even when
   the tail size is smaller than the generic threshold.
 - Make use of MachineInstrDesc::isBarrier to help detect
   non-fallthrough blocks.
 - Check for and avoid disrupting fall-through edges in more cases.

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

15 years agoFix liveness calculation when splitting critical edges during PHI elimination.
Jakob Stoklund Olesen [Wed, 11 Nov 2009 19:31:31 +0000 (19:31 +0000)]
Fix liveness calculation when splitting critical edges during PHI elimination.

- Edges are split before any phis are eliminated, so the code is SSA.

- Create a proper IR BasicBlock for the split edges.

- LiveVariables::addNewBlock now has same syntax as
  MachineDominatorTree::addNewBlock. Algorithm calculates predecessor live-out
  set rather than successor live-in set.

This feature still causes some miscompilations.

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

15 years agoReenable StackTracke.cpp test.
Devang Patel [Wed, 11 Nov 2009 19:08:42 +0000 (19:08 +0000)]
Reenable StackTracke.cpp test.

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

15 years agoAdd SetDebugLocation() variant to
Devang Patel [Wed, 11 Nov 2009 19:06:06 +0000 (19:06 +0000)]
Add SetDebugLocation() variant to
add debug info location to an instruction.

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

15 years agoAdd TargetLowering::isLegalICmpImmediate. It tells LSR what immediate can be folded...
Evan Cheng [Wed, 11 Nov 2009 19:05:52 +0000 (19:05 +0000)]
Add TargetLowering::isLegalICmpImmediate. It tells LSR what immediate can be folded into target icmp instructions.

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

15 years agoDo jump table adjustment before constant island allocation
Jim Grosbach [Wed, 11 Nov 2009 19:04:24 +0000 (19:04 +0000)]
Do jump table adjustment before constant island allocation

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

15 years agoFix indentation level.
Dan Gohman [Wed, 11 Nov 2009 18:42:28 +0000 (18:42 +0000)]
Fix indentation level.

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

15 years agoWhitespace cleanups.
Dan Gohman [Wed, 11 Nov 2009 18:38:14 +0000 (18:38 +0000)]
Whitespace cleanups.

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

15 years agoPrefix MBB numbers with "BB#" in debug output to make it clear what
Dan Gohman [Wed, 11 Nov 2009 18:23:17 +0000 (18:23 +0000)]
Prefix MBB numbers with "BB#" in debug output to make it clear what
the numbers mean.

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

15 years agoMinor code simplification.
Dan Gohman [Wed, 11 Nov 2009 18:18:34 +0000 (18:18 +0000)]
Minor code simplification.

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

15 years agoFix a copy+pasto in a comment.
Dan Gohman [Wed, 11 Nov 2009 18:14:02 +0000 (18:14 +0000)]
Fix a copy+pasto in a comment.

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