oota-llvm.git
13 years agoObey the isVolatile bit on memory intrinsics when analyzing uses of a global
Nick Lewycky [Sun, 29 May 2011 18:41:56 +0000 (18:41 +0000)]
Obey the isVolatile bit on memory intrinsics when analyzing uses of a global
variable. Noticed by inspection.

Simulate memset in EvaluateFunction where the target of the memset and the
value we're setting are both the null value. Fixes PR10047!

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

13 years agoFix warnings due to 132263; Thanks rdivacky.
Nadav Rotem [Sun, 29 May 2011 08:10:47 +0000 (08:10 +0000)]
Fix warnings due to 132263; Thanks rdivacky.

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

13 years agoWhen generating against the Win64 EH scheme, set the handler to the GCC-specific
Charles Davis [Sun, 29 May 2011 04:28:35 +0000 (04:28 +0000)]
When generating against the Win64 EH scheme, set the handler to the GCC-specific
handler.

At this moment, only GCC-style exceptions are supported. Other kinds
of exceptions, including "traditional" SEH and Microsoft Visual C++ exceptions,
need more work--and an compiler exception model that isn't specific to
GCC-style exceptions!

In particular, I imagine that it would be possible to mix "traditional" SEH
with GCC-style EH or Microsoft C++ EH. Currently LLVM has no way (beyond some
target-specific defaults and whole-module compiler switches) of knowing which
scheme to use when.

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

13 years agoUse %rbp on a 64 bit test.
Rafael Espindola [Sun, 29 May 2011 04:04:50 +0000 (04:04 +0000)]
Use %rbp on a 64 bit test.

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

13 years agoFix to match the dwarf register numbers that gdb uses.
Rafael Espindola [Sun, 29 May 2011 03:58:16 +0000 (03:58 +0000)]
Fix to match the dwarf register numbers that gdb uses.

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

13 years agoDwarf register 0 is r0, remove incorrect entries.
Rafael Espindola [Sun, 29 May 2011 03:17:01 +0000 (03:17 +0000)]
Dwarf register 0 is r0, remove incorrect entries.

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

13 years agoFix this to work correctly with phis; test case to follow if this successfully
John McCall [Sun, 29 May 2011 03:01:09 +0000 (03:01 +0000)]
Fix this to work correctly with phis;  test case to follow if this successfully
fixes self-host.

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

13 years agoRemove the dwarf numbers from the D registers. They don't have dwarf numbers
Rafael Espindola [Sun, 29 May 2011 02:21:01 +0000 (02:21 +0000)]
Remove the dwarf numbers from the D registers. They don't have dwarf numbers
and should probably be encoded as

DW_OP_reg 32 DW_OP_piece 4 DW_OP_reg 33

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

13 years agoFix ARM fast isel to correctly flag memory operands to stores. This fixes
Cameron Zwarich [Sat, 28 May 2011 20:34:49 +0000 (20:34 +0000)]
Fix ARM fast isel to correctly flag memory operands to stores. This fixes
-verify-machineinstrs failures on several tests.

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

13 years agoRefactor the type legalizer. Switch TargetLowering to a new enum - LegalizeTypeAction.
Nadav Rotem [Sat, 28 May 2011 17:57:14 +0000 (17:57 +0000)]
Refactor the type legalizer. Switch TargetLowering to a new enum - LegalizeTypeAction.
This patch does not change the behavior of the type legalizer. The codegen
produces the same code.
This infrastructural change is needed in order to enable complex decisions
for vector types (needed by the vector-select patch).

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

13 years agoErase instructions _after_ checking their type.
Benjamin Kramer [Sat, 28 May 2011 11:48:37 +0000 (11:48 +0000)]
Erase instructions _after_ checking their type.

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

13 years agoMove ARM specific test into the ARM subdir.
Benjamin Kramer [Sat, 28 May 2011 11:01:30 +0000 (11:01 +0000)]
Move ARM specific test into the ARM subdir.

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

