oota-llvm.git
11 years agoRevert accidental commit.
Craig Topper [Tue, 27 Nov 2012 08:17:04 +0000 (08:17 +0000)]
Revert accidental commit.

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

11 years agoMake PrintReg constructor explicit to prevent weird implicit conversions from acciden...
Craig Topper [Tue, 27 Nov 2012 08:14:24 +0000 (08:14 +0000)]
Make PrintReg constructor explicit to prevent weird implicit conversions from accidentally being triggered.

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

11 years agoAdd ENABLE_CXX11 and ENABLE_WERROR to Makefile.llvm.rules for sample project. They...
Craig Topper [Tue, 27 Nov 2012 08:12:24 +0000 (08:12 +0000)]
Add ENABLE_CXX11 and ENABLE_WERROR to Makefile.llvm.rules for sample project. They were previously added to Makefile.llvm.config.in but the consumption was missing

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

11 years agotsan: instrument atomic nand operation
Dmitry Vyukov [Tue, 27 Nov 2012 08:09:25 +0000 (08:09 +0000)]
tsan: instrument atomic nand operation

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

11 years agoAdd test cases for r168417.
Craig Topper [Tue, 27 Nov 2012 07:19:54 +0000 (07:19 +0000)]
Add test cases for r168417.

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

11 years agoRevert rearrangement of debug info sections to unblock the bots
Eric Christopher [Tue, 27 Nov 2012 06:49:23 +0000 (06:49 +0000)]
Revert rearrangement of debug info sections to unblock the bots
and O0 + debug codegen.

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

11 years agotest/Transforms/SimplifyLibCalls/SPrintF.ll: Suppress this for now. r168677 unveiled...
NAKAMURA Takumi [Tue, 27 Nov 2012 06:42:48 +0000 (06:42 +0000)]
test/Transforms/SimplifyLibCalls/SPrintF.ll: Suppress this for now. r168677 unveiled another failure.

FYI, this test makes no sense with "not grep"... I saw "assertion failure" in stderr.

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

11 years agoModify depends(Src, Dst, PossiblyLoopIndependent).
Preston Briggs [Tue, 27 Nov 2012 06:41:46 +0000 (06:41 +0000)]
Modify depends(Src, Dst, PossiblyLoopIndependent).
If the Src and Dst are the same instruction,
no loop-independent dependence is possible,
so we force the PossiblyLoopIndependent flag to false.

The test case results are updated appropriately.

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

11 years agoinstcombine: Migrate sprintf optimizations
Meador Inge [Tue, 27 Nov 2012 05:57:54 +0000 (05:57 +0000)]
instcombine: Migrate sprintf optimizations

This patch migrates the sprintf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

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

11 years agoRemove unneeded #include.
Jakub Staszak [Tue, 27 Nov 2012 02:00:27 +0000 (02:00 +0000)]
Remove unneeded #include.

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

11 years agoThe section is .debug_line.
Eric Christopher [Tue, 27 Nov 2012 01:40:36 +0000 (01:40 +0000)]
The section is .debug_line.

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

11 years agoMake building of llvm-jitlistener conditional on the USE_INTEL_JITEVENTS setting.
Andrew Kaylor [Tue, 27 Nov 2012 01:24:25 +0000 (01:24 +0000)]
Make building of llvm-jitlistener conditional on the USE_INTEL_JITEVENTS setting.

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

11 years agoRemove unneeded #include.
Jakub Staszak [Tue, 27 Nov 2012 01:22:15 +0000 (01:22 +0000)]
Remove unneeded #include.

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

11 years agollvm/CodeGen: Remove empty files in r168659.
NAKAMURA Takumi [Tue, 27 Nov 2012 01:21:50 +0000 (01:21 +0000)]
llvm/CodeGen: Remove empty files in r168659.

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

11 years agoCode pretification
Joe Abbey [Tue, 27 Nov 2012 01:20:22 +0000 (01:20 +0000)]
Code pretification

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

11 years agoRemove unused forward declaration.
Jakub Staszak [Tue, 27 Nov 2012 01:16:37 +0000 (01:16 +0000)]
Remove unused forward declaration.

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

