Commit Graph

72094 Commits

Author SHA1 Message Date
Stuart Hastings 999fa3bf1f Correctly walk through nested and adjacent CALLSEQ_START nodes. No
test case; I've only seen this on a release branch, and I can't get it
to reproduce on trunk.  rdar://problem/7662569

llvm-svn: 131152
2011-05-10 21:20:03 +00:00
Rafael Espindola 19c1a56287 Produce a __debug_frame section on darwin ARM when appropriate.
llvm-svn: 131151
2011-05-10 21:04:45 +00:00
Rafael Espindola 99f6735532 On MachO, unlike ELF, there should be no relocation to produce the CIE pointer.
llvm-svn: 131149
2011-05-10 20:59:42 +00:00
Rafael Espindola 2fe0ee1ce2 Rename DwarfRequiresRelocationForStmtList to
DwarfRequiresRelocationForSectionOffset as this is not specific to StmtList.

llvm-svn: 131148
2011-05-10 20:35:05 +00:00
Rafael Espindola d0d2354258 The EH symbols are only needed in eh_frame, not debug_frame.
llvm-svn: 131146
2011-05-10 19:51:53 +00:00
Rafael Espindola fdc3e6fab6 Use .cfi_sections to put the unwind info in .debug_frame when possible. With
this clang will use .debug_frame in, for example,
clang -g -c -m32 test.c
This matches gcc's behaviour. It looks like .debug_frame is a bit bigger
than .eh_frame, but has the big advantage of not being allocated.

llvm-svn: 131140
2011-05-10 18:39:09 +00:00
Eric Christopher e33464663f Refactor lock versions of binary operators to be a little less
cut and paste.

llvm-svn: 131139
2011-05-10 18:36:16 +00:00
Jason W Kim 62f1ab79ec First cut at getting debugging support for ARM/MC/ELF/.o
DWARF stuff also gets fixed up by ELFARMAsmBackend::ApplyFixup(),
but the offset is not guaranteed to be mod 4 == 0 as in text/data. 

llvm-svn: 131137
2011-05-10 18:07:25 +00:00
Jakob Stoklund Olesen 4028ccdbe3 Downgrade a tablegen warning to an error.
Ambiguous sub-register index compositions are OK as long as the backend writer
knows what he is doing.

llvm-svn: 131134
2011-05-10 17:52:59 +00:00
Jakob Stoklund Olesen 50215afd8a Fix PR9883. Make sure all caches are invalidated when a live range is repaired.
The previous invalidation missed the alias interference caches.

Also add a stats counter for the number of repaired ranges.

llvm-svn: 131133
2011-05-10 17:37:41 +00:00
Rafael Espindola 27390b4a0e In a debug_frame the cfi offset is to the start of the debug_frame section!
llvm-svn: 131129
2011-05-10 15:20:23 +00:00
Justin Holewinski 3c0447259c PTX: add test cases for cvt, fneg, and selp
Patch by Dan Bailey

llvm-svn: 131128
2011-05-10 14:53:13 +00:00
Rafael Espindola ec53aa9485 Add CFIStartSections to the asm printer. Add an assert that at least
one of the sections is created.

llvm-svn: 131124
2011-05-10 13:39:48 +00:00
Justin Holewinski 72d74e4606 PTX: add PTX 2.3 setting in PTX sub-target.
Patch by Wei-Ren Chen

llvm-svn: 131123
2011-05-10 12:32:11 +00:00
Rafael Espindola 1ecb12fc57 Add support for producing .deubg_frame sections.
llvm-svn: 131121
2011-05-10 03:54:12 +00:00
Rafael Espindola b6444c0401 Small cleanups.
llvm-svn: 131120
2011-05-10 03:26:21 +00:00
Rafael Espindola b6089d6cac Factor some code into a new EmitFrames method.
llvm-svn: 131119
2011-05-10 03:14:15 +00:00
Rafael Espindola 0e130d1d37 Remove unused argument.
llvm-svn: 131118
2011-05-10 03:01:39 +00:00
Rafael Espindola 74b101f3e3 Parsing and plumbing for .cfi_sections.
llvm-svn: 131117
2011-05-10 01:10:18 +00:00
Devang Patel 3fd06f760b Preserve line number information.
llvm-svn: 131112
2011-05-10 00:03:11 +00:00
Devang Patel 589845d887 Do not ignore InlinedAt while walking up scope chain to find subprogram node.
llvm-svn: 131106
2011-05-09 22:14:49 +00:00
Jim Grosbach 112a2de78c Tidy up. 80-column and whitespace.
llvm-svn: 131094
2011-05-09 20:05:25 +00:00
Eric Christopher 4480428474 Look through struct wrapped types for inline asm statments.
Patch by Evan Cheng.

