Commit Graph

47178 Commits

Author SHA1 Message Date
Rafael Espindola
97a1216581 Remove DwarfTableException.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130964 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 23:19:54 +00:00
Rafael Espindola
254784f9e0 Remove the DwarfTable enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 22:14:31 +00:00
Devang Patel
ef7b4685f1 In debug output, clearly list new instructions without DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 22:05:57 +00:00
Devang Patel
51a04adc5e Remove little used statistical counter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 22:00:08 +00:00
Eli Friedman
b6e7cd655c PR9838: Fix transform introduced in r127064 to not trigger when only one side of the icmp is an exact shift.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130954 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 21:59:18 +00:00
Rafael Espindola
108709d4d1 Move PPC Linux to CFI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130951 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 21:34:33 +00:00
Rafael Espindola
ecf58b9e3c Implement a really simple DwarfSjLjException.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130947 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 20:48:31 +00:00
Rafael Espindola
2d57a64701 List all exception types in a switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130944 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 19:48:34 +00:00
Andrew Trick
ee10915892 ARM post RA scheduler compile time fix.
BuildSchedGraph was quadratic in the number of calls in the basic
block. After this fix, it keeps only a single call at the top of the
DefList so compile time doesn't blow up on large blocks. This reduces
postRA sched time on an external test case from 81s to 0.3s.  Although
r130800 (reduced ARM register alias defs) also partially fixes the
issue by reducing the constant overhead of checking call interference
by an order of magnitude.

Fixes <rdar://problem/7662664> very poor compile time with post RA scheduling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130943 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 19:32:21 +00:00
Andrew Trick
f405b1ad19 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130942 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 19:24:06 +00:00
Rafael Espindola
7af1a59382 Don't produce a __debug_frame.
I tested both gdb on a bootstrapped clang and and the gdb testsuite on OS X (snow leopard)
and both are happy using __eh_frame.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130937 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 18:43:39 +00:00
Owen Anderson
d71867a8f4 Allow FastISel of three-register-operand instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130934 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 17:59:04 +00:00
Devang Patel
d96efb83c1 If debug info for inlined function is missing then handle it gracefully.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 17:54:26 +00:00
Eli Friedman
297015913a PR9848: pandn is not commutative.
No test because I can't think of any way to write one that won't break quickly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130932 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 17:45:31 +00:00
Jakob Stoklund Olesen
e9bd4ea5fd Add some statistics to the splitting and spilling frameworks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130931 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 17:22:53 +00:00
Eli Friedman
23d3243e62 Avoid extra vreg copies for arguments passed in registers. Specifically, this can make MachineCSE more effective in some cases (especially in small functions). PR8361 / part of rdar://problem/8259436 .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130928 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 16:53:34 +00:00
Eli Friedman
6005b875b0 Small syntax cleanup; we don't need to #define constants in C++. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 16:25:23 +00:00
Eli Friedman
5f6bf5d441 Minor correction to r130877; fixes PR9846 and hopefully the buildbot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130925 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 16:18:11 +00:00
Hongbin Zheng
f262e16161 Minor change: Fix the typo in RegionPass.h and RegionPass.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130920 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 13:59:38 +00:00
Bill Wendling
087aad44cb Remove a flag that would set the ".eh" symbol as .globl. MachO was the only one
who used this flag, and it now emits CFI and doesn't emit this anymore. All
other targets left this flag "false".
<rdar://problem/8486371>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 06:49:15 +00:00
Nick Lewycky
5409a18832 Update the gcov version used slightly, to make it stop causing modern gcov's to
crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130911 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 02:46:38 +00:00
Nick Lewycky
7a75a9ade8 Remove dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 00:17:34 +00:00
Nick Lewycky
fcf74ed5a2 When the path wasn't emitted by the frontend, discard any path on the source
filename.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 00:03:30 +00:00
Jakob Stoklund Olesen
7a2718a3c1 Disable physical register coalescing by default.
Joining physregs is inherently dangerous because it uses a heuristic to avoid
creating invalid code. Linear scan had an emergency spilling mechanism to deal
with those rare cases. The new greedy allocator does not.

The greedy register allocator is much better at taking hints, so this has almost
no impact on code size and quality. The few cases where it matters show up as
unit tests that now have -join-physregs enabled explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 23:59:00 +00:00
Devang Patel
0f18d97fd1 Set debug loc for new instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130895 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 23:58:50 +00:00
Devang Patel
a922ba7edc Set debug location for new PHI nodes created in exit block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 23:58:22 +00:00
Jakob Stoklund Olesen
4f5de9bb40 Fix X86RegisterInfo::getMatchingSuperRegClass for sub_8bit_hi.
It is OK for B to be any GR8_ABCD_H superclass, the returned register class
doesn't have to map surjectively onto B.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130892 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 23:54:54 +00:00
Bill Wendling
d29052bf26 SjLj EH could produce a machine basic block that legitimately has more than one
landing pad as its successor.

SjLj exception handling jumps to the correct landing pad via a switch statement
that's generated right before code-gen. Loosen the constraint in the machine
instruction verifier to allow for this. Note, this isn't the most rigorous check
since we cannot determine where that switch statement came from. But it's
marginally better than turning this check off when SjLj exceptions are used.
<rdar://problem/9187612>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130881 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 22:54:05 +00:00
Devang Patel
95a7de6b91 Preserve line number information while threading jumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130880 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 22:48:19 +00:00
Eli Friedman
baf717a08a Re-commit r130862 with a minor change to avoid an iterator running off the edge in some cases.
Original message:

