oota-llvm.git
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

13 years agoAdd a RAGreedy::canEvict function.
Jakob Stoklund Olesen [Wed, 25 May 2011 23:58:36 +0000 (23:58 +0000)]
Add a RAGreedy::canEvict function.

This doesn't change functionality (much), but it allows for a more fine-grained
eviction policy. The current policy only compares spill weights, and that is not
always the best thing to do.  Spill weights are designed to serve linear scan,
and they don't consider live range splitting.

Add a mechanism so canEvict() can request that a live range be evicted and
split/spilled. This is to avoid infinite eviction loops.

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

13 years agoRewrite fast-isel integer cast handling to handle more cases, and to be simpler and...
Eli Friedman [Wed, 25 May 2011 23:49:02 +0000 (23:49 +0000)]
Rewrite fast-isel integer cast handling to handle more cases, and to be simpler and more consistent.

The practical effects here are that x86-64 fast-isel can now handle trunc from i8 to i1, and ARM fast-isel can handle many more constructs involving integers narrower than 32 bits (including loads, stores, and many integer casts).

rdar://9437928 .

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

13 years agoDefine WeakRefDirective.
Akira Hatanaka [Wed, 25 May 2011 23:30:30 +0000 (23:30 +0000)]
Define WeakRefDirective.

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

13 years agoPR9998: ashr exact %x, 31 is not equivalent to sdiv exact %x, -2147483648.
Eli Friedman [Wed, 25 May 2011 23:26:20 +0000 (23:26 +0000)]
PR9998: ashr exact %x, 31 is not equivalent to sdiv exact %x, -2147483648.

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

13 years agoRemove unused statistical counter.
Devang Patel [Wed, 25 May 2011 21:55:40 +0000 (21:55 +0000)]
Remove unused statistical counter.

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

13 years agoConvert tBX_CALL / tBXr9_CALL to actual pseudoinstructions.
Cameron Zwarich [Wed, 25 May 2011 21:53:50 +0000 (21:53 +0000)]
Convert tBX_CALL / tBXr9_CALL to actual pseudoinstructions.

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

13 years agoAdd tests for .seh_setframe and .seh_handlerdata parsing. Fix issues with
Charles Davis [Wed, 25 May 2011 21:43:45 +0000 (21:43 +0000)]
Add tests for .seh_setframe and .seh_handlerdata parsing. Fix issues with
them.

I had to add a special SwitchSectionNoChange method to MCStreamer just for
.seh_handlerdata. If this isn't OK, please let me know, and I'll find some
other way to fix .seh_handlerdata streaming.

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

13 years agoClean up comment a bit.
Eric Christopher [Wed, 25 May 2011 21:19:19 +0000 (21:19 +0000)]
Clean up comment a bit.

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

13 years agoImplement the 'm' modifier. Note that it only works for memory operands.
Eric Christopher [Wed, 25 May 2011 20:51:58 +0000 (20:51 +0000)]
Implement the 'm' modifier. Note that it only works for memory operands.

Part of rdar://9119939

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

13 years agoRemove MipsTargetLowering::LowerFP_TO_SINT. Patterns for fp_to_sint have already
Akira Hatanaka [Wed, 25 May 2011 20:08:05 +0000 (20:08 +0000)]
Remove MipsTargetLowering::LowerFP_TO_SINT. Patterns for fp_to_sint have already
been defined in MipsInstrFPU.td.

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

13 years agoCustom-lower FCOPYSIGN nodes.
Akira Hatanaka [Wed, 25 May 2011 19:32:07 +0000 (19:32 +0000)]
Custom-lower FCOPYSIGN nodes.

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

13 years agoPrepare ARMFastISel::SelectSIToFP for getRegForValue returning registers for i8 and...
Eli Friedman [Wed, 25 May 2011 19:09:45 +0000 (19:09 +0000)]
Prepare ARMFastISel::SelectSIToFP for getRegForValue returning registers for i8 and i16 values.

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

13 years agoSimplify r132022 based on Cameron's feedback.
Evan Cheng [Wed, 25 May 2011 18:17:13 +0000 (18:17 +0000)]
Simplify r132022 based on Cameron's feedback.

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

13 years agoUpdate MaxCallFrameSize regardless of the relocation model selected.
Akira Hatanaka [Wed, 25 May 2011 18:08:32 +0000 (18:08 +0000)]
Update MaxCallFrameSize regardless of the relocation model selected.

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