llvm-svn: 131093
2011-05-09 20:04:43 +00:00
Dan Gohman 0daf687e1d Change a few std::maps to DenseMaps.
llvm-svn: 131088
2011-05-09 18:44:09 +00:00
Eric Christopher 5dc19f916c Fix td file comments for Mips.
Patch by Liu <proljc@gmail.com>!

llvm-svn: 131086
2011-05-09 18:16:46 +00:00
Mon P Wang 92ff16b7bb Fixed MC encoding for index_align for VLD1/VST1 (single element from one lane) for size 32
llvm-svn: 131085
2011-05-09 17:47:27 +00:00
Duncan Sands 6be291a2cd Indent properly, no functionality change.
llvm-svn: 131082
2011-05-09 08:03:33 +00:00
NAKAMURA Takumi 392445823d Eliminate an unused line to fix a warning.
llvm-svn: 131078
2011-05-08 23:19:04 +00:00
Jakob Stoklund Olesen 89bd2ae517 Remove an assertion to fix PR9872.
It can happen that a live debug variable is the last use of a sub-register, and
the register allocator will pick a larger register class for the virtual
register.  If the allocated register doesn't support the sub-register index,
just use %noreg for the debug variables instead of asserting.

In PR9872, a debug variable ends up in the sub_8bit_hi part of a GR32_ABCD
register. The register is split and one part is inflated to GR32 and assigned
%ESI because there are no more normal uses of sub_8bit_hi.

Since %ESI doesn't have that sub-register, substPhysReg asserted. Now it will
simply insert a %noreg instead, and the debug variable will be marked
unavailable in that range.

We don't currently have a way of saying: !"value" is in bits 8-15 of %ESI, I
don't know if DWARF even supports that.

llvm-svn: 131073
2011-05-08 19:21:08 +00:00
Benjamin Kramer d724a590e5 X86: Add a bunch of peeps for add and sub of SETB.
"b + ((a < b) ? 1 : 0)" compiles into
	cmpl	%esi, %edi
	adcl	$0, %esi
instead of
	cmpl	%esi, %edi
	sbbl	%eax, %eax
	andl	$1, %eax
	addl	%esi, %eax

This saves a register, a false dependency on %eax
(Intel's CPUs still don't ignore it) and it's shorter.

llvm-svn: 131070
2011-05-08 18:36:07 +00:00
Rafael Espindola ab39c63538 Don't force relaxation of AdvanceLoc instructions on OS X. gdb is happy with
the smaller encoding and this cuts 270336 bytes from a release version of
clang and 1246272 bytes from a debug build.

llvm-svn: 131067
2011-05-08 14:35:21 +00:00
Eli Friedman aa2637343c PR9869: Add explicit destructor declarations to Operator subclasses, to allow
compiling Operator.h with gcc 4.6 in C++0x mode.

llvm-svn: 131062
2011-05-08 01:59:22 +00:00
Jakob Stoklund Olesen c132174169 Eliminate the ARM sub-register indexes that are not needed by the sources.
Tablegen will invent its own names for these indexes, and the register file is a
bit simpler.

llvm-svn: 131059
2011-05-07 21:22:42 +00:00
Jakob Stoklund Olesen c8c4ded3c6 Teach TableGen to automatically generate missing SubRegIndex instances.
The RegisterInfo.td file should only specify the indexes that sources need to
refer to. The rest is inferred.

llvm-svn: 131058
2011-05-07 21:22:39 +00:00
Eli Friedman 6dec2aa9b4 Fix comments per Duncan's review.
llvm-svn: 131055
2011-05-07 19:23:14 +00:00
Duncan Sands af32728a57 The comparision "max(x,y)==x" is equivalent to "x>=y". Since the max is
often expressed as "x >= y ? x : y", there is a good chance we can extract
the existing "x >= y" from it and use that as a replacement for "max(x,y)==x".