Teach MachineCSE how to do simple cross-block CSE involving physregs.  This allows, for example, eliminating duplicate cmpl's on x86. Part of rdar://problem/8259436 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130877 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 22:10:36 +00:00
Devang Patel
b90584ae78 Preserve line number info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130876 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 21:58:58 +00:00
Devang Patel
af35841f2e preserve line number info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130869 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 21:37:05 +00:00
Eli Friedman
24d4c9911e Back out r130862; it appears to be breaking bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 20:48:42 +00:00
Eli Friedman
49cec1d818 Teach MachineCSE how to do simple cross-block CSE involving physregs. This allows, for example, eliminating duplicate cmpl's on x86. Part of rdar://problem/8259436 .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 19:54:24 +00:00
Jakob Stoklund Olesen
21f7902a89 Implement SystemZRegisterInfo::getMatchingSuperRegClass to enable cross-class joins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130857 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 19:02:04 +00:00
Devang Patel
64915dec28 Do not emit location expression size twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130854 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 19:00:57 +00:00
Rafael Espindola
6af0b762db Fix cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130850 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 18:46:56 +00:00
Akira Hatanaka
6b7588e6c4 Prevent instructions using $gp from being placed between a jalr and the instruction that restores the clobbered $gp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130847 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 17:54:27 +00:00
Rafael Espindola
597a7664e1 Producing a DW_FORM_addr for DW_AT_stmt_list is probably correct, but
it is both inefficient and unexpected by dwarfdump. Change to
a DW_FORM_data4.

While in here, change the predicate name to reflect that the position
is not really absolute (it is an offset), just that the linker needs a
relocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130846 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 17:44:06 +00:00
Jakob Stoklund Olesen
9126601770 Rename -disable-physical-join to -join-physregs and invert it.
Physreg joining is still on by default, but I will turn it off shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130844 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 16:45:05 +00:00
Devang Patel
a938dd0dc9 Tighten up check for empty (i.e. no meaningful debug info) module. This fixes dwarf-die2.c test case from gcc test suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130842 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 16:34:02 +00:00
Duncan Sands
8140ad32ce Add variations on: max(x,y) >= min(x,z) folds to true. This isn't that common,
but according to my super-optimizer there are only two missed simplifications
of -instsimplify kind when compiling bzip2, and this is one of them.  It amuses
me to have bzip2 be perfectly optimized as far as instsimplify goes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130840 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 16:05:05 +00:00
Nick Lewycky
269687fa35 Emit gcov data files to the directory specified in the metadata produced by the
frontend, if applicable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130835 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 04:03:04 +00:00
Andrew Trick
37da408758 indvars: Added DisableIVRewrite and WidenIVs.
This adds functionality to remove size/zero extension during indvars
without generating a canonical IV and rewriting all IV users. It's
disabled by default so should have no effect on codegen. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 02:10:13 +00:00
Jakob Stoklund Olesen
b89383aeff Implement MSP430RegisterInfo::getMatchingSuperRegClass to enable cross-class
coalescing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 01:01:36 +00:00
Jakob Stoklund Olesen
2944b4fe05 Mark ultra-super-registers QQQQ as call-clobbered instead of the D sub-registers.
LiveVariables doesn't understand that clobbering D0 and D1 completely overwrites
Q0, so if Q0 is live-in to a function, its live range will extend beyond a
function call that only clobbers D0 and D1. This shows up in the
ARM/2009-11-01-NeonMoves test case.

LiveVariables should probably implement the much stricter rules for physreg
liveness that RAFast imposes - a physreg is killed by the first use of any
alias.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130801 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 22:31:24 +00:00
Andrew Trick
4dfdf242c1 indvars: Added canExpandBackEdgeTakenCount.
Only create a canonical IV for backedge taken count if it will
actually be used by LinearFunctionTestReplace. And some related
cleanup, preparing to reduce dependence on canonical IVs.
No significant effect on x86 or arm in the test-suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 22:24:10 +00:00
Devang Patel
ee4a3abede Even if the subprogram is going to use AT_specification, emit DW_AT_MIPS_linkage_name. This helps gdb and fixes var-path-expr.exp regression reported by gdb testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 21:50:34 +00:00
Daniel Dunbar
b47426b4de MCDwarf: Don't save Twine to local variable, this is almost never safe to do
(and should thus never be done).
 - Should fix a crash on win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 21:33:37 +00:00
Bill Wendling
9493a285d1 Replace the "movnt" intrinsics with a native store + nontemporal metadata bit.
<rdar://problem/8460511>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 21:11:17 +00:00
Jakob Stoklund Olesen
7d6b6a05b5 Gracefully handle invalid live ranges. Fix PR9831.
Register coalescing can sometimes create live ranges that end in the middle of a
basic block without any killing instruction. When SplitKit detects this, it will
repair the live range by shrinking it to its uses.

Live range splitting also needs to know about this. When the range shrinks so
much that it becomes allocatable, live range splitting fails because it can't
find a good split point. It is paranoid about making progress, so an allocatable
range is considered an error.

The coalescer should really not be creating these bad live ranges. They appear
when coalescing dead copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 20:42:13 +00:00
Duncan Sands
ad20681cde Implement some basic simplifications involving min/max, for example
max(a,b) >= a -> true.  According to my super-optimizer, these are
by far the most common simplifications (of the -instsimplify kind)
that occur in the testsuite and aren't caught by -std-compile-opts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130780 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 19:53:10 +00:00
Akira Hatanaka
9ff1b9b259 Fix function MipsRegisterInfo::getRegisterNumbering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130774 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 18:41:54 +00:00
Bob Wilson
e1a56ae747 Temporarily disable use of divmod compiler-rt functions for iOS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130766 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 17:33:22 +00:00
Bruno Cardoso Lopes
0a69ba309f Fold ARM coprocessor intrinsics patterns into the instructions defs whenever
it's possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130764 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 17:29:29 +00:00
Bruno Cardoso Lopes
54ad87ab78 Add a few ARM coprocessor intrinsics. Testcases included
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130763 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 17:29:22 +00:00
Devang Patel
30692abac7 If the front end has emitted llvm.dbg.cu and other debug info anchors (clang does it now) then use them directly. This saves one scan of entire module, to collect debug info, which in turns saves few machine cycles at compile time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 16:45:22 +00:00
Devang Patel
464f4ef2bd Use llvm.dbg.cu named metadata to collect compile units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130756 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 16:18:28 +00:00
Benjamin Kramer
d2189bf12a Remove unused variables caught by GCC's -Wunused-but-set-variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 16:00:27 +00:00
Michael J. Spencer
34868ee4de Add pentium{3,4}m cpus. Patch by Alexander Best!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130749 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 03:42:50 +00:00
Eric Christopher
2fc496fcf5 xmm0 is an implicit parameter in this and so shouldn't be in the
string template.