13 years agoChange initial value of MaxCallFrameSize. MipsFI::getMaxCallFrameSize() should
Akira Hatanaka [Wed, 25 May 2011 17:52:48 +0000 (17:52 +0000)]
Change initial value of MaxCallFrameSize. MipsFI::getMaxCallFrameSize() should
return 0 if there are no function calls made.

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

13 years agoCoding style fixes. Added comments.
Akira Hatanaka [Wed, 25 May 2011 17:32:06 +0000 (17:32 +0000)]
Coding style fixes. Added comments.

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

13 years agoRemove unused OpcodeMask enumerator.
Francois Pichet [Wed, 25 May 2011 17:02:53 +0000 (17:02 +0000)]
Remove unused OpcodeMask enumerator.

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

13 years agoFix 3 MSVC warnings:
Francois Pichet [Wed, 25 May 2011 16:32:33 +0000 (16:32 +0000)]
Fix 3 MSVC warnings:
'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'

atexit really expects a "void f(void)" function.

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

13 years agoFix MSVC warning: "is out of range for enum constant"
Francois Pichet [Wed, 25 May 2011 15:58:10 +0000 (15:58 +0000)]
Fix MSVC warning: "is out of range for enum constant"
MSVC doesn't support 64 bit enum.
OpcodeMask is not used anywhere in the code base.

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

13 years agoFix some issues Duncan found in the previous commit.
Rafael Espindola [Wed, 25 May 2011 12:54:08 +0000 (12:54 +0000)]
Fix some issues Duncan found in the previous commit.

I kept the reference to the ABI since that is the common case. The
-fno-asynchronous-unwind-tables option is a user controlled way of breaking
the ABI.

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

13 years agoFix warning in the CMake build about redefining LLVM_PATH_XDOT_PY by making sure...
Frits van Bommel [Wed, 25 May 2011 06:32:23 +0000 (06:32 +0000)]
Fix warning in the CMake build about redefining LLVM_PATH_XDOT_PY by making sure both definitions are identical. This used to produce warnings like

In file included from .../llvm/trunk/tools/lto/LTOCodeGenerator.cpp:45:
In file included from .../llvm/trunk/include/llvm/Support/system_error.h:225:
.../include/llvm/Config/config.h:591:9: warning: 'LLVM_PATH_XDOT_PY' macro redefined
#define LLVM_PATH_XDOT_PY ".../bin/xdot.py"
        ^
.../include/llvm/Config/llvm-config.h:98:9: note: previous definition is here
#define LLVM_PATH_XDOT_PY ""
        ^
1 warning generated.

(Paths edited for clarity)

Note: This only affected people who had xdot.py installed.

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

13 years ago[tablegen] A couple of changes to ClangDiagnosticEmmitter.
Argyrios Kyrtzidis [Wed, 25 May 2011 05:04:22 +0000 (05:04 +0000)]
[tablegen] A couple of changes to ClangDiagnosticEmmitter.

-Emit an empty warning option as string ("") instead of 0.
-For diagnostic names also emit the size of the string.

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

13 years agoAdd tests for .seh_savereg and .seh_savexmm parsing. Once again, fix the
Charles Davis [Wed, 25 May 2011 04:51:25 +0000 (04:51 +0000)]
Add tests for .seh_savereg and .seh_savexmm parsing. Once again, fix the
buggy methods that parse these directives.

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

13 years agoRestore an accidentally removed comment.
Cameron Zwarich [Wed, 25 May 2011 04:48:17 +0000 (04:48 +0000)]
Restore an accidentally removed comment.

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

13 years agoMove some code to a more logical place.
Cameron Zwarich [Wed, 25 May 2011 04:45:29 +0000 (04:45 +0000)]
Move some code to a more logical place.

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

13 years agoMake tTAILJMPr/tTAILJMPrND emit a tBX without a preceding MOV of PC to LR. This
Cameron Zwarich [Wed, 25 May 2011 04:45:27 +0000 (04:45 +0000)]
Make tTAILJMPr/tTAILJMPrND emit a tBX without a preceding MOV of PC to LR. This
fixes <rdar://problem/9495913>

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

13 years agoChange the order of tBX's operands so that the predicate operands come after the
Cameron Zwarich [Wed, 25 May 2011 04:45:23 +0000 (04:45 +0000)]
Change the order of tBX's operands so that the predicate operands come after the
target register, matching BX. I filed this bug because I was confused at first:

PR10007 - ARM branch instructions have inconsistent predicate operand placement
<http://llvm.org/bugs/show_bug.cgi?id=10007>

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

13 years agoRename tBX_Rm to tBX.
Cameron Zwarich [Wed, 25 May 2011 04:45:20 +0000 (04:45 +0000)]
Rename tBX_Rm to tBX.

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