13 years agoConstantFoldInstOperands doesn't like compares, hand it off to instsimplify instead.
Benjamin Kramer [Sat, 28 May 2011 10:16:58 +0000 (10:16 +0000)]
ConstantFoldInstOperands doesn't like compares, hand it off to instsimplify instead.

Fixes PR10040.

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

13 years agoImplement and document the llvm.eh.resume intrinsic, which is
John McCall [Sat, 28 May 2011 07:45:59 +0000 (07:45 +0000)]
Implement and document the llvm.eh.resume intrinsic, which is
transformed by the inliner into a branch to the enclosing landing pad
(when inlined through an invoke).  If not so optimized, it is lowered
DWARF EH preparation into a call to _Unwind_Resume (or _Unwind_SjLj_Resume
as appropriate).  Its chief advantage is that it takes both the
exception value and the selector value as arguments, meaning that there
is zero effort in recovering these;  however, the frontend is required
to pass these down, which is not actually particularly difficult.

Also document the behavior of landing pads a bit better, and make it
clearer that it's okay that personality functions don't always land at
landing pads.  This is just a fact of life.  Don't write optimizations that
rely on pushing things over an unwind edge.

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

13 years agoChange how tblgen generates attributes for intrinsics to use a single
John McCall [Sat, 28 May 2011 06:31:34 +0000 (06:31 +0000)]
Change how tblgen generates attributes for intrinsics to use a single
switch.  With this newfound organization, teach tblgen how not to give
all intrinsics the 'nounwind' attribute.  Introduce a new intrinsic,
llvm.eh.resume, which does not have this attribute.  Documentation and uses
to follow.

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

13 years agoWhen generating code for Win64 EH, emit StartProc and EndProc directives.
Charles Davis [Sat, 28 May 2011 04:21:04 +0000 (04:21 +0000)]
When generating code for Win64 EH, emit StartProc and EndProc directives.

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

13 years agoAdd support for ARM ldrexd/strexd intrinsics. They both use i32 register pairs
Bruno Cardoso Lopes [Sat, 28 May 2011 04:07:29 +0000 (04:07 +0000)]
Add support for ARM ldrexd/strexd intrinsics. They both use i32 register pairs
to load/store i64 values. Since there's no current support to explicitly
declare such restrictions, implement it by using specific hardcoded register
pairs during isel.

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

13 years agoThis actually starts at offset 0, not 1.
Eric Christopher [Sat, 28 May 2011 03:16:22 +0000 (03:16 +0000)]
This actually starts at offset 0, not 1.

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

13 years agoCreate two BlockInfo entries when a live range is discontinuous through a block.
Jakob Stoklund Olesen [Sat, 28 May 2011 02:33:00 +0000 (02:33 +0000)]
Create two BlockInfo entries when a live range is discontinuous through a block.

Delete the Kill and Def markers in BlockInfo. They are no longer
necessary when BlockInfo describes a continuous live range.

This only affects the relatively rare kind of basic block where a live
range looks like this:

 |---x   o---|

Now live range splitting can pretend that it is looking at two blocks:

 |---x
         o---|

This allows the code to be simplified a bit.

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

13 years agoAdd SplitAnalysis::getNumLiveBlocks().
Jakob Stoklund Olesen [Sat, 28 May 2011 02:32:57 +0000 (02:32 +0000)]
Add SplitAnalysis::getNumLiveBlocks().

It is important that this function returns the same number of live blocks as
countLiveBlocks(CurLI) because live range splitting uses the number of live
blocks to ensure it is making progress.

This is in preparation of supporting duplicate UseBlock entries for basic blocks
that have a virtual register live-in and live-out, but not live-though.

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

13 years agoChange the set of callee-saved registers for non-MIPS32 architectures specified
Akira Hatanaka [Sat, 28 May 2011 01:41:05 +0000 (01:41 +0000)]
Change the set of callee-saved registers for non-MIPS32 architectures specified
in MipsRegisterInfo::getCalleeSavedRegs so that both registers paired for a
double precision register get saved.

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