11 years agoRemove unused MachineLoopRanges analysis.
Jakub Staszak [Tue, 27 Nov 2012 01:14:34 +0000 (01:14 +0000)]
Remove unused MachineLoopRanges analysis.

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

11 years agoExtend test case for r168657.
Chad Rosier [Tue, 27 Nov 2012 01:10:48 +0000 (01:10 +0000)]
Extend test case for r168657.

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

11 years ago[arm fast-isel] Appease the machine verifier by using the proper register
Chad Rosier [Tue, 27 Nov 2012 01:06:49 +0000 (01:06 +0000)]
[arm fast-isel] Appease the machine verifier by using the proper register
classes.  The associated test case still doesn't pass, but it does have far
fewer issues.
rdar://12719844

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

11 years agoFast-math test for SimplifyInstruction: fold multiply by 0
Michael Ilseman [Tue, 27 Nov 2012 01:00:22 +0000 (01:00 +0000)]
Fast-math test for SimplifyInstruction: fold multiply by 0

Applied the patch, rather than committing it.

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

11 years agoRevert r168635 "Step towards implementation of pass manager with doInitialization...
Owen Anderson [Tue, 27 Nov 2012 00:53:24 +0000 (00:53 +0000)]
Revert r168635 "Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model".
It appears to have broken at least one buildbot.

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

11 years agoRemove some Clang-specific ownership roles.
Richard Smith [Tue, 27 Nov 2012 00:48:36 +0000 (00:48 +0000)]
Remove some Clang-specific ownership roles.

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

11 years agoFast-math flags documentation added to LangRef
Michael Ilseman [Tue, 27 Nov 2012 00:48:29 +0000 (00:48 +0000)]
Fast-math flags documentation added to LangRef

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

11 years agollvm/test/CodeGen/X86/2012-07-15-broadcastfold.ll: Loosen expression corresponding...
NAKAMURA Takumi [Tue, 27 Nov 2012 00:48:27 +0000 (00:48 +0000)]
llvm/test/CodeGen/X86/2012-07-15-broadcastfold.ll: Loosen expression corresponding to r168627. Win32 and *bsd were affected.

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

11 years agoFast-math test for SimplifyInstruction: fold multiply by 0
Michael Ilseman [Tue, 27 Nov 2012 00:47:20 +0000 (00:47 +0000)]
Fast-math test for SimplifyInstruction: fold multiply by 0

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

11 years agoFast-math optimization: fold multiply by zero
Michael Ilseman [Tue, 27 Nov 2012 00:46:26 +0000 (00:46 +0000)]
Fast-math optimization: fold multiply by zero

Added in first optimization using fast-math flags to serve as an example for following optimizations. SimplifyInstruction will now try to optimize an fmul observing its FastMathFlags to see if it can fold multiply by zero when 'nnan' and 'nsz' flags are set.

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

11 years agoFast-math test case for bitcode and textual reading/writing
Michael Ilseman [Tue, 27 Nov 2012 00:45:08 +0000 (00:45 +0000)]
Fast-math test case for bitcode and textual reading/writing

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

11 years agoFast-math flags for the bitcode
Michael Ilseman [Tue, 27 Nov 2012 00:43:38 +0000 (00:43 +0000)]
Fast-math flags for the bitcode

Added in bitcode enum for the serializing of fast-math flags. Added in the reading/writing of fast-math flags from the OptimizationFlags record for BinaryOps.

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

11 years agoFast-math flags for LLVM IR parsing and printing
Michael Ilseman [Tue, 27 Nov 2012 00:42:44 +0000 (00:42 +0000)]
Fast-math flags for LLVM IR parsing and printing

Added in the ability to read LLVM IR text that contains fast-math flags as a sequence of capital letters separated by spaces in any order. Added in the printing of the fast-math flags in a canonical order, and don't print the other flags when 'fast' is specified, as 'fast' implies all the others.

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

11 years agoMake comment names match function names.
Eric Christopher [Tue, 27 Nov 2012 00:41:57 +0000 (00:41 +0000)]
Make comment names match function names.

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