13 years agoRename the existing tBX/tBXr9 instructions to tBX_CALL/tBXr9_CALL to better
Cameron Zwarich [Wed, 25 May 2011 04:45:14 +0000 (04:45 +0000)]
Rename the existing tBX/tBXr9 instructions to tBX_CALL/tBXr9_CALL to better
reflect their actual meaning and match the ARM instructions.

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

13 years agoindvars: fixed IV cloning in -disable-iv-rewrite mode with associated
Andrew Trick [Wed, 25 May 2011 04:42:22 +0000 (04:42 +0000)]
indvars: fixed IV cloning in -disable-iv-rewrite mode with associated
cleanup and overdue test cases.

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

13 years agoAdd a test for .seh_pushframe parsing. Fix the bug exposed by it (and another
Charles Davis [Wed, 25 May 2011 04:08:15 +0000 (04:08 +0000)]
Add a test for .seh_pushframe parsing. Fix the bug exposed by it (and another
one I found by inspection).

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

13 years agoReplace the -unwind-tables option with a per function flag. This is more
Rafael Espindola [Wed, 25 May 2011 03:44:17 +0000 (03:44 +0000)]
Replace the -unwind-tables option with a per function flag. This is more
LTO friendly as we can now correctly merge files compiled with or without
-fasynchronous-unwind-tables.

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

13 years agoFix lowering of DYNAMIC_STACKALLOC nodes.
Akira Hatanaka [Wed, 25 May 2011 02:20:00 +0000 (02:20 +0000)]
Fix lowering of DYNAMIC_STACKALLOC nodes.

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

13 years agoAdd a test for the .seh_handler directive. Fix problems with the parsing
Charles Davis [Wed, 25 May 2011 01:33:42 +0000 (01:33 +0000)]
Add a test for the .seh_handler directive. Fix problems with the parsing
method exposed by the test. While we're at it, simplify the .seh_proc
parsing method.

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

13 years agoFix PR9762
Bruno Cardoso Lopes [Wed, 25 May 2011 00:35:03 +0000 (00:35 +0000)]
Fix PR9762
Enable the parsing of the operand "cpsr_all" for the ARM msr instruction

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

13 years agoForgot dyn_cast check.
Evan Cheng [Tue, 24 May 2011 23:47:50 +0000 (23:47 +0000)]
Forgot dyn_cast check.

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

13 years agoImplement the arm 'L' asm modifier.
Eric Christopher [Tue, 24 May 2011 23:27:13 +0000 (23:27 +0000)]
Implement the arm 'L' asm modifier.

Part of rdar://9119939

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

13 years agoImplement the immediate part of the 'B' modifier.
Eric Christopher [Tue, 24 May 2011 23:15:43 +0000 (23:15 +0000)]
Implement the immediate part of the 'B' modifier.

Part of rdar://9119939

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

13 years agoFix LoopUnswitch bug. RewriteLoopBodyWithConditionConstant can delete a dead
Evan Cheng [Tue, 24 May 2011 23:12:57 +0000 (23:12 +0000)]
Fix LoopUnswitch bug. RewriteLoopBodyWithConditionConstant can delete a dead
case of a switch instruction. Back off this optimization when this would
eliminate all of the predecessors to the latch.

Sorry, I am unable to reduce a reasonably sized test case.

rdar://9486843

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

13 years agoAdd more unimplemented asm modifiers and some documentation of what they
Eric Christopher [Tue, 24 May 2011 22:27:43 +0000 (22:27 +0000)]
Add more unimplemented asm modifiers and some documentation of what they
do.

Part of rdar://9119939.

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

13 years agoAdd support for the arm 'y' asm modifier.
Eric Christopher [Tue, 24 May 2011 22:10:34 +0000 (22:10 +0000)]
Add support for the arm 'y' asm modifier.

Fixes part of rdar://9444657

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

13 years agoUpdate documentation: -basicaa does chaining these days.
Dan Gohman [Tue, 24 May 2011 22:01:32 +0000 (22:01 +0000)]
Update documentation: -basicaa does chaining these days.

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

13 years agoTest case for r132003.
Akira Hatanaka [Tue, 24 May 2011 21:28:18 +0000 (21:28 +0000)]
Test case for r132003.

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

13 years agoTest basic SEH directive-parsing functionality. Fix a latent bug exposed by
Charles Davis [Tue, 24 May 2011 21:22:53 +0000 (21:22 +0000)]
Test basic SEH directive-parsing functionality. Fix a latent bug exposed by
this test.

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

13 years agoEnable printing of immediates that do not fit in 16-bit. .cprestore can have
Akira Hatanaka [Tue, 24 May 2011 21:22:21 +0000 (21:22 +0000)]
Enable printing of immediates that do not fit in 16-bit. .cprestore can have
offsets that are larger than 0x10000.

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

13 years agoChange condition for determining whether a function is small for inlining metrics...
Eli Friedman [Tue, 24 May 2011 20:22:24 +0000 (20:22 +0000)]
Change condition for determining whether a function is small for inlining metrics so that very long functions
with few basic blocks are not re-analyzed.

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

13 years agoImplement the rest of the SEH directive-parsing methods in the COFFAsmParser.
Charles Davis [Tue, 24 May 2011 20:06:30 +0000 (20:06 +0000)]
Implement the rest of the SEH directive-parsing methods in the COFFAsmParser.

Add a size alignment check to the .seh_stackalloc directive parser. Add a
more descriptive error message to the .seh_handler directive parser.

Add methods to the TargetAsmInfo struct in support of all this.

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

13 years agoFix test case.
Akira Hatanaka [Tue, 24 May 2011 19:37:15 +0000 (19:37 +0000)]
Fix test case.

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

13 years agoRevision 131986 test case.
Akira Hatanaka [Tue, 24 May 2011 19:29:37 +0000 (19:29 +0000)]
Revision 131986 test case.

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

13 years agoImplement byval structure argument passing. The following limitations or
Akira Hatanaka [Tue, 24 May 2011 19:18:33 +0000 (19:18 +0000)]
Implement byval structure argument passing. The following limitations or
deficiencies exist:

- Works only if ABI is o32.
- Zero-sized structures cannot be passed.
- There is a lot of redundancy in generated code.

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

13 years agoMake instcombine O(N) instead of O(N^2) in code where the same simplifiable constant...
Eli Friedman [Tue, 24 May 2011 18:52:07 +0000 (18:52 +0000)]
Make instcombine O(N) instead of O(N^2) in code where the same simplifiable constant is used many times.
Part of rdar://9471075.

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

13 years agoRemove dead code.
Devang Patel [Tue, 24 May 2011 18:27:52 +0000 (18:27 +0000)]
Remove dead code.

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

13 years agoFix "make check" in Release by removing debug-only options from an 'opt' invocation.
Cameron Zwarich [Tue, 24 May 2011 18:26:09 +0000 (18:26 +0000)]
Fix "make check" in Release by removing debug-only options from an 'opt' invocation.

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

13 years agoMake DecomposeGEPExpression check SimplifyInstruction only
Dan Gohman [Tue, 24 May 2011 18:24:08 +0000 (18:24 +0000)]
Make DecomposeGEPExpression check SimplifyInstruction only
after checking for a GEP, so that it matches what GetUnderlyingObject
does. This fixes an obscure bug turned up by bugpoint in the testcase
for PR9931.

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

13 years agoAdd a method to TargetRegisterInfo to get the register number that the Win64 EH
Charles Davis [Tue, 24 May 2011 16:57:53 +0000 (16:57 +0000)]
Add a method to TargetRegisterInfo to get the register number that the Win64 EH
scheme uses internally. Implement it for x86 (the only architecture that LLVM
supports for which this matters right now).

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

13 years agoClean up the lazy initialization of DIBuilder a bit.
Cameron Zwarich [Tue, 24 May 2011 06:00:08 +0000 (06:00 +0000)]
Clean up the lazy initialization of DIBuilder a bit.

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

13 years agoWork around code generation bug in Visual Studio 2010.
Jakob Stoklund Olesen [Tue, 24 May 2011 03:20:56 +0000 (03:20 +0000)]
Work around code generation bug in Visual Studio 2010.

See http://llvm.org/pr9976 for details.

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

13 years agoMake LoadAndStorePromoter preserve debug info and create llvm.dbg.values when
Cameron Zwarich [Tue, 24 May 2011 03:10:43 +0000 (03:10 +0000)]
Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values when
promoting allocas to SSA variables. Fixes <rdar://problem/9479036>.

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

13 years agoExplain FIXME.
Rafael Espindola [Tue, 24 May 2011 03:10:31 +0000 (03:10 +0000)]
Explain FIXME.

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

13 years agoFix the defaults for .eh_frame. We were marking it as writable.
Rafael Espindola [Tue, 24 May 2011 02:50:20 +0000 (02:50 +0000)]
Fix the defaults for .eh_frame. We were marking it as writable.

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