llvm-svn: 131049
2011-05-07 16:56:49 +00:00
Eric Christopher 1e3db02bda Fix the non-MC encoding of pkhbt and pkhtb.
Patch by Stephen Hines.

llvm-svn: 131045
2011-05-07 04:37:27 +00:00
Jakob Stoklund Olesen 58799a35e5 Revert ExecutionEngine patches, they either failed to build or broke unit tests.
Please ensure the build is clean and tests are passing when recommitting.

llvm-svn: 131044
2011-05-07 03:12:54 +00:00
Rafael Espindola bcabcdcedd Switch Darwin to the generic CIE/FDE printer.
llvm-svn: 131031
2011-05-06 22:29:04 +00:00
Dylan Noblesmith 4c261a2831 ExecutionEngine: delete duplicated files
Forgot to `svn rm` these in revisions 131025 / 131029.

llvm-svn: 131030
2011-05-06 22:24:04 +00:00
Dylan Noblesmith 00dd3d6001 ExecutionEngine: add missing file
From revision 131025.

llvm-svn: 131029
2011-05-06 22:20:09 +00:00
Akira Hatanaka cbb7fa68ed 1. Keep lines in 80 columns.
2. Remove unused function.
3. Correct indentation.

llvm-svn: 131028
2011-05-06 22:11:29 +00:00
Dylan Noblesmith 8c0487006e ExecutionEngine: move createJIT() definition
As an ExecutionEngine class function, its definition
really belongs in ExecutionEngine.cpp, not JIT.cpp.

llvm-svn: 131027
2011-05-06 22:07:14 +00:00
Dylan Noblesmith ab6bd20da9 ExecutionEngine: push TargetMachine creation into clients
In particular, into EngineBuilder. This should only impact
the private API between the EE and EB classes, not external
clients, since JITCtor and MCJITCtor are both protected members.

llvm-svn: 131026
2011-05-06 22:06:22 +00:00
Dylan Noblesmith fed7f0b3a0 ExecutionEngine: fix JIT/MCJIT selectTarget() duplication
This prepares for making JITCtor/MCJITCtor take a
TargetMachine* directly from clients like EngineBuilder.

llvm-svn: 131025
2011-05-06 22:05:43 +00:00
Jakob Stoklund Olesen a5c889982a Emit a proper error message when register allocators run out of registers.
This can't be just an assertion, users can always write impossible inline
assembly. Such an assembly statement should be included in the error message.

llvm-svn: 131024
2011-05-06 21:58:30 +00:00
Andrew Trick 2e116a4491 Added an assertion, and updated a comment.
llvm-svn: 131022
2011-05-06 21:52:52 +00:00
Nick Lewycky 64c9284411 It's valid to take the blockaddress of a different function, so remove this
assert in the bitcode writer. No change needed because the ValueEnumerator holds
a whole-module numbering anyhow. Fixes PR9857!

llvm-svn: 131016
2011-05-06 21:09:44 +00:00
Evan Cheng d26fc5e013 80 col violations.
llvm-svn: 131015
2011-05-06 20:52:23 +00:00
Eli Friedman 2518f8376d Make the logic for determining function alignment more explicit. No functionality change.
llvm-svn: 131012
2011-05-06 20:34:06 +00:00
Eli Friedman 7a78f66145 Use array_lengthof. No functional change.
llvm-svn: 131008
2011-05-06 19:50:10 +00:00
Jakob Stoklund Olesen 57c8f58aeb Iterate backwards over debug locations when splitting them so they can be safely erased.
This should unbreak dragonegg-i386-linux and build-self-4-mingw32.

llvm-svn: 131007
2011-05-06 19:31:19 +00:00
Jim Grosbach 59ddb73d47 Improve diagnostics for some parse errors. Not asserting when a user input
error is detected is a good thing.