13 years agoImplement the 'M' output modifier for arm inline asm. This is fairly
Eric Christopher [Sat, 28 May 2011 01:40:44 +0000 (01:40 +0000)]
Implement the 'M' output modifier for arm inline asm. This is fairly
register allocation dependent and will occasionally break. WIP in the
register allocator to model paired/etc registers.

rdar://9119939

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

13 years agoAdd missing newlines.
Chad Rosier [Sat, 28 May 2011 01:35:58 +0000 (01:35 +0000)]
Add missing newlines.

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

13 years agoDefine a wrapper node for target constant nodes (tglobaladdr, etc.).
Akira Hatanaka [Sat, 28 May 2011 01:07:07 +0000 (01:07 +0000)]
Define a wrapper node for target constant nodes (tglobaladdr, etc.).
Need this to prevent emitting illegal conditional move instructions.

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

13 years agoSelect DW_AT_const_value size based on global variable size.
Devang Patel [Sat, 28 May 2011 00:39:18 +0000 (00:39 +0000)]
Select DW_AT_const_value size based on global variable size.

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

13 years agoAdd 132187 back now that the real problem is fixed.
Rafael Espindola [Sat, 28 May 2011 00:24:37 +0000 (00:24 +0000)]
Add 132187 back now that the real problem is fixed.

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

13 years agoFix test cases that were previously using grep to use FileCheck
Chad Rosier [Sat, 28 May 2011 00:15:10 +0000 (00:15 +0000)]
Fix test cases that were previously using grep to use FileCheck

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

13 years agoFix the root cause of the bootstrap failure:
Rafael Espindola [Sat, 28 May 2011 00:13:01 +0000 (00:13 +0000)]
Fix the root cause of the bootstrap failure:

There was no way to check if a given register/mode pair was valid. We now return
an error code (-2) instead of asserting. If anyone thinks that an assert
at this point  is really needed, we can autogen a hasValidDwarfRegNum instead.

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

13 years agoFix the remaining atomic intrinsics to use the right register classes on Thumb2,
Cameron Zwarich [Fri, 27 May 2011 23:54:00 +0000 (23:54 +0000)]
Fix the remaining atomic intrinsics to use the right register classes on Thumb2,
and add some basic tests for them.

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

13 years agoStub out support for Win64-style exceptions. Note that this is merely using
Charles Davis [Fri, 27 May 2011 23:47:32 +0000 (23:47 +0000)]
Stub out support for Win64-style exceptions. Note that this is merely using
the Win64 EH mechanism to implement GCC-style exceptions. LLVM supports
hardly anything else at this point!

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

13 years agoARM asm parser wasn't able to parse a "mov" instruction while in Thumb
Bruno Cardoso Lopes [Fri, 27 May 2011 23:46:09 +0000 (23:46 +0000)]
ARM asm parser wasn't able to parse a "mov" instruction while in Thumb
mode (only the "mov.w" variant). Now, when parsing "mov" in thumb mode,
default to the Thumb 1 versions/encodings.

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

13 years agoIt looks like 132187 might have broken the llvm-gcc bootstrap. Revert while I check.
Rafael Espindola [Fri, 27 May 2011 23:36:02 +0000 (23:36 +0000)]
It looks like 132187 might have broken the llvm-gcc bootstrap. Revert while I check.

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

13 years agoForce a triple to make this test pass on Darwin.
Eli Friedman [Fri, 27 May 2011 23:12:48 +0000 (23:12 +0000)]
Force a triple to make this test pass on Darwin.

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

13 years agoClean out the 2.9 Release Notes. Mostly limited to What's New in LLVM
Chad Rosier [Fri, 27 May 2011 22:50:46 +0000 (22:50 +0000)]
Clean out the 2.9 Release Notes.  Mostly limited to What's New in LLVM
and enhancements in sub-project status updates.

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

13 years agoAdd a GR32_NOREX_NOSP register class and fix a bug where getMatchingSuperRegClass()
Cameron Zwarich [Fri, 27 May 2011 22:26:04 +0000 (22:26 +0000)]
Add a GR32_NOREX_NOSP register class and fix a bug where getMatchingSuperRegClass()
was saying that the matching superregister class of GR32_NOREX in GR64_NOREX_NOSP
is GR64_NOREX, which drops the NOSP constraint. This fixes PR10032.

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