Fixes rdar://8493866


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 01:28:32 +00:00
Dan Gohman
cca82149ad Add an unfolded offset field to LSR's Formula record. This is used to
model constants which can be added to base registers via add-immediate
instructions which don't require an additional register to materialize
the immediate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 00:46:49 +00:00
Owen Anderson
f7710af4ba Other parts of the SelectionDAG framework assume that targets use their pointer type for vector indices. Make the vector unrolling code respect that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130733 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 22:25:45 +00:00
Devang Patel
67352b3ce7 Scanning entire basic block may be too expensive in terms of compile time. Instead, just use whatever location info first non-phi instruction has.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130729 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 21:57:00 +00:00
Jakob Stoklund Olesen
d61c40360c Handle <def,undef> in the second loop as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130718 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 20:36:53 +00:00
Eric Christopher
52f6c03a45 Apparently the check for direct calls is unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130716 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 20:16:33 +00:00
Jakob Stoklund Olesen
e2f669fb3f Use the PrintReg adaptor to correctly print live-in registers in debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130715 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 20:06:30 +00:00
Jakob Stoklund Olesen
2048e4ab7f Only ignore <undef> use operands, keep the <def,undef> ops.
Def operands may also have an <undef> flag, but that just means that a
sub-register redef doesn't actually read the super-register. For physical
registers, it has no meaning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130714 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 20:06:28 +00:00
Duncan Sands
448a6d3cc2 Fix PR9579: when simplifying a compare to "true" or "false", and it was
a vector compare, generate a vector result rather than i1 (and crashing).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130706 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 18:51:41 +00:00
Duncan Sands
00676a6df1 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 18:41:29 +00:00
Devang Patel
c455bb7dc7 Emit debug info for global variables first.
This works around a limitation in gdb which is reported by following inherit.exp test failures from gdb testsuite.

gdb.cp/inherit.exp: print g_vB.vB::vb
gdb.cp/inherit.exp: print g_vB.vB::vx
gdb.cp/inherit.exp: print g_vC.vC::vc
gdb.cp/inherit.exp: print g_vC.vC::vx
gdb.cp/inherit.exp: print g_vD.vB::vb
...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130702 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 18:19:17 +00:00
Duncan Sands
f24ed77d24 Move some rem transforms out of instcombine and into instsimplify.
This automagically provides a transform noticed by my super-optimizer
as occurring quite often: "rem x, (select cond, x, 1)" -> 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130694 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 16:27:02 +00:00
Rafael Espindola
2866edf120 Add 130690 back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130693 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 15:58:16 +00:00
Rafael Espindola
e17e6c01c8 Only produce the eh_frame section if we have at least one personality function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130692 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 15:49:52 +00:00
Rafael Espindola
b2d7336fde Revert while I debug the tests that use march but not mtriple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130691 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 15:42:31 +00:00
Rafael Espindola
433771c514 Move ppc OS X to cfi too. I am building it on an old ppc mini, but it will take some time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130690 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 15:00:52 +00:00
Jakob Stoklund Olesen
bb30dd40ed Minimize the slot indexes spanned by register ranges created when splitting.
When an interfering live range ends at a dead slot index between two
instructions, make sure that the inserted copy instruction gets a slot index
after the dead ones. This makes it possible to avoid the interference.

Ideally, there shouldn't be interference ending at a deleted instruction, but
physical register coalescing can sometimes do that to sub-registers.

This fixes PR9823.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130687 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 05:29:58 +00:00
Nick Lewycky
95d206a9c7 In option typo correction, consider -foo=VALUE flags as two distinct parts. The
comments claimed it did this, but the LHS value was actually an unused variable.

The new system considers only the '-foo' part when comparing it for typos
against flags that have values, but still look at the whole string for flags
that don't. That way, we'll still correct '-inst=combine' to '-instcombine'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 05:24:47 +00:00
Nick Lewycky
71f234ba6a Remove dead variable pointed out by GCC 4.6 warnings, and reflow this a little
to scope a variable more tightly per llvm coding style. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 05:05:29 +00:00
Chris Lattner
149f5283f9 enhance memcpyopt to obey -fno-builtin and friends. This addresses a
problem reported on cfe-dev.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130661 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 18:27:11 +00:00
Rafael Espindola
450a5a1207 Add r130623 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130658 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 15:44:13 +00:00
NAKAMURA Takumi
6073a05240 Windows/DynamicLibrary.inc: Clean up ELM_Callback. We may check the decl instead of the versions of individual libraries.
autoconf: Add checking ELM_Callback decl for mingw32 and mingw-w64.
cmake/config-ix.cmake: Add checking ELM_Callback decl for win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 13:29:49 +00:00
Chandler Carruth
9bc1537488 Remove an unused variable from this function introduced in r130637,
likely a result of copy/paste.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130640 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 06:14:10 +00:00
Rafael Espindola
5426a9ee37 GCC uses a different encoding of pointers in the FDE when using
-fno-dwarf2-cfi-asm. Implement the same behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 04:49:54 +00:00
Rafael Espindola
c35280647b I forgot these files in the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130635 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 04:19:24 +00:00
Rafael Espindola
debd7e4e8b Simplify the handling of pcrel relocations on ELF. Now we do the right thing
for all symbol differences and can drop the old EmitPCRelSymbolValue
method.

This also make getExprForFDESymbol on ELF equal to the one on MachO, and it
can be made non-virtual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 03:50:49 +00:00
Rafael Espindola
2b3e12d0cb Revert the previous patch while I figure out how to make llvm-gcc
less agressive about disabling cfi on linux :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130626 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 23:03:44 +00:00
Jakob Stoklund Olesen
60045c233a X86AsmPrinter doesn't know how to handle the X86II::MO_GOT_ABSOLUTE_ADDRESS flag
after folding ADD32ri to ADD32mi, so don't do that.

This only happens when the greedy register allocator gets itself in trouble and
spills %vreg9 here:

16L             %vreg9<def> = MOVPC32r 0, %ESP<imp-use>; GR32:%vreg9
48L             %vreg9<def> = ADD32ri %vreg9, <es:_GLOBAL_OFFSET_TABLE_>[TF=1], %EFLAGS<imp-def,dead>; GR32:%vreg9