llvm-svn: 131005
2011-05-06 18:47:45 +00:00
Jim Grosbach 763ac0397e ParseFile() may throw, so extend the try/catch to handle that.
llvm-svn: 131004
2011-05-06 18:39:28 +00:00
Galina Kistanova a335f5aeeb Move few target-dependant tests to appropriate directories.
llvm-svn: 131002
2011-05-06 18:24:46 +00:00
Andrew Trick 84f9ad9bf2 Typo: Reviewed by Alistair.
llvm-svn: 131001
2011-05-06 18:14:32 +00:00
Rafael Espindola 20ce0c0ce0 Pass -disable-cfi to llc.
llvm-svn: 130999
2011-05-06 18:01:58 +00:00
Jakob Stoklund Olesen f8da028895 Update LiveDebugVariables after live range splitting.
After a virtual register is split, update any debug user variables that resided
in the old register. This ensures that the LiveDebugVariables are still correct
after register allocation.

This may create DBG_VALUE instructions that place a user variable in a register
in parts of the function and in a stack slot in other parts. DwarfDebug
currently doesn't support that.

llvm-svn: 130998
2011-05-06 18:00:02 +00:00
Jakob Stoklund Olesen c86fe05923 Use TargetMachine hooks to properly print debug variable locations.
llvm-svn: 130997
2011-05-06 17:59:59 +00:00
Jakob Stoklund Olesen 6cc4e4ddd0 Also count identity copies.
llvm-svn: 130996
2011-05-06 17:59:57 +00:00
Rafael Espindola ac893d6898 Pass -disable-cfi.
llvm-svn: 130995
2011-05-06 17:44:58 +00:00
Andrew Trick aab77fe574 Post-RA scheduler compile time fix. Quadratic computation of DAG node depth.
The post-ra scheduler was explicitly updating the depth of a node's
successors after scheduling it, regardless of whether the successor
was ready. This is quadratic for DAGs with transitively redundant
edges. I simply removed the useless update of depth, which is lazilly
computed later.
Fixes <rdar://problem/9044332> compiler takes way too long to build TextInput.

llvm-svn: 130992
2011-05-06 17:09:08 +00:00
Devang Patel 17b532728b Move CompileUnit::getOrCreateNameSpace() and CompileUnit::addPubType() from DwarfDebug.cpp to DwarfCompileUnit.cpp
llvm-svn: 130991
2011-05-06 16:57:54 +00:00
Rafael Espindola 705d25a1f4 Nothing else uses this label.
llvm-svn: 130989
2011-05-06 15:44:29 +00:00
Rafael Espindola 6e4fa20efb Yet more dead code.
llvm-svn: 130988
2011-05-06 15:31:55 +00:00
Rafael Espindola d06c2c1b81 Update comments.
llvm-svn: 130987
2011-05-06 15:28:56 +00:00
Rafael Espindola 4bfa978ca5 More dead code elimination.
llvm-svn: 130985
2011-05-06 15:22:26 +00:00
Rafael Espindola a716096677 Dead code elimination.
llvm-svn: 130984
2011-05-06 14:56:22 +00:00
Justin Holewinski 11d70b6b32 PTX: add PTX 2.3 language target
Patch by Wei-Ren Chen

llvm-svn: 130980
2011-05-06 11:40:36 +00:00
Duncan Sands a071c82900 Fix PR9820: a read-only call differs from a load in that a load doesn't
return the pointer being dereferenced, it returns the pointee, but a call
might return the pointer itself.

llvm-svn: 130979
2011-05-06 10:30:37 +00:00
Eli Friedman 5401962643 Re-revert r130877; it's apparently causing a regression on 197.parser,
possibly related to cbnz formation.