13 years agoFix a regression I recently introduced by removing DwarfRegNum of
Rafael Espindola [Fri, 27 May 2011 22:15:01 +0000 (22:15 +0000)]
Fix a regression I recently introduced by removing DwarfRegNum of
subregisters:

When a value is in a subregister, at least report the location as being
the superregister. We should extend the .td files to encode the bit
range so that we can produce a DW_OP_bit_piece.

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

13 years agoMake size computation less brittle.
Rafael Espindola [Fri, 27 May 2011 22:05:41 +0000 (22:05 +0000)]
Make size computation less brittle.

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

13 years agoAdd the suffix to the Win64 EH data sections' names if given. Add a test for
Charles Davis [Fri, 27 May 2011 21:38:47 +0000 (21:38 +0000)]
Add the suffix to the Win64 EH data sections' names if given. Add a test for
this. XFAIL'd, because the COFF AsmParser can't handle .section yet.

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

13 years agoRefactor getActionType and getTypeToTransformTo ; place all of the 'decision'
Nadav Rotem [Fri, 27 May 2011 21:03:13 +0000 (21:03 +0000)]
Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
code in one place. Re-apply 131534 and fix the multi-step promotion of integers.

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

13 years agoAttempt to preserve debug line info in LICM; as the comment in the code says, it...
Eli Friedman [Fri, 27 May 2011 20:31:51 +0000 (20:31 +0000)]
Attempt to preserve debug line info in LICM; as the comment in the code says, it's hard to pick good line numbers for this transformation, but something is better than nothing.

rdar://9143729

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

13 years agoTypo is test case
Chad Rosier [Fri, 27 May 2011 20:16:57 +0000 (20:16 +0000)]
Typo is test case

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

13 years agoMake room for register allocation to improve.
Jakob Stoklund Olesen [Fri, 27 May 2011 20:15:06 +0000 (20:15 +0000)]
Make room for register allocation to improve.

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

13 years agoAdd change of crc32 intrinsic to release notes
Chad Rosier [Fri, 27 May 2011 20:13:10 +0000 (20:13 +0000)]
Add change of crc32 intrinsic to release notes

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

13 years agoDon't use movw / movt for iOS static codegen for now to workaround some tools issues...
Evan Cheng [Fri, 27 May 2011 20:11:27 +0000 (20:11 +0000)]
Don't use movw / movt for iOS static codegen for now to workaround some tools issues. rdar://9514789

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

13 years agoDelete a test that is no longer relevant.
Jakob Stoklund Olesen [Fri, 27 May 2011 20:02:42 +0000 (20:02 +0000)]
Delete a test that is no longer relevant.

According to PR2536, the old spiller had trouble with the IMPLICIT_DEF in this
code:

  %reg1028<def> = MOV16rm %reg0, 1, %reg0, <ga:g_5>, Mem:LD(2,2) [g_5 + 0]
  %reg1039<def> = IMPLICIT_DEF
  %reg1038<def> = INSERT_SUBREG %reg1039, %reg1028, 2
  %reg1025<def> = AND32ri %reg1038, 65534, %%EFLAGS<imp-def>

However, today we emit a zero-extending load instead:

  %vreg10<def> = MOVZX32rm16 %noreg, 1, %noreg, <ga:@g_5>, %noreg; %mem:LD2[@g_5] GR32:%vreg10
  %vreg0<def> = AND32ri %vreg10, 65534, %%EFLAGS<imp-def,dead>; %GR32:%vreg0,%vreg10

This makes the test pointless since it no longer creates the spiller hazard.

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

13 years agoCRC32 intrinsics were renamed at revision 132163. This submission
Chad Rosier [Fri, 27 May 2011 19:38:10 +0000 (19:38 +0000)]
CRC32 intrinsics were renamed at revision 132163.  This submission
fixes aliasing issues with the old and new names as well as adds test
cases for the auto-upgrader.
Fixes rdar 9472944.

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