That should never happen, the live range should be split instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130625 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 23:00:05 +00:00
Rafael Espindola
89fc9e8f5e Enable CFI on OS X.
Currently the output should be almost identical to the one produced by CodeGen
to make the transition easier.

The only two differences I know of are:

* Some files get an extra advance loc of size 0. This will be fixed when
relaxations are enabled.
* The optimization of declaring an EH symbol as an external variable is not
implemented. This is a subset of adding the nounwind attribute, so we if really
this at -O0 we should probably do it at the IL level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130623 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 22:29:54 +00:00
Jakob Stoklund Olesen
ec7e4fff96 When a physreg is live-in and live through a basic block, make sure its live
range covers the entire block.

The live range can't be terminated at a random instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 19:12:33 +00:00
Benjamin Kramer
7d6eb5a018 InstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for urem or constant B.
This obviously helps a lot if the division would be turned into a libcall
(think i64 udiv on i386), but div is also one of the few remaining instructions
on modern CPUs that become more expensive when the bitwidth gets bigger.

This also helps register pressure on i386 when dividing chars, divb needs
two 8-bit parts of a 16 bit register as input where divl uses two registers.

int foo(unsigned char a) { return a/10; }
int bar(unsigned char a, unsigned char b) { return a/b; }

compiles into (x86_64)
_foo:
  imull $205, %edi, %eax
  shrl  $11, %eax
  ret
_bar:
  movzbl        %dil, %eax
  divb  %sil, %al
  movzbl        %al, %eax
  ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130615 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 18:16:07 +00:00