llvm-svn: 130977
2011-05-06 05:23:07 +00:00
Nick Lewycky a7028848a1 The computation of string length is not that complicated. Fix it, again. :)
llvm-svn: 130967
2011-05-05 23:52:18 +00:00
Rafael Espindola bb237c72a6 Remove DwarfTableException.
llvm-svn: 130964
2011-05-05 23:19:54 +00:00
Rafael Espindola ec0a3a0bbf Remove the DwarfTable enum.
llvm-svn: 130959
2011-05-05 22:14:31 +00:00
Devang Patel 1ff74141bf In debug output, clearly list new instructions without DebugLoc.
llvm-svn: 130957
2011-05-05 22:05:57 +00:00
Devang Patel d6141e1db2 Remove little used statistical counter.
llvm-svn: 130955
2011-05-05 22:00:08 +00:00
Eli Friedman 8a20e66926 PR9838: Fix transform introduced in r127064 to not trigger when only one side of the icmp is an exact shift.
llvm-svn: 130954
2011-05-05 21:59:18 +00:00
Rafael Espindola bc8e3f8c45 Move PPC Linux to CFI.
llvm-svn: 130951
2011-05-05 21:34:33 +00:00
Nick Lewycky d58fe3c55e Fix typo. No functional change.
llvm-svn: 130949
2011-05-05 21:27:14 +00:00
Rafael Espindola 59b6bfdbc6 Implement a really simple DwarfSjLjException.
llvm-svn: 130947
2011-05-05 20:48:31 +00:00
Rafael Espindola 240c96e2ca List all exception types in a switch.
llvm-svn: 130944
2011-05-05 19:48:34 +00:00
Andrew Trick 3dc73aae5e 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.

llvm-svn: 130943
2011-05-05 19:32:21 +00:00
Andrew Trick 24b1c48514 whitespace
llvm-svn: 130942
2011-05-05 19:24:06 +00:00
Rafael Espindola a4982bddf3 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.

llvm-svn: 130937
2011-05-05 18:43:39 +00:00
Galina Kistanova b93a130120 Many LLVM tests relies on standard output stream be in the binary mode. Which is not always the case (on Windows in particular). The patch adds a test to verify that the standard output stream is actually in the binary mode.
llvm-svn: 130936
2011-05-05 18:40:27 +00:00
Owen Anderson 68b6b0efb0 Allow FastISel of three-register-operand instructions.
llvm-svn: 130934
2011-05-05 17:59:04 +00:00
Devang Patel 73bc172493 If debug info for inlined function is missing then handle it gracefully.
llvm-svn: 130933
2011-05-05 17:54:26 +00:00
Eli Friedman f1e2b50a30 PR9848: pandn is not commutative.
No test because I can't think of any way to write one that won't break quickly.

llvm-svn: 130932
2011-05-05 17:45:31 +00:00
Jakob Stoklund Olesen c5a8c08dba Add some statistics to the splitting and spilling frameworks.
llvm-svn: 130931
2011-05-05 17:22:53 +00:00
Eli Friedman 441a01a2b8 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 .
llvm-svn: 130928
2011-05-05 16:53:34 +00:00
Jakob Stoklund Olesen f118fae233 Fix test to be less sensitive to coalescing.
This should unbreak llvm-gcc-i386-linux-selfhost.

llvm-svn: 130927
2011-05-05 16:48:00 +00:00
Eli Friedman fd8c6adffb Small syntax cleanup; we don't need to #define constants in C++. No functionality change intended.
llvm-svn: 130926
2011-05-05 16:25:23 +00:00
Eli Friedman 2311bdfa7b Minor correction to r130877; fixes PR9846 and hopefully the buildbot failures.
llvm-svn: 130925
2011-05-05 16:18:11 +00:00
Hongbin Zheng cd5afc5feb Minor change: Fix the typo in RegionPass.h and RegionPass.cpp.
llvm-svn: 130920
2011-05-05 13:59:38 +00:00
Bill Wendling a48b1375df 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>

llvm-svn: 130918
2011-05-05 06:49:15 +00:00
Mikhail Glushenkov fdc5d84ba3 llvmc: Make 'true' and 'false' instances of a 'Bool' class.
llvm-svn: 130915
2011-05-05 04:25:03 +00:00
Mikhail Glushenkov 67ebd94a5d llvmc: Make it possible to provide an argument to (join).
llvm-svn: 130914
2011-05-05 04:24:58 +00:00
Nick Lewycky 4f9c367f0b Update the gcov version used slightly, to make it stop causing modern gcov's to
crash.

llvm-svn: 130911
2011-05-05 02:46:38 +00:00
Nick Lewycky baa878ce4a Remove dead function.
llvm-svn: 130903
2011-05-05 00:17:34 +00:00
Nick Lewycky a3d5d167a8 When the path wasn't emitted by the frontend, discard any path on the source
filename.

llvm-svn: 130897
2011-05-05 00:03:30 +00:00