13 years agoKeep this simple. Use DIType to get signness and size of a type. Based on size, selec...
Devang Patel [Fri, 27 May 2011 19:13:26 +0000 (19:13 +0000)]
Keep this simple. Use DIType to get signness and size of a type. Based on size, select appropraite form.

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

13 years agoAdd a parameter to the Win64 EH section getters to get a section with a
Charles Davis [Fri, 27 May 2011 19:09:24 +0000 (19:09 +0000)]
Add a parameter to the Win64 EH section getters to get a section with a
suffix (e.g. .xdata$myfunc). The suffix part isn't implemented yet, but
I'll get to it in the next patch.

Fix up all callers of the affected functions. Make them pass said suffix to
the function.

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

13 years agoAdd iOS test
Evan Cheng [Fri, 27 May 2011 19:04:21 +0000 (19:04 +0000)]
Add iOS test

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

13 years agoUpdate this comment.
Dan Gohman [Fri, 27 May 2011 18:42:33 +0000 (18:42 +0000)]
Update this comment.

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

13 years agoDon't sink or hoist debug info instrinsics; it isn't useful. This also prevents...
Eli Friedman [Fri, 27 May 2011 18:37:52 +0000 (18:37 +0000)]
Don't sink or hoist debug info instrinsics; it isn't useful.  This also prevents LICM sinking from erasing debug intrinsics which don't dominate any exit block of the loop.

rdar://9143943 .

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

13 years agoFix the inliner to maintain the current de facto invoke semantics:
John McCall [Fri, 27 May 2011 18:34:38 +0000 (18:34 +0000)]
Fix the inliner to maintain the current de facto invoke semantics:
  - the selector for the landing pad must provide all available information
    about the handlers, filters, and cleanups within that landing pad
  - calls to _Unwind_Resume must be converted to branches to the enclosing
    lpad so as to avoid re-entering the unwinder when the lpad claimed it
    was going to handle the exception in some way
This is quite specific to libUnwind-based unwinding.  In an effort to not
interfere too badly with other unwinders, and with existing hacks in frontends,
this only triggers on _Unwind_Resume (not _Unwind_Resume_or_Rethrow) and does
nothing with selectors if it cannot find a selector call for either lpad.

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

13 years agoDelete MethodBodies that only filtered reserved registers.
Jakob Stoklund Olesen [Fri, 27 May 2011 18:27:13 +0000 (18:27 +0000)]
Delete MethodBodies that only filtered reserved registers.

The register allocators know to filter reserved registers from the allocation
orders, so we don't need all of this boilerplate.

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

13 years agoHandle signed types gracefully.
Devang Patel [Fri, 27 May 2011 18:15:52 +0000 (18:15 +0000)]
Handle signed types gracefully.
This fixes regressions reported by buildbots as a fallout of r132193.

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

13 years agoAnd fix the test in r132194.
Eli Friedman [Fri, 27 May 2011 18:14:28 +0000 (18:14 +0000)]
And fix the test in r132194.

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

13 years agoOops, wasn't intending to commit this. Partial revert of r132194.
Eli Friedman [Fri, 27 May 2011 18:04:04 +0000 (18:04 +0000)]
Oops, wasn't intending to commit this.  Partial revert of r132194.

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

13 years agoFix a silly mistake (which trips over an assertion) in r132099. rdar://9515076
Eli Friedman [Fri, 27 May 2011 18:02:04 +0000 (18:02 +0000)]
Fix a silly mistake (which trips over an assertion) in r132099.  rdar://9515076

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

13 years agoSelect DW_AT_const_value size based on variable size.
Devang Patel [Fri, 27 May 2011 16:45:18 +0000 (16:45 +0000)]
Select DW_AT_const_value size based on variable size.

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

13 years agoRemove DwarfRegNum from the individual bits of the condition register.
Rafael Espindola [Fri, 27 May 2011 16:15:27 +0000 (16:15 +0000)]
Remove DwarfRegNum from the individual bits of the condition register.
These should be DW_OP_bit_piece of CR (64).

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