Benjamin Kramer
23b02cd031 Use SimplifyDemandedBits on div instructions.
This folds away silly stuff like (a&255)/1000 -> 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 18:16:00 +00:00
Rafael Espindola
277abc8172 Implement MCAsmStreamer::EmitEHSymAttributes. Doing this in the asm streamer
is a bit ugly, but doing it on the base MCStreamer would be redundant
with the object streamer which does it using SD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 16:34:57 +00:00
Rafael Espindola
97f7f4e43d Handle PrivateExtern eh symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130609 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 16:22:46 +00:00
Jakob Stoklund Olesen
6ee56e658a Avoid using stale entries form the sibling value map.
This could happen when trying to use a value that had been eliminated after dead
code elimination and folding loads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130597 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 06:42:21 +00:00
Jakob Stoklund Olesen
66446c803a Use hysteresis for local live range splitting as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130596 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 05:07:46 +00:00
Rafael Espindola
f1a5c7ec04 Add all the plumbing needed for MC to expand cfi to the old tables in
the final assembly. It is the same technique used when targeting
assemblers that don't support .loc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130587 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 03:44:37 +00:00
Rafael Espindola
a37bd1d02c Implement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130585 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 03:21:04 +00:00
Jakob Stoklund Olesen
141f529baf Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130582 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 03:13:08 +00:00
Jakob Stoklund Olesen
5aa3211e2d Use a greedy algorithm for allocating registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130568 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 01:37:54 +00:00
Bill Wendling
d65ba721cc Print out the 'nontemporal' info on a store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130562 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 23:45:22 +00:00
Eli Friedman
b2b03fc2fa Make FastEmit_ri_ try a bit harder to succeed for supported operations; FastEmit_i can fail for non-Thumb2 ARM. Makes ARMSimplifyAddress work correctly, and reduces the number of fast-isel bailouts on non-Thumb ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130560 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 23:34:52 +00:00
Eric Christopher
5ac179ccd2 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 23:12:01 +00:00
Eli Friedman
b451770b26 Zap a couple now-unused functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130557 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 22:56:48 +00:00
Eli Friedman
c573e2c7ea Switch to ImmLeaf (which can be used by FastISel) for a few more common ARM/Thumb2 patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130552 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 22:48:03 +00:00
Devang Patel
40348e8d1f Assing line number info to new PHIs created by SSA updater.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130551 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 22:28:59 +00:00
Eric Christopher
d94bc549fc Add FastEmitInst_ii for the arm fast isel generator. It doesn't use it, but
if it ever did it needs the def machinery.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130549 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 22:07:50 +00:00
Eric Christopher
632ae892e6 Some cleanup and optimize fallthrough more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130546 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 21:56:31 +00:00
Rafael Espindola
1f6c87554a Avoid some uses of .uleb128. This is a small speedup and more importantly
lets this code be used when producing assembly code for old assemblers without
uleb support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130544 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 21:50:57 +00:00
Rafael Espindola
7f46b08082 Implement MCAsmStreamer::EmitCFIDefCfa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130543 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 21:41:06 +00:00
Devang Patel
0b2fb39d8d Print new instructions without DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130542 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 21:36:04 +00:00
Eli Friedman
9ebf57ae13 Re-committing r130454, which does not in fact break anything.
Fix a rather obscure crash caused by ARM fast-isel generating code which redefines a register.
rdar://problem/9338332 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130539 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 21:22:56 +00:00
Devang Patel
bd5426a4f2 Preserve line number information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130536 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 20:38:55 +00:00
Eric Christopher
bcf26aee86 Add trunc->branch support, this won't help with clang's i8->i1 truncations
for bools, but is a start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130534 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 20:02:39 +00:00
Peter Collingbourne
57808b3da0 SimplifyCFG: Expose phi node folding cost threshold as command line parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130528 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:47:38 +00:00
Peter Collingbourne
f15907fead SimplifyCFG: Add CostRemaining parameter to DominatesMergePoint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130527 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:47:31 +00:00
Peter Collingbourne
8a70192b51 SimplifyCFG: Add Trunc, ZExt and SExt to the list of cheap instructions for phi node folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:47:25 +00:00
Daniel Dunbar
c8497b6a25 MCAsmLayout: Add support for computing the symbol offset of variables. Not
currently used, because variables don't get reported as being "defined".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130524 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:20:20 +00:00
Daniel Dunbar
90604ab725 MC: Change variable symbols to be recognized as defined, by assigning their sections based on FindAssociatedSection().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130523 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:20:17 +00:00
Daniel Dunbar
173aa9ce32 MC/Mach-O: Update getSymbolAddress() to support evaluation of variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:13:42 +00:00
Daniel Dunbar
5ff919b324 MC/Mach-O: Allow emission of relocations for variables in some more cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130520 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:10:47 +00:00
Daniel Dunbar
08b9935b51 MC/Mach-O: Find section ordinal's by looking at the symbol, instead of assuming they are present in a fragment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130519 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:07:43 +00:00
Devang Patel
49a3ff9d17 Hoist MCLineEntry construction AsmPrinter so that anyone who derives from AsmPrinter can have line number entries.
PR 9810



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130518 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:00:54 +00:00
Daniel Dunbar
0eab5c4d85 MCExpr: Add FindAssociatedSection, which attempts to mirror the 'as' semantics
that associate sections with expressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130517 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:00:03 +00:00
Daniel Dunbar
6db7fe8736 MC/AsmParser: Generalize a check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130515 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 17:53:11 +00:00
Douglas Gregor
c003229ddc Fix a C++0x portability issue with std::make_pair. Explicitly providing template arguments no longer works when the call arguments are lvalues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130513 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 16:57:12 +00:00
Douglas Gregor
72d30f6950 Include <pthread.h> before we use pthread_self/pthread_kill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 16:12:17 +00:00
Rafael Espindola
ac3ba1b27e The last hack for producing bit identical output with cfi on OS X.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130504 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 15:09:53 +00:00
Rafael Espindola
7b11a4cbdc Change DwarfCFIException's member variables to track what it actually
emmits: .cfi_personality, .cfi_lsda and the moves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130503 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 14:48:51 +00:00
Andrew Trick
d49ffe8284 Teach Thumb2 isel to fold and->rotr ==> ROR.
Generalization of Nate Begeman's patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130502 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 14:18:15 +00:00
Rafael Espindola
a432997745 Factor some code to needsCFIMoves. Avoid printing moves when we don't have to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130501 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 14:14:06 +00:00
Benjamin Kramer
ce3a022b8c This is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130499 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 14:09:57 +00:00
Benjamin Kramer
3224806109 Balance parentheses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130489 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 08:41:23 +00:00
Benjamin Kramer
c2e31c1461 InstCombine: turn (C1 << A) << C2) into (C1 << C2) << A)
Fixes PR9809.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130485 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 08:15:41 +00:00
Chris Lattner
bb0fff0cb4 clean up after Sean's r127646 patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130475 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 05:40:18 +00:00
Chris Lattner
d7d030a447 use the MachineInstrBuilder operator-> to simplify some code.
There are probably more instances of this floating around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130474 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 05:24:29 +00:00
Rafael Espindola
4892dff07e Last bit by bit compatibility patch to MCDwarf.cpp: If a FDE with no LSDA is
assigned to a CIE that requires one, just output a 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130472 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 03:06:29 +00:00
Rafael Espindola
9099813bd5 Add an alternative implementation of CIE and FDE emission that outputs them
in the same order as the one in CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130471 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 02:42:28 +00:00
Eric Christopher
6344a5f146 Update comments and checks to match reality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130464 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 00:07:20 +00:00
Eric Christopher
299bbb23a4 Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130463 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 00:03:10 +00:00
Eli Friedman
6e6014cfb3 Revert r130454; apparently this doesn't actually work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130462 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 23:55:14 +00:00
Eli Friedman
2f7fcd7198 Fix a rather obscure crash caused by ARM fast-isel generating code which redefines a register.
rdar://problem/9338332 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130454 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 23:03:25 +00:00
Devang Patel
5367b23f76 Preserve line number information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130450 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 22:48:14 +00:00
Matt Beaumont-Gay
2a2116723f Coalesce some DEBUGs (moving an only-used-in-DEBUG variable's declaration into the DEBUG)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130448 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 22:26:05 +00:00
Benjamin Kramer
b0884f3f13 We require threse bits to be zero, too.
This shouldn't happen in practice because the icmp would be a constant.
Add a check so we don't miscompile code if something goes wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130446 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 21:38:51 +00:00
Nick Lewycky
7a2ba2fbe4 Only read *predecessor once so as to fix a theoretical issue where it changes
between two reads (threading).

Fix an off-by-one in the indirect counter table that I meant to revert after an
earlier experiment. Whoops!

Implement GCOV_PREFIX. Doesn't handle GCOV_PREFIX_STRIP yet.

Fix an off-by-one in string emission. Extra whoops!

Tolerate DISubprograms that have null Function*'s attached to them. I don't yet
understand what this means, but it happens when you have a global static with
a non-trivial constructor/destructor.

Fix a crash on switch statements with a single successor (default-only).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130443 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 21:35:49 +00:00
Daniel Dunbar
f86500bc4f Target/X86/MC: Add an option for disabling arith relaxation, for my own testing
purposes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130438 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 21:23:31 +00:00
Rafael Espindola
a0057ca13f Add the getExprForFDESymbol method that responsible for computing the
expressions used in the FDE to refer to symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130437 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 21:04:39 +00:00
Devang Patel
77562c74e5 Beautify debug info probe output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130435 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:46:18 +00:00
Ted Kremenek
5d86759e0f Add MemoryBuffer::getBufferKind() to report whether a memory buffer uses malloc'ed or mmap'ed memory. This is for performance analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130432 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:34:18 +00:00
Devang Patel
81ad03c020 Remove DbgDeclare only if all uses are converted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:32:02 +00:00
Lenny Maiorani
6cf081cbe5 Remove bounded StringRef::compare() since nothing but Clang SA was using it and it is just as easy to use StringRef::substr() preceding StringRef::compare() to achieve the same thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:20:12 +00:00
Eli Friedman
d227eedf82 fast-isel sret calls, try 2. We actually do need to do something on x86-32. rdar://problem/9303592 .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130429 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:19:12 +00:00
Benjamin Kramer
e12d583621 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130428 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:09:57 +00:00
Chris Lattner
1e4f44bb8a improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130426 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:02:57 +00:00
Devang Patel
81199d2545 Do not lose line number info while eliminating tail call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130419 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 18:43:39 +00:00
Chris Lattner
0a9e3d613b final step needed to resolve PR6627, which allows us to flatten the code down to
a nice and tidy:
  %x1 = load i32* %0, align 4
  %1 = icmp eq i32 %x1, 1179403647
  br i1 %1, label %if.then, label %if.end

instead of doing lots of loads and branches.  May the FreeBSD bootloader
long fit in its allocated space.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130416 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 18:15:47 +00:00
Chris Lattner
ad3ba6a7de code cleanups only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 18:08:21 +00:00
Eli Friedman
6cf31b0a1a Revert r130348; causing buildbot issues on x86-32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130412 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 18:06:10 +00:00
Devang Patel
d78bfbc6bb Add command line option to print debug info in human readable form as comment in llvm IR output. This, i.e -enable-debug-info-comment, is very useful if you want to easily find out which optimization pass is losing line number information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 17:41:38 +00:00
Andrew Trick
88e92cf16b Reapply r130340: Fix for PR9730.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 17:30:04 +00:00
Benjamin Kramer
264ac878b2 InstCombine: Merge "(trunc x) == C1 & (and x, CA) == C2" into a single and+icmp.
This happens when GVN widens loads. Part of PR6627.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130405 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 16:58:40 +00:00
Eric Christopher
7a20a37bac Be more layout aware here and swap the successor and branch condition
if it means we get a fallthrough.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130404 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 16:52:09 +00:00
Chris Lattner
4756ecb375 centralize "marking for deletion" into a helper function. Pass GVN around to
static functions instead of passing around tons of random ivars.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130403 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 16:36:48 +00:00
Chris Lattner
f07054d98a Promote toErase to be an ivar of the GVN class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130401 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 16:18:52 +00:00
Rafael Espindola
bfa27cc5d7 Add a getExprForPersonalitySymbol method to MCAsmInfo. Use it when
converting the symbol passed to .cfi_personality into bytes is the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130400 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 16:09:09 +00:00
Rafael Espindola
8bca4106df Mark the EH symbol global or weak if the corresponding function is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130397 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 12:50:37 +00:00
Chandler Carruth
80d9e07262 Fix the last -Wnon-pod-memset I'm seeing. This is benign, but appears
a bit more sinister as the memset doesn't do what the constructor does.
There seems to be a cleaner solution than a cast here though, instead we
can point the memset destination into the union its actually trying to
clear.

An alternative is to point to the Untyped member of this union. Review
appreciated, and if that is cleaner I'm happy to switch. All of these
should be functionally equivalent to the original code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130395 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 08:37:18 +00:00
Chris Lattner
4034e14985 teach GVN to widen integer loads when they are overaligned, when doing an
wider load would allow elimination of subsequent loads, and when the wider
load is still a native integer type.  This eliminates a ton of loads on 
various benchmarks involving struct fields, though it is somewhat hobbled
by clang not being very aggressive about field alignment.

This is yet another step along the way towards resolving PR6627.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130390 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 07:29:08 +00:00
Eric Christopher
8f232d307a Let the immediate leaf pattern take transforms and switch the signed
immediate patterns in arm to using the pattern.

Handles rdar://9299434


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130386 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 05:49:04 +00:00
Chris Lattner
4c19b17a17 move PR9803 to this readme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130385 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 05:33:16 +00:00
Rafael Espindola
235b830328 Add a small temporary hack for producing identical eh_frame sections on OS X.
This removes one of the main advantages of moving eh_frame to MC, but
makes the transition a lot easier to debug (run md5).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 04:04:14 +00:00
Rafael Espindola
514cecc72b Produce the EH_frame# symbols if needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 03:26:11 +00:00
Rafael Espindola
a8cfb87fa2 Forward isFunctionEHFrameSymbolPrivate. If it is false, produce the foo.eh
symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130375 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 02:46:42 +00:00
Devang Patel
c26f5447e3 Teach dwarf writer to handle complex address expression for .debug_loc entries.
This fixes clang generated blocks' variables' debug info.
Radar 9279956.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130373 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 02:22:40 +00:00
Eli Friedman
bd1253809b Fix a silly mistake in r130338.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130360 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:42:03 +00:00
Justin Holewinski
2d525c5532 PTX: support for select_cc and fixes for setcc
- expansion of SELECT_CC into SETCC
- force SETCC result type to i1
- custom selection for handling i1 using SETCC

Patch by Dan Bailey

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130358 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:19:56 +00:00
Justin Holewinski
9c86533347 PTX: support for select
- selection of SELP instruction
- new selp.ll test

Patch by Dan Bailey

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130357 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:19:55 +00:00
Justin Holewinski
ef342fc751 PTX: mov fix and rounding correction for cvt
- fix typo in MOV
- correct fp rounding on CVT
- new cvt.ll test

Patch by Dan Bailey

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130356 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:19:54 +00:00
Justin Holewinski
8ff9cd203f PTX: support for fneg
- selection of FNEG instruction
- new fneg.ll test

Patch by Dan Bailey

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130355 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:19:53 +00:00
Justin Holewinski
4fea05acfa PTX: support for zext loads and trunc stores
- expansion of EXTLOAD and TRUNCSTORE instructions

Patch by Dan Bailey

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130354 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:19:52 +00:00
Justin Holewinski
5a3cb924c6 PTX: support for bitwise operations on predicates
- selection of bitwise preds (AND, OR, XOR)
- new bitwise.ll test

Patch by Dan Bailey

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130353 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:19:51 +00:00
Justin Holewinski
9583a86ba8 PTX: patch to AsmPrinter
- immediate value cast as long not int
- handles initializer for constant array

Patch by Dan Bailey

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130352 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:19:50 +00:00
Andrew Trick
a7707ae19a Reverting r130340 in the unlikely event that it's responsible for a llvm-gcc stage2 compiler error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130350 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:13:59 +00:00
Eli Friedman
8211a6a61d fast-isel sret. We actually don't need to do anything special on x86. :) rdar://problem/9303592 .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130348 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 23:58:52 +00:00
Rafael Espindola
60246a9622 Remove unnecessary argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130343 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 23:17:57 +00:00
Rafael Espindola
7afec9cc0f Rename getPersonalityPICSymbol to getCFIPersonalitySymbol, document it, and
give it a bit more responsibility. Also implement it for MachO.

If hacked to use cfi, 32 bit MachO will produce

.cfi_personality 155, L___gxx_personality_v0$non_lazy_ptr

and 64 bit will produce

.cfi_presonality ___gxx_personality_v0

The general idea is that .cfi_personality gets passed the final symbol. It is
up to codegen to produce it if using indirect representation (like 32 bit
MachO), but it is up to MC to decide which relocations to create.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130341 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 23:08:15 +00:00
Andrew Trick
685f07fac2 Fixes PR9730: indvars: An asserting value handle still pointed to this value
Modified LinearFunctionTestReplace to push the condition on the dead
list instead of eagerly deleting it. This can cause unnecessary
IV rewrites, which should have no effect on codegen and will not be an
issue once we stop generating canonical IVs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130340 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 23:00:03 +00:00
Devang Patel
e1cdf84ee5 Simplify handling of variables with complex address (i.e. blocks variables)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130339 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 22:45:24 +00:00
Eli Friedman
2790ba8e5a Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common. rdar://problem/9303592 .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130338 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 22:41:55 +00:00
Eli Friedman
161b887506 Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130337 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 22:21:02 +00:00
Rafael Espindola
018e38c6dd Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130331 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 21:29:52 +00:00
Kevin Enderby
e23aea28f9 Fix a bug in the case that there is no add or subtract symbol and the offset
value is zero so it does not add a NULL expr operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 21:02:27 +00:00
Dan Gohman
1d7e818a38 Teach BasicAA about arm.neon.vld1 and vst1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130327 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 20:44:28 +00:00
Devang Patel
0be77dff11 Revert r130178. It turned out to be not the optimal path to emit complex location expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130326 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 20:29:27 +00:00
Evan Cheng
309db7c947 If converter was being too cute. It look for root BBs (which don't have
successors) and use inverse depth first search to traverse the BBs. However
that doesn't work when the CFG has infinite loops. Simply do a linear
traversal of all BBs work just fine.

rdar://9344645


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130324 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 19:32:43 +00:00
Dan Gohman
bddc1ca18a When analyzing functions known to only access argument pointees,
only check arguments with pointer types. Update the documentation
of IntrReadArgMem reflect this.

While here, add support for TBAA tags on intrinsic calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130317 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 18:39:03 +00:00
Andrew Trick
a2a162077c Corrects an old, old typo in a case that doesn't seem to be reached in practice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130316 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 18:17:36 +00:00
Devang Patel
7878f37cf0 Simplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLoc to this new trap instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130315 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 17:59:27 +00:00
Jakob Stoklund Olesen
93e110ba34 Also add <imp-def> operands for defined and dead super-registers when rewriting.
We cannot rely on the <imp-def> operands added by LiveIntervals in all cases as
demonstrated by the test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130313 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 17:42:31 +00:00
Rafael Espindola
ed708f9c1f Factor a bit of code to MCStreamer::EmitLabel. Keep track of the last
non private symbol. This will be use for handling

foo:
  .cfi_startproc
  ...

On OS X where we have to create a foo.eh symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130305 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 15:21:19 +00:00
Duncan Sands
089a246333 Stop trying to have instcombine preserve LCSSA form: this was not
effective in avoiding recomputation of LCSSA form; the widespread
use of instsimplify (which looks through phi nodes) means it was
not preserving LCSSA form anyway; and instcombine is no longer
scheduled in the middle of the loop passes so this doesn't matter
anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130301 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 10:55:12 +00:00
Andrew Trick
104f4adeac Test case and comment for PR9633.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130294 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 05:42:17 +00:00
Eli Friedman
d5089a9794 Refactor out code to fast-isel a memcpy operation with a small constant
length.  (I'm planning to use this to implement byval.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130274 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:45:07 +00:00
Rafael Espindola
9266cc400e Force some values to be absolute and align based on the FDE pointers size. A small
step towards using .cfi_* on OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:43:49 +00:00
Eli Friedman
547eb4fd56 Fix an edge case involving branches in fast-isel on x86.
rdar://problem/9303306 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:34:27 +00:00
Andrew Trick
3f95c88162 Fix for PR9633 [indvars] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Added a type check in ScalarEvolution::computeSCEVAtScope to handle the case in which operands of an
AddRecExpr in the current scope are folded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:21:25 +00:00
Chris Lattner
cb5fd743a9 Enhance memdep to return clobber relation between noalias loads when
an earlier load could be widened to encompass a later load.  For example,
if we see:

  X = load i8* P, align 4
  Y = load i8* (P+3), align 1

and we have a 32-bit native integer type, we can widen the former load
to i32 which then makes the second load redundant.  GVN can't actually
do anything with this load/load relation yet, so this isn't testable, but 
it is the next step to resolving PR6627, and a fairly general class of 
"merge neighboring loads" missed optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130250 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 22:42:01 +00:00
Jakob Stoklund Olesen
9f4b893b84 Add a safe-guard against repeated splitting for some rare cases.
The number of blocks covered by a live range must be strictly decreasing when
splitting, otherwise we can't allow repeated splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130249 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 22:33:12 +00:00
Chris Lattner
d5c7f7cb5e use AA::isMustAlias to simplify some calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:53:34 +00:00
Chris Lattner
130131ea78 remove support for llvm.invariant.end from memdep. It is a
work-in-progress that is not progressing, and it has issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:50:51 +00:00
Evan Cheng
554daa67bd Be careful about scheduling nodes above previous calls. It increase usages of
more callee-saved registers and introduce copies. Only allows it if scheduling
a node above calls would end up lessen register pressure.

Call operands also has added ABI restrictions for register allocation, so be
extra careful with hoisting them above calls.

rdar://9329627


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:31:35 +00:00
Chris Lattner
325eeb1cd7 Transform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
when X has multiple uses.  This is useful for exposing secondary optimizations,
but the X86 backend isn't ready for this when X has a single use.  For example,
this can disable load folding.

This is inching towards resolving PR6627.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 20:18:20 +00:00
Chris Lattner
5036ce4a64 some random cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 20:02:45 +00:00
Jim Grosbach
f7da8821b4 ARM and Thumb2 support for atomic MIN/MAX/UMIN/UMAX loads.
rdar://9326019


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130234 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 19:44:18 +00:00
Rafael Espindola
fea8fea583 Print the label if we will use it in debug_frame.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130232 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 19:26:53 +00:00
Devang Patel
116da2fbe9 Refactor code. Keep dwarf register operation selection logic at one place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130231 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 19:06:18 +00:00
Jakob Stoklund Olesen
1394e6d925 Use the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.
This has two effects: 1. We never inflate to a larger register class than what
the sub-target can handle. 2. Completely unconstrained virtual registers get the
largest possible register class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130229 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 18:52:36 +00:00
Jakob Stoklund Olesen
c9e5015dec Add a TRI::getLargestLegalSuperClass hook to provide an upper limit on register class inflation.
The hook will be used by the register allocator when recomputing register
classes after removing constraints.

Thumb1 code doesn't allow anything larger than tGPR, and x86 needs to ensure
that the spill size doesn't change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130228 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 18:52:33 +00:00
Devang Patel
7b5bd37241 Fix an off by one error while accessing complex address element of a DIVariable.
This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130225 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 18:24:39 +00:00
Chris Lattner
9750acc079 Improve the bail-out predicate to really only kick in when phi
translation fails.  We were bailing out in some cases that would
cause us to miss GVN'ing some non-local cases away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130206 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 17:41:02 +00:00
Dan Gohman
a61e73bda5 Fast-isel support for simple inline asms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130205 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 17:18:34 +00:00
Duncan Sands
a37caf6472 Another example of a static table that wasn't marked static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 07:30:10 +00:00
Chris Lattner
bffc2b4af1 don't emit the symbol name twice for local bss and common
symbols.  For example, don't emit:
        .comm   _i,4,2                  ## @i
                                        ## @i

instead emit:
        .comm   _i,4,2                  ## @i



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130192 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 06:14:13 +00:00
Evan Cheng
b16d06f88a Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 04:57:37 +00:00
Rafael Espindola
b28d4f152e Print all the moves at a given label instead of just the first one.
Remove previous DwarfCFI hack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 03:58:56 +00:00
Nick Lewycky
1790c9cbb6 Rename everything to follow LLVM style ... I think.
Add support for switch and indirectbr edges. This works by densely numbering
all blocks which have such terminators, and then separately numbering the
possible successors. The predecessors write down a number, the successor knows
its own number (as a ConstantInt) and sends that and the pointer to the number
the predecessor wrote down to the runtime, who looks up the counter in a
per-function table.

Coverage data should now be functional, but I haven't tested it on anything
other than my 2-file synthetic test program for coverage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130186 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 03:54:16 +00:00
Rafael Espindola
d88cac0a6e No relocation produces a SLEB or ULEB, make sure they are handled in MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130181 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 02:17:58 +00:00
Chris Lattner
1f821512fc Enhance MemDep: When alias analysis returns a partial alias result,
return it as a clobber.  This allows GVN to do smart things.

Enhance GVN to be smart about the case when a small load is clobbered
by a larger overlapping load.  In this case, forward the value.  This
allows us to compile stuff like this:

int test(void *P) {
  int tmp = *(unsigned int*)P;
  return tmp+*((unsigned char*)P+1);
}

into:

_test:                                  ## @test
	movl	(%rdi), %ecx
	movzbl	%ch, %eax
	addl	%ecx, %eax
	ret

which has one load.  We already handled the case where the smaller
load was from a must-aliased base pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130180 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 01:21:15 +00:00
Devang Patel
0c99861836 Let dwarf writer allocate extra space in the debug location expression. This space, if requested, will be used for complex addresses of the Blocks' variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130178 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 00:12:46 +00:00
Devang Patel
9341d10f94 Rename a local variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:05:21 +00:00
Devang Patel
b865d46d95 Rename a method to match what it really does.
s/addVariableAddress/addFrameVariableAddress/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:02:17 +00:00
Devang Patel
80925f5dca Do not drop a variable's complex address if it is not based on frame base.
Observed this while reading code, so I do not have a test case handy here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:52:55 +00:00
Dan Gohman
308bec390f Fix an iterator invalidation bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130166 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:48:29 +00:00
Chris Lattner
607b8ebfb8 mark a large static table static. Pointed out by Michael Ilseman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130160 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:14:33 +00:00
Chris Lattner
e27c3ea2bc allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
patch by Johannes Schaub!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130151 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:58:50 +00:00
Chris Lattner
ed0318eab8 add a missed bitfield instcombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130137 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 18:44:26 +00:00
Akira Hatanaka
f48eb533d5 Lower BlockAddress node when relocation-model is static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130131 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 17:10:45 +00:00
Devang Patel
06104e3743 A dbg.declare may not be in entry block, even if it is referring to an incoming argument. However, It is appropriate to emit DBG_VALUE referring to this incoming argument in entry block in MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 16:33:52 +00:00
Chandler Carruth
a4a2a03c31 Remove some hard coded CR-LFs. Some of these were the entire files, one of
these was just one line of a file. Explicitly set the eol-style property on the
files to try and ensure this fix stays.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130125 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 07:11:23 +00:00
Duncan Sands
d03bcc1364 Fix comment typo. Noticed by Liu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130120 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 06:21:43 +00:00
Rafael Espindola
e54e785be5 Simplify the logic. Noticed by aKor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 19:55:34 +00:00
Rafael Espindola
7ed6732447 Synchronize the conditions for producing a .cfi_startproc and a .cfi_endproc.
Fixes PR9787.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130115 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 19:00:34 +00:00
Sebastian Redl
dac4b9267b Fix Target/ARM/Thumb1FrameLowering.h header guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130097 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 15:47:01 +00:00
Sebastian Redl
69ffd7ad14 Give MC/MCDisassembler/Disassembler.h a header guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130096 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 15:46:56 +00:00
Sebastian Redl
6796e4fc88 Give SplitKit.h a header guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130095 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 15:46:51 +00:00
Jay Foad
61717b3d94 Fix an assert to check exactly what it says.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130093 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 14:30:00 +00:00
Jay Foad
685501836b PR9214: Convert the DIBuilder API to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130086 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 10:11:03 +00:00
Jay Foad
ddcdcc8863 Remove unused STL header includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 19:53:52 +00:00
Jay Foad
a0f5092703 Like the coding standards say, do not use "using namespace std".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 09:06:00 +00:00