11 years agoAdd in sections for the fission case (no change so incorrect) and
Eric Christopher [Tue, 27 Nov 2012 00:41:54 +0000 (00:41 +0000)]
Add in sections for the fission case (no change so incorrect) and
add a TODO for starting.

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

11 years agoFast-math interfaces for Instructions
Michael Ilseman [Tue, 27 Nov 2012 00:41:22 +0000 (00:41 +0000)]
Fast-math interfaces for Instructions

Add in getter/setter methods for Instructions, allowing them to be the interface to FPMathOperator similarly to now NUS/NSW is handled.

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

11 years agoFast-math flags added to FPMathOperator.
Michael Ilseman [Tue, 27 Nov 2012 00:40:00 +0000 (00:40 +0000)]
Fast-math flags added to FPMathOperator.

Created FastMathFlags convenience struct for the getting and setting of fast-math flags en masse. Added SubclassOptionalData bitfields and corresponding getters/setters to FPMathOperator for the various fast-math flags.

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

11 years agoMove Clang code owners list from llvm/ to cfe/.
Richard Smith [Tue, 27 Nov 2012 00:39:52 +0000 (00:39 +0000)]
Move Clang code owners list from llvm/ to cfe/.

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

11 years agoReorder section output ordering.
Eric Christopher [Tue, 27 Nov 2012 00:13:58 +0000 (00:13 +0000)]
Reorder section output ordering.

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

11 years agoWhitespace cleanup.
Eric Christopher [Tue, 27 Nov 2012 00:13:51 +0000 (00:13 +0000)]
Whitespace cleanup.

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

11 years agoStep towards implementation of pass manager with doInitialization and doFinalization...
Owen Anderson [Mon, 26 Nov 2012 23:54:47 +0000 (23:54 +0000)]
Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model

Patch by Pedro Artigas, with feedback from by Chandler Carruth.

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

11 years agoAdd an assertion to ensure freezeReservedRegs() is only ever called once.
Chad Rosier [Mon, 26 Nov 2012 23:37:07 +0000 (23:37 +0000)]
Add an assertion to ensure freezeReservedRegs() is only ever called once.

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

11 years agoMake this test less sensitive.
Eli Bendersky [Mon, 26 Nov 2012 23:27:09 +0000 (23:27 +0000)]
Make this test less sensitive.

It currently assumes register numbering and any harmless change in the X86
register naming makes it fail. It's enough to match the register names.

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