13 years agoRemove DwarfRegNum from CARRY. I should be encoded with DW_OP_bit_piece.
Rafael Espindola [Fri, 27 May 2011 16:01:08 +0000 (16:01 +0000)]
Remove DwarfRegNum from CARRY. I should be encoded with DW_OP_bit_piece.

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

13 years agoAssorted fixes for Win64 EH unwind info emission:
Charles Davis [Fri, 27 May 2011 15:10:25 +0000 (15:10 +0000)]
Assorted fixes for Win64 EH unwind info emission:
- Flip order of bitfields. This gets our output matching GAS.
- Handle case where the end of the prolog wasn't specified.
- If the resulting unwind info struct is less than 8 bytes, pad to 8 bytes.

Add a test for the latter two.

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

13 years agoRemove dwarf numbers from subregs. We should use DW_OP_bit_piece to
Rafael Espindola [Fri, 27 May 2011 15:08:24 +0000 (15:08 +0000)]
Remove dwarf numbers from subregs. We should use DW_OP_bit_piece to
refer to them.

I tested this with both check-all and the gdb testsuite.

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

13 years agoInstCombine: Make switch folding with equality compares more aggressive by trying...
Benjamin Kramer [Fri, 27 May 2011 13:00:16 +0000 (13:00 +0000)]
InstCombine: Make switch folding with equality compares more aggressive by trying instsimplify on the arm where we know the compared value.

Stuff like "x == y ? y : x&y" now folds into "x&y".

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

13 years agoFix PR10029 - VerifyCoalescing failure on patterns_dfa.c of 445.gobmk.
Cameron Zwarich [Fri, 27 May 2011 05:04:51 +0000 (05:04 +0000)]
Fix PR10029 - VerifyCoalescing failure on patterns_dfa.c of 445.gobmk.

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

13 years agoAdd a test for Win64 EH unwind information emission.
Charles Davis [Fri, 27 May 2011 03:54:43 +0000 (03:54 +0000)]
Add a test for Win64 EH unwind information emission.

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

13 years agoMake the branch encoding for tBcc more obvious that it's a 4-byte opcode
Eric Christopher [Fri, 27 May 2011 03:50:53 +0000 (03:50 +0000)]
Make the branch encoding for tBcc more obvious that it's a 4-byte opcode
followed by a conditional and imm8.

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

13 years agoFix comment.
Eric Christopher [Fri, 27 May 2011 03:46:51 +0000 (03:46 +0000)]
Fix comment.

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

13 years agoStart keeping track of where the various unwind instructions are in the prolog.
Charles Davis [Fri, 27 May 2011 03:25:01 +0000 (03:25 +0000)]
Start keeping track of where the various unwind instructions are in the prolog.
Use them to calculate the offset inside the prolog. Emit this value when
emitting the unwind codes.

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

13 years agoAdd missing break statements. Align UNWIND_INFO and RUNTIME_FUNCTION structs
Charles Davis [Fri, 27 May 2011 02:43:19 +0000 (02:43 +0000)]
Add missing break statements. Align UNWIND_INFO and RUNTIME_FUNCTION structs
to 4 bytes.

I'm surprised no one caught the missing break statements.

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

13 years agoMy attempt at fixing the leak reported by the valgrind buildbots. Valgrind will
Charles Davis [Fri, 27 May 2011 02:01:08 +0000 (02:01 +0000)]
My attempt at fixing the leak reported by the valgrind buildbots. Valgrind will
still report leaks, but they're spurious now. Valgrind cannot peer into
std::vector objects--or any dynamic array, for that matter--because it doesn't
know how big the array is.

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

13 years agoFix inverted conditional in SaveReg and SaveXMM. Err when the frame pointer is
Charles Davis [Fri, 27 May 2011 01:42:17 +0000 (01:42 +0000)]
Fix inverted conditional in SaveReg and SaveXMM. Err when the frame pointer is
already defined, and err when the PushMachFrame operation isn't the first
operation (if specified at all).

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

13 years agoOne more debug line number miss in instcombine (although the code in question isn...
Eli Friedman [Fri, 27 May 2011 01:00:36 +0000 (01:00 +0000)]
One more debug line number miss in instcombine (although the code in question isn't actually in instcombine).

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

13 years agoFix copy+pastos.
Dan Gohman [Fri, 27 May 2011 00:36:31 +0000 (00:36 +0000)]
Fix copy+pastos.

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

13 years agoFinal step of instcombine debuginfo; switch a couple more places over to InsertNewIns...
Eli Friedman [Fri, 27 May 2011 00:19:40 +0000 (00:19 +0000)]
Final step of instcombine debuginfo; switch a couple more places over to InsertNewInstWith, and use setDebugLoc for the cases which can't be easily handled by the automated mechanisms.

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

13 years agoFix warning about || and && without explicit grouping.
Chandler Carruth [Thu, 26 May 2011 23:37:58 +0000 (23:37 +0000)]
Fix warning about || and && without explicit grouping.

This looks like it flagged an actual bug. Devang, please review. I added
the parentheses that change behavior, but make the behavior more closely
match commit log's intent.

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

13 years agoDo not insert anything after terminator.
Devang Patel [Thu, 26 May 2011 23:16:48 +0000 (23:16 +0000)]
Do not insert anything after terminator.

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

13 years agoRenamed llvm.x86.sse42.crc32 intrinsics; crc64 doesn't exist.
Chad Rosier [Thu, 26 May 2011 23:13:19 +0000 (23:13 +0000)]
Renamed llvm.x86.sse42.crc32 intrinsics; crc64 doesn't exist.
crc32.[8|16|32] have been renamed to .crc32.32.[8|16|32] and
crc64.[8|16|32] have been renamed to .crc32.64.[8|64].

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

13 years agoComment cleanup.
Eric Christopher [Thu, 26 May 2011 22:54:27 +0000 (22:54 +0000)]
Comment cleanup.

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

13 years agoDo not move DBG_VALUE in middle of PHI nodes.
Devang Patel [Thu, 26 May 2011 22:43:14 +0000 (22:43 +0000)]
Do not move DBG_VALUE in middle of PHI nodes.

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

13 years agoIf llvm.dbg.value and the value instruction it refers to are far apart then iSel...
Devang Patel [Thu, 26 May 2011 21:51:06 +0000 (21:51 +0000)]
If llvm.dbg.value and the value instruction it refers to are far apart then iSel may not be able to find corresponding Node for llvm.dbg.value during DAG construction. Make iSel's life easier by removing this distance between llvm.dbg.value and its value instruction.

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

13 years agoAdd comment.
Devang Patel [Thu, 26 May 2011 21:49:28 +0000 (21:49 +0000)]
Add comment.

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

13 years agoDuring branch folding avoid inserting redundant DBG_VALUE machine instructions.
Devang Patel [Thu, 26 May 2011 21:47:59 +0000 (21:47 +0000)]
During branch folding avoid inserting redundant DBG_VALUE machine instructions.

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

13 years agoUse MachineFrameInfo::hasCalls instead of MipsFunctionInfo::hasCall to check if
Akira Hatanaka [Thu, 26 May 2011 20:30:31 +0000 (20:30 +0000)]
Use MachineFrameInfo::hasCalls instead of MipsFunctionInfo::hasCall to check if
a function has any function calls.

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

13 years agoFix some dwarf register numbers.
Rafael Espindola [Thu, 26 May 2011 19:25:47 +0000 (19:25 +0000)]
Fix some dwarf register numbers.

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

13 years agoMake few ExecutionEngine tests XFAIL for ARM, since ExecutionEngine is broken for...
Galina Kistanova [Thu, 26 May 2011 19:17:14 +0000 (19:17 +0000)]
Make few ExecutionEngine tests XFAIL for ARM, since ExecutionEngine is broken for ARM, please remove the following XFAIL when it will be fixed.

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

13 years agoFix LTO builds with xcode 4.
Rafael Espindola [Thu, 26 May 2011 18:59:54 +0000 (18:59 +0000)]
Fix LTO builds with xcode 4.

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

13 years agoAdd support for C++ exception handling.
Akira Hatanaka [Thu, 26 May 2011 18:59:03 +0000 (18:59 +0000)]
Add support for C++ exception handling.

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

13 years agoReorganize these slightly according to operand type.
Eric Christopher [Thu, 26 May 2011 18:22:26 +0000 (18:22 +0000)]
Reorganize these slightly according to operand type.

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

13 years agoSet HasSetDirective to true.
Akira Hatanaka [Thu, 26 May 2011 18:16:18 +0000 (18:16 +0000)]
Set HasSetDirective to true.

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

13 years agoFix test on Windows.
Eli Friedman [Thu, 26 May 2011 18:00:32 +0000 (18:00 +0000)]
Fix test on Windows.

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

13 years agoRevert r132111. I built Release (without Asserts), so I didn't know about the
Charles Davis [Thu, 26 May 2011 05:35:55 +0000 (05:35 +0000)]
Revert r132111. I built Release (without Asserts), so I didn't know about the
assert that prevented setting alignment on section creation.

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

13 years agoFix definitions of UOP_SaveXMM128, UOP_SaveXMM128Big, and UOP_PushMachFrame
Charles Davis [Thu, 26 May 2011 05:24:15 +0000 (05:24 +0000)]
Fix definitions of UOP_SaveXMM128, UOP_SaveXMM128Big, and UOP_PushMachFrame
to match Microsoft's definitions.

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

13 years agoAlign Win64 EH Table sections to 4 bytes.
Charles Davis [Thu, 26 May 2011 05:19:54 +0000 (05:19 +0000)]
Align Win64 EH Table sections to 4 bytes.

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

13 years agoAdd a test for the chained directives that I forgot last time.
Charles Davis [Thu, 26 May 2011 05:17:43 +0000 (05:17 +0000)]
Add a test for the chained directives that I forgot last time.

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

13 years agoFix MSVC warning regarding mkdir function usage.
Francois Pichet [Thu, 26 May 2011 04:55:20 +0000 (04:55 +0000)]
Fix MSVC warning regarding mkdir function usage.

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

13 years agoReverting 132105: it broke some LLVM-GCC DejaGNU tests.
Stuart Hastings [Thu, 26 May 2011 04:09:49 +0000 (04:09 +0000)]
Reverting 132105: it broke some LLVM-GCC DejaGNU tests.

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

13 years agoMark tBX as an indirect branch rather than a return.
Cameron Zwarich [Thu, 26 May 2011 03:41:12 +0000 (03:41 +0000)]
Mark tBX as an indirect branch rather than a return.

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

13 years agoTest .seh_startchained and .seh_endchained parsing.
Charles Davis [Thu, 26 May 2011 02:45:47 +0000 (02:45 +0000)]
Test .seh_startchained and .seh_endchained parsing.

Rework how the MCWin64EHUnwindInfo instances are stored. Fix issues with
chained unwind areas exposed by the test that were related to this.

The ChainedParent field had the wrong address, because when the chained unwind
info was added, the addresses shifted around. Now we store the pointers to the
structures, which are now allocated from the MC heap.

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

13 years agoCorrectly handle a one-word struct passed byval on x86_64.
Stuart Hastings [Thu, 26 May 2011 02:44:56 +0000 (02:44 +0000)]
Correctly handle a one-word struct passed byval on x86_64.
rdar://problem/6920088

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

13 years agoindvars: incremental fixes for -disable-iv-rewrite and testcases.
Andrew Trick [Thu, 26 May 2011 00:46:11 +0000 (00:46 +0000)]
indvars: incremental fixes for -disable-iv-rewrite and testcases.

Use a proper worklist for use-def traversal without holding onto an
iterator. Now that we process all IV uses, we need complete logic for
resusing existing derived IV defs. See HoistStep.

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