11 years agoNow that the X86 Maximal Stack Alignment Check pass has been removed (i.e.,
Chad Rosier [Mon, 26 Nov 2012 23:25:41 +0000 (23:25 +0000)]
Now that the X86 Maximal Stack Alignment Check pass has been removed (i.e.,
r168627), we no longer need to call the freezeReservedRegs() function a second
time.  Previously, this pass was conservatively adding the FP to the set of
reserved registers, requiring the second update to the reserved registers.
rdar://12719844

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

11 years agoNow that the X86 Maximal Stack Alignment Check pass has been removed (i.e.,
Chad Rosier [Mon, 26 Nov 2012 23:14:37 +0000 (23:14 +0000)]
Now that the X86 Maximal Stack Alignment Check pass has been removed (i.e.,
r168627), we no longer need to call the freezeReservedRegs() function a second
time.  Previously, this pass was conservatively adding the FP to the set of
reserved registers, requiring the second update to the reserved registers.
rdar://12719844

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

11 years agoGet rid of the getPointeeAlignment helper function from
Eli Friedman [Mon, 26 Nov 2012 23:04:53 +0000 (23:04 +0000)]
Get rid of the getPointeeAlignment helper function from
InstCombineLoadStoreAlloca.cpp, which had many issues.
(At least two bugs were noted on llvm-commits, and it was overly conservative.)
Instead, use getOrEnforceKnownAlignment.

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

11 years agoRemove the X86 Maximal Stack Alignment Check pass as it is no longer necessary.
Chad Rosier [Mon, 26 Nov 2012 22:55:05 +0000 (22:55 +0000)]
Remove the X86 Maximal Stack Alignment Check pass as it is no longer necessary.
This pass was conservative in that it always reserved the FP to enable dynamic
stack realignment, which allowed the RA to use aligned spills for vector
registers.  This happens even when spills were not necessary.  The RA has
since been improved to use unaligned spills when necessary.

The new behavior is to realign the stack if the frame pointer was already
reserved for some other reason, but don't reserve the frame pointer just
because a function contains vector virtual registers.

Part of rdar://12719844

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

11 years agoDon't use iterator after being erased.
Jakub Staszak [Mon, 26 Nov 2012 22:14:19 +0000 (22:14 +0000)]
Don't use iterator after being erased.

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

11 years agoCorrect copy-pasto where we're talking about function attributes and not parameter...
Bill Wendling [Mon, 26 Nov 2012 22:04:13 +0000 (22:04 +0000)]
Correct copy-pasto where we're talking about function attributes and not parameter attributes.

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

11 years agoFix comments in HexagonOperands.td.
Jyotsna Verma [Mon, 26 Nov 2012 21:56:51 +0000 (21:56 +0000)]
Fix comments in HexagonOperands.td.

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

11 years agordar://12329730 (defect 2)
Shuxin Yang [Mon, 26 Nov 2012 21:44:25 +0000 (21:44 +0000)]
rdar://12329730 (defect 2)

Enhancement to InstCombine. Try to catch this opportunity:

 ---------------------------------------------------------------
 ((X^C1) >> C2) ^ C3  => (X>>C2) ^ ((C1>>C2)^C3)
  where the subexpression "X ^ C1" has more than one uses, and
  "(X^C1) >> C2" has single use.
 ----------------------------------------------------------------

 Reviewed by Nadav (with minor change per his request).

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

11 years agoRemove unneeded #includes.
Jakub Staszak [Mon, 26 Nov 2012 21:04:19 +0000 (21:04 +0000)]
Remove unneeded #includes.

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

11 years agoFix a comment bug in toascii simplifier
Meador Inge [Mon, 26 Nov 2012 20:37:23 +0000 (20:37 +0000)]
Fix a comment bug in toascii simplifier

When I migrated the toascii simplifier in r168580 Benjamin Kramer noticed
a bug in one of the comments that I migrated.

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

11 years agoinstcombine: Migrate printf optimizations
Meador Inge [Mon, 26 Nov 2012 20:37:20 +0000 (20:37 +0000)]
instcombine: Migrate printf optimizations

This patch migrates the printf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

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

11 years agoMove the code that uses SCEVs prior to creating the new loops.
Nadav Rotem [Mon, 26 Nov 2012 19:51:46 +0000 (19:51 +0000)]
Move the code that uses SCEVs prior to creating the new loops.

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

11 years agoNormalize splat 256bit vectors with 8 elements.
Jakub Staszak [Mon, 26 Nov 2012 19:24:31 +0000 (19:24 +0000)]
Normalize splat 256bit vectors with 8 elements.

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

11 years agoDecouple MCInstBuilder from the streamer per Eli's request.
Benjamin Kramer [Mon, 26 Nov 2012 18:05:52 +0000 (18:05 +0000)]
Decouple MCInstBuilder from the streamer per Eli's request.

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

11 years agoRemove stray trailing backslash
Matt Beaumont-Gay [Mon, 26 Nov 2012 16:27:22 +0000 (16:27 +0000)]
Remove stray trailing backslash

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

11 years agotsan: fix lint warnings
Dmitry Vyukov [Mon, 26 Nov 2012 14:55:26 +0000 (14:55 +0000)]
tsan: fix lint warnings

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

11 years agoRewrite test to not use a FileCheck variable and redefine it on the same line.
Eli Bendersky [Mon, 26 Nov 2012 14:09:46 +0000 (14:09 +0000)]
Rewrite test to not use a FileCheck variable and redefine it on the same line.

In preparation for the FileCheck functionality change which will allow using
a variable later on the same line.

No functionality change.

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

11 years agoAdd MCInstBuilder, a utility class to simplify MCInst creation similar to MachineInst...
Benjamin Kramer [Mon, 26 Nov 2012 13:34:22 +0000 (13:34 +0000)]
Add MCInstBuilder, a utility class to simplify MCInst creation similar to MachineInstrBuilder.

Simplify some repetitive code with it. No functionality change.

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

11 years ago[tsan] add fail order to compare_exchange
Dmitry Vyukov [Mon, 26 Nov 2012 11:36:19 +0000 (11:36 +0000)]
[tsan] add fail order to compare_exchange

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

11 years agoFix a PassManager pointer use-after-free bug.
Zhou Sheng [Mon, 26 Nov 2012 05:45:53 +0000 (05:45 +0000)]
Fix a PassManager pointer use-after-free bug.
The bug can be triggered when we require LoopInfo analysis ahead of DominatorTree construction in a Module Pass. The cause is that the LoopInfo analysis itself also invokes DominatorTree construction, therefore, when PassManager schedules LoopInfo, it will add DominatorTree first. Then after that, when the PassManger turns to schedule DominatorTree invoked by the above ModulePass, it finds there is already a DominatorTree, so it delete the redundant one. However, somehow it still try to access that pass pointer after free as code pasted below, which results in segment fault.

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

11 years agoinstcombine: Migrate toascii optimizations
Meador Inge [Mon, 26 Nov 2012 03:38:52 +0000 (03:38 +0000)]
instcombine: Migrate toascii optimizations

This patch migrates the toascii optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

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

11 years agoinstcombine: Migrate isascii optimizations
Meador Inge [Mon, 26 Nov 2012 03:10:07 +0000 (03:10 +0000)]
instcombine: Migrate isascii optimizations

This patch migrates the isascii optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

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

11 years agoinstcombine: Migrate isdigit optimizations
Meador Inge [Mon, 26 Nov 2012 02:31:59 +0000 (02:31 +0000)]
instcombine: Migrate isdigit optimizations

This patch migrates the isdigit optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

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

11 years agoRemoving SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
Joe Abbey [Mon, 26 Nov 2012 02:02:08 +0000 (02:02 +0000)]
Removing SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG

Adding CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
       C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG

This is to handle the wackiness on a Mac host where cmake detects:

CMAKE_CXX_COMPILER == "/usr/bin/c++"
CMAKE_C_COMPILER == "/usr/bin/gcc"

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

11 years agoFix gcc's -Wunused-but-set-variable warnings.
Rafael Espindola [Mon, 26 Nov 2012 00:56:44 +0000 (00:56 +0000)]
Fix gcc's -Wunused-but-set-variable warnings.

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

11 years agoFix bogus comment; no functional change.
Meador Inge [Mon, 26 Nov 2012 00:25:33 +0000 (00:25 +0000)]
Fix bogus comment;  no functional change.

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

11 years agoinstcombine: Migrate *abs optimizations
Meador Inge [Mon, 26 Nov 2012 00:24:07 +0000 (00:24 +0000)]
instcombine: Migrate *abs optimizations

This patch migrates the *abs optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

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

11 years agoinstcombine: Migrate ffs* optimizations
Meador Inge [Sun, 25 Nov 2012 20:45:27 +0000 (20:45 +0000)]
instcombine: Migrate ffs* optimizations

This patch migrates the ffs* optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

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

11 years agoMove the max vector width to a constant parameter. No functionality change.
Nadav Rotem [Sun, 25 Nov 2012 16:48:08 +0000 (16:48 +0000)]
Move the max vector width to a constant parameter. No functionality change.

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

11 years agoFix the document style.
Nadav Rotem [Sun, 25 Nov 2012 16:39:01 +0000 (16:39 +0000)]
Fix the document style.

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

11 years agoRefactor the ptr runtime check generation code. No functionality change.
Nadav Rotem [Sun, 25 Nov 2012 16:27:16 +0000 (16:27 +0000)]
Refactor the ptr runtime check generation code. No functionality change.

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

11 years agoCode Custodian:
Joe Abbey [Sun, 25 Nov 2012 15:23:39 +0000 (15:23 +0000)]
Code Custodian:
  - Widespread trailing space removal
  - A dash of OCD spacing to block align enums
  - joined a line that probably needed 80 cols a while back

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

11 years agoAdd support for .cfi_register now that it is easy to extent the representation
Rafael Espindola [Sun, 25 Nov 2012 15:14:49 +0000 (15:14 +0000)]
Add support for .cfi_register now that it is easy to extent the representation
to support it. Original patch with the parsing and plumbing by the PaX team and
Roman Divacky. I added the bits in MCDwarf.cpp and the test.

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

11 years agoMove semantics are great, don't destroy the optimization opportunity with trivial...
Benjamin Kramer [Sun, 25 Nov 2012 11:52:03 +0000 (11:52 +0000)]
Move semantics are great, don't destroy the optimization opportunity with trivial copy ctors.

No functionality change.

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

11 years agoRename method. No functionality change.
Nadav Rotem [Sun, 25 Nov 2012 09:13:57 +0000 (09:13 +0000)]
Rename method. No functionality change.

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

11 years agoThe induction-pointer work is inspired by a research paper. This commit adds a reference.
Nadav Rotem [Sun, 25 Nov 2012 09:09:26 +0000 (09:09 +0000)]
The induction-pointer work is inspired by a research paper. This commit adds a reference.

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

11 years agoAdd support for pointer induction variables even when there is no integer induction...
Nadav Rotem [Sun, 25 Nov 2012 08:41:35 +0000 (08:41 +0000)]
Add support for pointer induction variables even when there is no integer induction variable.

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

11 years agoRefactor to make helper method static.
Craig Topper [Sun, 25 Nov 2012 08:08:58 +0000 (08:08 +0000)]
Refactor to make helper method static.

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

11 years agoFurther cleanups. Thanks for Sean Silva for noticing it.
Rafael Espindola [Sun, 25 Nov 2012 02:50:32 +0000 (02:50 +0000)]
Further cleanups. Thanks for Sean Silva for noticing it.

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

11 years agoAdd an extra slash so doxygen comments will be properly recognized.
Craig Topper [Sun, 25 Nov 2012 00:59:59 +0000 (00:59 +0000)]
Add an extra slash so doxygen comments will be properly recognized.

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

11 years agoRemove duplicate check of LimitFloatPrecision. It was already checked earlier before...
Craig Topper [Sun, 25 Nov 2012 00:48:58 +0000 (00:48 +0000)]
Remove duplicate check of LimitFloatPrecision. It was already checked earlier before IsExp10 could be set to true.

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

11 years agoFactor common code out of individual if blocks into common tail.
Craig Topper [Sun, 25 Nov 2012 00:15:07 +0000 (00:15 +0000)]
Factor common code out of individual if blocks into common tail.

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

11 years agoRemove redundant calls to getCurDebugLoc in visitIntrinsicCall. It's already called...
Craig Topper [Sat, 24 Nov 2012 23:05:23 +0000 (23:05 +0000)]
Remove redundant calls to getCurDebugLoc in visitIntrinsicCall. It's already called at the start of the function and captured in a local variable.

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

11 years agoRefactor a bit to make some helper methods static.
Craig Topper [Sat, 24 Nov 2012 18:52:06 +0000 (18:52 +0000)]
Refactor a bit to make some helper methods static.

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

11 years agolibLTO: Add a utility method to initialize the disassemblers.
Benjamin Kramer [Sat, 24 Nov 2012 16:59:10 +0000 (16:59 +0000)]
libLTO: Add a utility method to initialize the disassemblers.

Necessary to give disassembler users (like darwin's otool) a possibility to
dlopen libLTO and still initialize the required LLVM bits. This used to go
through libMCDisassembler but that's a gross layering violation, the MC layer
can't pull in functions from the targets. Adding a function to libLTO is a bit
of a hack but not worse than exposing other disassembler bits from libLTO.

Fixes PR14362.

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

11 years agoPPC: Reinstate the fatal error when trying to emit a macho file.
Benjamin Kramer [Sat, 24 Nov 2012 15:23:49 +0000 (15:23 +0000)]
PPC: Reinstate the fatal error when trying to emit a macho file.

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

11 years agoARM: Share applyFixup between ELF and Darwin.
Benjamin Kramer [Sat, 24 Nov 2012 14:36:43 +0000 (14:36 +0000)]
ARM: Share applyFixup between ELF and Darwin.

The implementations already diverged a bit, merge them back together.

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

11 years agoPPC: MCize most of the darwin PIC emission.
Benjamin Kramer [Sat, 24 Nov 2012 13:18:25 +0000 (13:18 +0000)]
PPC: MCize most of the darwin PIC emission.

The last remaining bit is "bcl 20, 31, AnonSymbol", which I couldn't find the
instruction definition for. Only whitespace changes in assembly output.

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

11 years agoPPC: Share applyFixup between ELF and Darwin.
Benjamin Kramer [Sat, 24 Nov 2012 13:18:17 +0000 (13:18 +0000)]
PPC: Share applyFixup between ELF and Darwin.

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

11 years agoPPC: Simplify code with Twines.
Benjamin Kramer [Sat, 24 Nov 2012 13:18:11 +0000 (13:18 +0000)]
PPC: Simplify code with Twines.

No functionality change.

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

11 years agoFactor some common code out of individual if blocks.
Craig Topper [Sat, 24 Nov 2012 08:22:37 +0000 (08:22 +0000)]
Factor some common code out of individual if blocks.

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

11 years agoChange the representation of MCCFIInstruction.
Rafael Espindola [Sat, 24 Nov 2012 04:33:48 +0000 (04:33 +0000)]
Change the representation of MCCFIInstruction.

We now store the Register and Offset directly. MachineLocation is gone (from
this file)!

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

11 years agoGive each MCCFIInstruction its own opcode.
Rafael Espindola [Sat, 24 Nov 2012 03:10:54 +0000 (03:10 +0000)]
Give each MCCFIInstruction its own opcode.
This untangles the switch cases of the old Move and RelMove opcodes a bit
and makes it clear how to add new instructions.

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

11 years agoMove a bit of duplicated code into a helper function.
Rafael Espindola [Sat, 24 Nov 2012 02:18:49 +0000 (02:18 +0000)]
Move a bit of duplicated code into a helper function.

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

11 years agoRefactor how MCCFIInstructions are created.
Rafael Espindola [Sat, 24 Nov 2012 02:01:08 +0000 (02:01 +0000)]
Refactor how MCCFIInstructions are created.

Give MCCFIInstruction a single, private constructor and add helper static
methods that create each type of cfi instruction. This is is preparation
for changing its representation. The representation with a pair
MachineLocations older than MC and has been abused quiet a bit to support
more cfi instructions.

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

11 years agoCodeGenPrepare: Move ret duplication out of the instruction iteration loop.
Benjamin Kramer [Fri, 23 Nov 2012 19:17:06 +0000 (19:17 +0000)]
CodeGenPrepare: Move ret duplication out of the instruction iteration loop.

It can delete the block, and the loop continues on free'd memory.
No change in output. Found by valgrind.

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

11 years agoRefactor a bit to make some helper functions static.
Craig Topper [Fri, 23 Nov 2012 18:38:31 +0000 (18:38 +0000)]
Refactor a bit to make some helper functions static.

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

11 years agoAdd a -disable-cfi option to llvm-mc. This is useful for debugging as
Rafael Espindola [Fri, 23 Nov 2012 17:37:34 +0000 (17:37 +0000)]
Add a -disable-cfi option to llvm-mc. This is useful for debugging as
it will expand any .cfi_* directives in the input assembly.

Unfortunately this cannot replace elf-dump in tests as the asm streamer
cannot relax the line advance opcodes.

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

11 years agoImplement .cfi_undefined. Based on a patch from PaX team, updated by
Rafael Espindola [Fri, 23 Nov 2012 16:59:41 +0000 (16:59 +0000)]
Implement .cfi_undefined. Based on a patch from PaX team, updated by
Roman Divacky. I just added the testcase.

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

11 years agoDisallow the undocumented practice of starting the datalayout string with '-'.
Patrik Hägglund [Fri, 23 Nov 2012 14:51:42 +0000 (14:51 +0000)]
Disallow the undocumented practice of starting the datalayout string with '-'.

Update some test cases accordingly.

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

11 years agoUpdate call to the new syntax.
Bill Wendling [Fri, 23 Nov 2012 11:05:35 +0000 (11:05 +0000)]
Update call to the new syntax.

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