oota-llvm.git
11 years agoSplit TargetLowering into a CodeGen and a SelectionDAG part.
Benjamin Kramer [Fri, 11 Jan 2013 20:05:37 +0000 (20:05 +0000)]
Split TargetLowering into a CodeGen and a SelectionDAG part.

This fixes some of the cycles between libCodeGen and libSelectionDAG. It's still
a complete mess but as long as the edges consist of virtual call it doesn't
cause breakage. BasicTTI did static calls and thus broke some build
configurations.

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

11 years agoARM Cost Model: Modify the target independent cost model to ask
Nadav Rotem [Fri, 11 Jan 2013 19:54:13 +0000 (19:54 +0000)]
ARM Cost Model: Modify the target independent cost model to ask
the target if it supports the different CAST types. We didn't do this
on X86 because of the different register sizes and types, but on ARM
this makes sense.

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

11 years agoRemove PTX->NVPTX in CodeGenerator document and update its text.
Justin Holewinski [Fri, 11 Jan 2013 18:47:10 +0000 (18:47 +0000)]
Remove PTX->NVPTX in CodeGenerator document and update its text.

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

11 years agoUpdate CodeGenerator document to add a "Not Applicable" category to the
Justin Holewinski [Fri, 11 Jan 2013 18:37:54 +0000 (18:37 +0000)]
Update CodeGenerator document to add a "Not Applicable" category to the
Target Feature Matrix, and update the PTX column with this new category.

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

11 years agoFor inline asm:
Eric Christopher [Fri, 11 Jan 2013 18:12:39 +0000 (18:12 +0000)]
For inline asm:

- recognize string "{memory}" in the MI generation
- mark as mayload/maystore when there's a memory clobber constraint.

PR14859.

Patch by Krzysztof Parzyszek

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

11 years agoFollow-up typo correction from building the wrong branch.
Andrew Trick [Fri, 11 Jan 2013 17:51:16 +0000 (17:51 +0000)]
Follow-up typo correction from building the wrong branch.

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

11 years agoFix typo from r170452. Affects -enable-misched heuristics.
Andrew Trick [Fri, 11 Jan 2013 17:46:50 +0000 (17:46 +0000)]
Fix typo from r170452. Affects -enable-misched heuristics.

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

11 years agoUpdate CMakeLists for CallPrinter.cpp.
Andrew Trick [Fri, 11 Jan 2013 17:34:05 +0000 (17:34 +0000)]
Update CMakeLists for CallPrinter.cpp.

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

11 years agoAdded -view-callgraph module pass.
Andrew Trick [Fri, 11 Jan 2013 17:28:14 +0000 (17:28 +0000)]
Added -view-callgraph module pass.

-dot-callgraph similarly follows a standard module pass pattern.

Patch by Speziale Ettore!

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

11 years agoFix bug in exception table allocation (PR13678)
Eli Bendersky [Fri, 11 Jan 2013 16:33:30 +0000 (16:33 +0000)]
Fix bug in exception table allocation (PR13678)

Patch by Michael Muller.

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

11 years agoRemove lib/Target/PTX directory. It was empty and obsolete but apparently git-svn...
Justin Holewinski [Fri, 11 Jan 2013 13:14:17 +0000 (13:14 +0000)]
Remove lib/Target/PTX directory.  It was empty and obsolete but apparently git-svn does not remove empty directories.

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

11 years agoSimplify writing floating types to assembly.
Tim Northover [Fri, 11 Jan 2013 10:36:13 +0000 (10:36 +0000)]
Simplify writing floating types to assembly.

This removes previous special cases for each floating-point type in favour of a
shared codepath.

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

11 years agollvm-symbolizer: add DATA command that allows to symbolize global variables.
Dmitry Vyukov [Fri, 11 Jan 2013 07:16:20 +0000 (07:16 +0000)]
llvm-symbolizer: add DATA command that allows to symbolize global variables.
Example:
>DATA bin/clang 0x26e8e40
<llvm::SparcSubTypeKV
<40799808 416
The last line is address and size of the object.

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

11 years agoARM Cost Model: We need to detect the max bitwidth of types in the loop in order...
Nadav Rotem [Fri, 11 Jan 2013 07:11:59 +0000 (07:11 +0000)]
ARM Cost Model:  We need to detect the max bitwidth of types in the loop in order to select the max vectorization factor.
We don't have a detailed analysis on which values are vectorized and which stay scalars in the vectorized loop so we use
another method. We look at reduction variables, loads and stores, which are the only ways to get information in and out
of loop iterations. If the data types are extended and truncated then the cost model will catch the cost of the vector
zext/sext/trunc operations.

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

11 years agoConverted test dont-tce-tail-marked-call.ll to use FileCheck.
Michael Gottesman [Fri, 11 Jan 2013 04:16:35 +0000 (04:16 +0000)]
Converted test dont-tce-tail-marked-call.ll to use FileCheck.

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

11 years agoThis commit is a 4x squash commit consisting of 4x functions converted to use FileChe...
Michael Gottesman [Fri, 11 Jan 2013 04:12:53 +0000 (04:12 +0000)]
This commit is a 4x squash commit consisting of 4x functions converted to use FileCheck instead of grep.

Messages:
Converted test case trivial_codegen_tailcall.ll to use FileCheck.
Converted test return_constant.ll to use FileCheck instead of grep.
Converted test reorder_load.ll to use FileCheck instead of grep.
Converted test intervening-inst.ll to use FileCheck instead of grep.

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

11 years agoRevert r172153, "llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple...
NAKAMURA Takumi [Fri, 11 Jan 2013 02:50:09 +0000 (02:50 +0000)]
Revert r172153, "llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behaviors. Operand->needAddressOf() is not initialized at !Operand->isReg()."

It has been redundant since r172157.

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

11 years agoSMDiagnostic: don't emit ranges if there are /any/ multibyte characters.
Jordan Rose [Fri, 11 Jan 2013 02:37:55 +0000 (02:37 +0000)]
SMDiagnostic: don't emit ranges if there are /any/ multibyte characters.

Right now, only OS X has a way to determine the column width of a string
(PR14910). Until we have a good way to deal with this, we just won't
print carets, source ranges, or fixits for SMDiagnostic if the source line
has multibyte characters in it.

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

11 years agodocs: Fix long standing linking antipattern.
Sean Silva [Fri, 11 Jan 2013 02:28:08 +0000 (02:28 +0000)]
docs: Fix long standing linking antipattern.

Before we learned about :doc:, we used :ref: and put a dummy link at the
top of each page. Don't do that anymore.

This fixes PR14891 as a special case.

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

11 years agodocs: fix misleading description.
Sean Silva [Fri, 11 Jan 2013 01:54:16 +0000 (01:54 +0000)]
docs: fix misleading description.

PR14890

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

11 years agoSupport for half intrinsics. Pushes MMX into slower encoding path.
Michael Ilseman [Fri, 11 Jan 2013 01:45:05 +0000 (01:45 +0000)]
Support for half intrinsics. Pushes MMX into slower encoding path.

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

11 years agoX86AsmParser.cpp: Fix up r172148, to add initializer in another CreateMem().
NAKAMURA Takumi [Fri, 11 Jan 2013 01:13:54 +0000 (01:13 +0000)]
X86AsmParser.cpp: Fix up r172148, to add initializer in another CreateMem().

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

11 years agoAdd a new portability macro LLVM_FUNCTION_NAME, that expands to __func__, if
Dmitri Gribenko [Fri, 11 Jan 2013 01:13:51 +0000 (01:13 +0000)]
Add a new portability macro LLVM_FUNCTION_NAME, that expands to __func__, if
supported.

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

11 years agoLoopPass.h doesn't require Function.h. Remove unneeded #include.
Jakub Staszak [Fri, 11 Jan 2013 01:03:32 +0000 (01:03 +0000)]
LoopPass.h doesn't require Function.h. Remove unneeded #include.

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

11 years agollvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behavio...
NAKAMURA Takumi [Fri, 11 Jan 2013 00:37:35 +0000 (00:37 +0000)]
llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behaviors. Operand->needAddressOf() is not initialized at !Operand->isReg().

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

11 years agoRemove heavy and unused #inclues from X86TargetObjectFile.cpp.
Jakub Staszak [Thu, 10 Jan 2013 23:43:56 +0000 (23:43 +0000)]
Remove heavy and unused #inclues from X86TargetObjectFile.cpp.

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

11 years agoRename enumerations s/VK/DK/ to conform to naming convention
Eli Bendersky [Thu, 10 Jan 2013 23:40:56 +0000 (23:40 +0000)]
Rename enumerations s/VK/DK/ to conform to naming convention

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

11 years ago[ms-inline asm] Make sure we set a default value for AddressOf. Follow on to
Chad Rosier [Thu, 10 Jan 2013 23:39:07 +0000 (23:39 +0000)]
[ms-inline asm] Make sure we set a default value for AddressOf.  Follow on to
r172121.

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

11 years agofix comments a bit
Eli Bendersky [Thu, 10 Jan 2013 23:32:57 +0000 (23:32 +0000)]
fix comments a bit

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

11 years agoPR14904: Segmentation fault running pass 'Recognize loop idioms'
Shuxin Yang [Thu, 10 Jan 2013 23:32:01 +0000 (23:32 +0000)]
PR14904: Segmentation fault running pass 'Recognize loop idioms'

The root cause is mistakenly taking for granted that
    "dyn_cast<Instruction>(a-Value)"
return a non-NULL instruction.

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

11 years agoCastInst::castIsValid should return true if the dest type is the same as
Evan Cheng [Thu, 10 Jan 2013 23:22:53 +0000 (23:22 +0000)]
CastInst::castIsValid should return true if the dest type is the same as
Value's current type. The casting is trivial even for aggregate type.

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

11 years agollvm/test/CodeGen/X86/ms-inline-asm.ll: Fixup; Globals doesn't have leading underscor...
NAKAMURA Takumi [Thu, 10 Jan 2013 23:02:48 +0000 (23:02 +0000)]
llvm/test/CodeGen/X86/ms-inline-asm.ll: Fixup; Globals doesn't have leading underscore in symbol on linux.

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

11 years agoUpdate Apple's build script for llvmCore. <rdar://problem/12914321>
Bob Wilson [Thu, 10 Jan 2013 22:59:51 +0000 (22:59 +0000)]
Update Apple's build script for llvmCore. <rdar://problem/12914321>

This change is basically just copying changes that we've used for Apple's
clang builds to the script used for building llvmCore. Besides cleaning it
up to use xcrun to locate the proper versions of tools, especially for cross
compiling, it fixes the build to work with newer versions of clang that
honor SDKROOT settings in the environment.

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

11 years agoRemove a couple of if-else chains in parsing directives, replacing them by a
Eli Bendersky [Thu, 10 Jan 2013 22:44:57 +0000 (22:44 +0000)]
Remove a couple of if-else chains in parsing directives, replacing them by a
switch. Committed with Jim's and Chris's approval.

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

11 years ago[llvm-objdump] Emit addresses with the correct number of leading 0's.
Michael J. Spencer [Thu, 10 Jan 2013 22:40:50 +0000 (22:40 +0000)]
[llvm-objdump] Emit addresses with the correct number of leading 0's.

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

11 years ago[msan] Change va_start/va_copy shadow memset alignment to 8.
Peter Collingbourne [Thu, 10 Jan 2013 22:36:33 +0000 (22:36 +0000)]
[msan] Change va_start/va_copy shadow memset alignment to 8.

This fixes va_start/va_copy of a va_list field which happens to not
be laid out at a 16-byte boundary.

Differential Revision: http://llvm-reviews.chandlerc.com/D276

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

11 years agoRemove trailing spaces.
Jakub Staszak [Thu, 10 Jan 2013 22:14:33 +0000 (22:14 +0000)]
Remove trailing spaces.

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

11 years agoPR14896: Handle memcpy from constant string where the memcpy size is larger than...
Evan Cheng [Thu, 10 Jan 2013 22:13:27 +0000 (22:13 +0000)]
PR14896: Handle memcpy from constant string where the memcpy size is larger than the string size.

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

11 years agoRemove unneeded includes from FunctionLoweringInfo.h.
Jakub Staszak [Thu, 10 Jan 2013 22:13:13 +0000 (22:13 +0000)]
Remove unneeded includes from FunctionLoweringInfo.h.

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

11 years ago[ms-inline asm] Add support for calling functions from inline assembly.
Chad Rosier [Thu, 10 Jan 2013 22:10:27 +0000 (22:10 +0000)]
[ms-inline asm] Add support for calling functions from inline assembly.
Part of rdar://12991541

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

11 years agoRemove unneeded #includes.
Jakub Staszak [Thu, 10 Jan 2013 22:07:29 +0000 (22:07 +0000)]
Remove unneeded #includes.

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

11 years agoTeach InstCombine to hoist FABS and FNEG through FPTRUNC instructions. The applicati...
Owen Anderson [Thu, 10 Jan 2013 22:06:52 +0000 (22:06 +0000)]
Teach InstCombine to hoist FABS and FNEG through FPTRUNC instructions.  The application of these operations commutes with the truncation, so we should prefer to do them in the smallest size we can, to save register space, use smaller constant pool entries, etc.

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

11 years agoFix indent and remove unneeded #includes in MDBuilder.h.
Jakub Staszak [Thu, 10 Jan 2013 22:00:36 +0000 (22:00 +0000)]
Fix indent and remove unneeded #includes in MDBuilder.h.

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

11 years agoFix #includes after my last commit.
Jakub Staszak [Thu, 10 Jan 2013 21:56:40 +0000 (21:56 +0000)]
Fix #includes after my last commit.

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

11 years agoRename LinkAllVMCore.h to LinkAllIR.h since VMCore directory was renamed to IR.
Jakub Staszak [Thu, 10 Jan 2013 21:55:02 +0000 (21:55 +0000)]
Rename LinkAllVMCore.h to LinkAllIR.h since VMCore directory was renamed to IR.

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

11 years agoremove the rest of the "written by" lines in the documentation. It is
Chris Lattner [Thu, 10 Jan 2013 21:24:04 +0000 (21:24 +0000)]
remove the rest of the "written by" lines in the documentation.  It is
against the developer policy to include this sort of thing as SVN blame
already captures this in a far more fine-grained way.

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

11 years agoReplace memcpys by a static_cast and an integral promotion.
Dmitri Gribenko [Thu, 10 Jan 2013 21:21:32 +0000 (21:21 +0000)]
Replace memcpys by a static_cast and an integral promotion.

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

11 years agoFix coding style
Dmitri Gribenko [Thu, 10 Jan 2013 21:10:44 +0000 (21:10 +0000)]
Fix coding style

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

11 years agoUnbreak tests after regression from r172081.
Jakub Staszak [Thu, 10 Jan 2013 21:02:05 +0000 (21:02 +0000)]
Unbreak tests after regression from r172081.

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

11 years agoAdd basic fix-its to SMDiagnostic.
Jordan Rose [Thu, 10 Jan 2013 18:50:15 +0000 (18:50 +0000)]
Add basic fix-its to SMDiagnostic.

Like Clang's FixItHint, SMFixIt represents an insertion, replacement, or
removal of source text. One or more fix-its can be emitted as part of
a diagnostic, and will be printed below the source range line to show the
user how they can fix their code.

Currently, the only client of SMFixIt is clang-tblgen; thus, the tests for
this behavior live in clang/test/TableGen/tg-fixits.td. If/when SMFixIt is
adopted within LLVM itself, those tests should be moved to the LLVM suite.

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

11 years agoTableGen: Keep track of superclass reference ranges.
Jordan Rose [Thu, 10 Jan 2013 18:50:11 +0000 (18:50 +0000)]
TableGen: Keep track of superclass reference ranges.

def foo : bar;
          ~~~

This allows us to produce more precise diagnostics about a certain
superclass, and even provide fixits.

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

11 years agoTableGen: record anonymous instantiations of classes.
Jordan Rose [Thu, 10 Jan 2013 18:50:05 +0000 (18:50 +0000)]
TableGen: record anonymous instantiations of classes.

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

11 years agoAllow hasProperty() to be called on bundle-internal instructions.
Jakob Stoklund Olesen [Thu, 10 Jan 2013 18:42:44 +0000 (18:42 +0000)]
Allow hasProperty() to be called on bundle-internal instructions.

When calling hasProperty() on an instruction inside a bundle, it should
always behave as if IgnoreBundle was passed, and just return properties
for the current instruction.

Only attempt to aggregate bundle properties whan asked about the bundle
header.

The assertion fires on existing ARM test cases without this fix.

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

11 years agoFix Alias Bug
David Greene [Thu, 10 Jan 2013 18:17:54 +0000 (18:17 +0000)]
Fix Alias Bug

Use memcpy to do type punning instead of a cast.  A cast or similar
operation through a union breaks strict aliasing rules.

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

11 years agoLoopVectorizer: Fix a bug in the vectorization of BinaryOperators. The BinaryOperator...
Nadav Rotem [Thu, 10 Jan 2013 17:34:39 +0000 (17:34 +0000)]
LoopVectorizer: Fix a bug in the vectorization of BinaryOperators. The BinaryOperator can be folded to an Undef, and we don't want to set NSW flags to undef vals.

PR14878

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

11 years agoRemove locale-dependence of enum mangling and use existing function.
Tim Northover [Thu, 10 Jan 2013 16:47:31 +0000 (16:47 +0000)]
Remove locale-dependence of enum mangling and use existing function.

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

11 years agoMake TableGen mangle operand method names before putting in enum.
Tim Northover [Thu, 10 Jan 2013 15:17:36 +0000 (15:17 +0000)]
Make TableGen mangle operand method names before putting in enum.

The purpose of this patch is to allow PredicateMethods to be set to something
like "isUImm<8>", calling a C++ template method to reduce code duplication. For
this to work, the PredicateMethod must be mangled into a valid C++ identifier
for insertion into an enum.

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

11 years agoFix a copy/paste error in the IR Linker, casting an ArrayType instead of a VectorType.
Joey Gouly [Thu, 10 Jan 2013 10:49:36 +0000 (10:49 +0000)]
Fix a copy/paste error in the IR Linker, casting an ArrayType instead of a VectorType.

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

11 years agoFix TryToShrinkGlobalToBoolean in GlobalOpt, so that it does not discard address...
Joey Gouly [Thu, 10 Jan 2013 10:31:11 +0000 (10:31 +0000)]
Fix TryToShrinkGlobalToBoolean in GlobalOpt, so that it does not discard address spaces.

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

11 years agodocs: fix broken link.
Sean Silva [Thu, 10 Jan 2013 06:39:37 +0000 (06:39 +0000)]
docs: fix broken link.

PR14889

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

11 years agoSignal.h: Add <cstdio> for FILE*, since r171989.
NAKAMURA Takumi [Thu, 10 Jan 2013 05:23:59 +0000 (05:23 +0000)]
Signal.h: Add <cstdio> for FILE*, since r171989.

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

11 years ago[ObjCARC Debug Message] Added debug message when we convert an autorelease into an...
Michael Gottesman [Thu, 10 Jan 2013 02:03:50 +0000 (02:03 +0000)]
[ObjCARC Debug Message] Added debug message when we convert an autorelease into an autoreleaseRV.

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

11 years agoFix a race condition in the lock-file manager: once the lock file is
Douglas Gregor [Thu, 10 Jan 2013 02:01:35 +0000 (02:01 +0000)]
Fix a race condition in the lock-file manager: once the lock file is
gone, check for the actual file we care about.

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

11 years agoFix a race condition in llvm::sys::path::unique_file: when we end up
Douglas Gregor [Thu, 10 Jan 2013 01:58:46 +0000 (01:58 +0000)]
Fix a race condition in llvm::sys::path::unique_file: when we end up
failing to create the unique file because the path doesn't exist,
don't fail if someone else manages to create the path before we do.

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

11 years agoSupport headerless bundles in MachineInstr::hasProperty().
Jakob Stoklund Olesen [Thu, 10 Jan 2013 01:29:42 +0000 (01:29 +0000)]
Support headerless bundles in MachineInstr::hasProperty().

This function can still work without a BUNDLE header instruction.

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

11 years agoStack Alignment: throw error if we can't satisfy the minimal alignment
Manman Ren [Thu, 10 Jan 2013 01:10:10 +0000 (01:10 +0000)]
Stack Alignment: throw error if we can't satisfy the minimal alignment
requirement when creating stack objects in MachineFrameInfo.

Add CreateStackObjectWithMinAlign to throw error when the minimal alignment
can't be achieved and to clamp the alignment when the preferred alignment
can't be achieved. Same is true for CreateVariableSizedObject.
Will not emit error in CreateSpillStackObject or CreateStackObject.

As long as callers of CreateStackObject do not assume the object will be
aligned at the requested alignment, we should not have miscompile since
later optimizations which look at the object's alignment will have the correct
information.

rdar://12713765

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

11 years ago[Object][Archive] Fix name handling with bsd style long names.
Michael J. Spencer [Thu, 10 Jan 2013 01:05:34 +0000 (01:05 +0000)]
[Object][Archive] Fix name handling with bsd style long names.

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

11 years agoFix include guards so they exactly match file names.
Jakub Staszak [Thu, 10 Jan 2013 00:45:19 +0000 (00:45 +0000)]
Fix include guards so they exactly match file names.

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

11 years ago[Object][Archive] Apparently StringRef::getAsInteger for APInt accepts spaces.
Michael J. Spencer [Thu, 10 Jan 2013 00:07:38 +0000 (00:07 +0000)]
[Object][Archive] Apparently StringRef::getAsInteger for APInt accepts spaces.

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

11 years agoRevert s/Raw/getBitMask/g name change. This is possibly causing LTO test hangings.
Bill Wendling [Wed, 9 Jan 2013 23:36:50 +0000 (23:36 +0000)]
Revert s/Raw/getBitMask/g name change. This is possibly causing LTO test hangings.

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

11 years ago[Object][Archive] Use uint64_t instead of APInt. It is significantly faster.
Michael J. Spencer [Wed, 9 Jan 2013 22:58:43 +0000 (22:58 +0000)]
[Object][Archive] Use uint64_t instead of APInt. It is significantly faster.

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

11 years agoFix description of ARMOperand
Joel Jones [Wed, 9 Jan 2013 22:34:16 +0000 (22:34 +0000)]
Fix description of ARMOperand

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

11 years agoARM Cost model: Use the size of vector registers and widest vectorizable instruction...
Nadav Rotem [Wed, 9 Jan 2013 22:29:00 +0000 (22:29 +0000)]
ARM Cost model: Use the size of vector registers and widest vectorizable instruction to determine the max vectorization factor.

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

11 years agoDisable -Wuninitialized for gcc
David Greene [Wed, 9 Jan 2013 22:11:13 +0000 (22:11 +0000)]
Disable -Wuninitialized for gcc

If the compiler is gcc, disable variants of -Wuninitialized depending
on the gcc version.  This gets a lot of false positive warnings out of
the build.

Generate a new configure for the gcc -Wno-uninitialized fix.

Pick up -Wno-uninitialized from configure

Add the option -Wno[-maybe]-uninitialized as determined by configure.

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

11 years agoFix a DAG combine bug visitBRCOND() is transforming br(xor(x, y)) to br(x != y).
Evan Cheng [Wed, 9 Jan 2013 20:56:40 +0000 (20:56 +0000)]
Fix a DAG combine bug visitBRCOND() is transforming br(xor(x, y)) to br(x != y).
It cahced XOR's operands before calling visitXOR() but failed to update the
operands when visitXOR changed the XOR node.

rdar://12968664

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

11 years agoMove the internal PrintStackTrace function that is used for llvm::sys::PrintStackTrac...
Argyrios Kyrtzidis [Wed, 9 Jan 2013 19:42:40 +0000 (19:42 +0000)]
Move the internal PrintStackTrace function that is used for llvm::sys::PrintStackTraceOnErrorSignal(),
into a new function llvm::sys::PrintStackTrace, so that it's available to clients for logging purposes.

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

11 years ago[ObjCARC Debug Messages] This is a squashed commit of 3x debug message commits ala...
Michael Gottesman [Wed, 9 Jan 2013 19:23:24 +0000 (19:23 +0000)]
[ObjCARC Debug Messages] This is a squashed commit of 3x debug message commits ala echristo's suggestion.

1. Added debug messages when in OptimizeIndividualCalls we move calls into predecessors and then erase the original call.
2. Added debug messages when in the process of moving calls in ObjCARCOpt::MoveCalls we create new RR and delete old RR.
3. Added a debug message when we visit a specific retain instruction in ObjCARCOpt::PerformCodePlacement.

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

11 years agoDon't print bundle flags.
Jakob Stoklund Olesen [Wed, 9 Jan 2013 18:35:09 +0000 (18:35 +0000)]
Don't print bundle flags.

The bundle flags are used by MachineBasicBlock::print(), they don't need
to clutter up individual MachineInstrs.

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

11 years agoDon't require BUNDLE headers in MachineInstr::getBundleSize().
Jakob Stoklund Olesen [Wed, 9 Jan 2013 18:28:16 +0000 (18:28 +0000)]
Don't require BUNDLE headers in MachineInstr::getBundleSize().

It is possible to build MI bundles that don't begin with a BUNDLE
header. Add support for such bundles, counting all instructions inside
the bundle.

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

11 years agoLICM: Hoist insertvalue/extractvalue out of loops.
Benjamin Kramer [Wed, 9 Jan 2013 18:12:03 +0000 (18:12 +0000)]
LICM: Hoist insertvalue/extractvalue out of loops.

Fixes PR14854.

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

11 years agoFix a typo in MachineInstr::unbundleFromSucc() method.
Sergei Larin [Wed, 9 Jan 2013 17:54:33 +0000 (17:54 +0000)]
Fix a typo in MachineInstr::unbundleFromSucc() method.

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

11 years agoPowerPC: EH adjustments
Adhemerval Zanella [Wed, 9 Jan 2013 17:08:15 +0000 (17:08 +0000)]
PowerPC: EH adjustments

This patch adjust the r171506 to make all DWARF enconding pc-relative
for PPC64. It also adds the R_PPC64_REL32 relocation handling in MCJIT
(since the eh_frame will not generate PIC-relative relocation) and also
adds the emission of stubs created by the TTypeEncoding.

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

11 years agoadd hexagon flags in ELF.h
Shankar Easwaran [Wed, 9 Jan 2013 16:34:46 +0000 (16:34 +0000)]
add hexagon flags in ELF.h

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

11 years agoFor some LLVM-as-library uses it is convenient to create a
David Tweed [Wed, 9 Jan 2013 16:21:47 +0000 (16:21 +0000)]
For some LLVM-as-library uses it is convenient to create a
subclass of TargetMachine which "forwards" all operations to an
existing internal TargetMachine member variable. In the usage context the
specific-machine class derived from TargetMachine is not visible,
only a reference to the generic base class TargetMachine. Although
getSubtargetImpl() is public in specific-machine classes derived from
TargetMachine, the TargetMachine class unfortunately has
getSubtargetImpl() protected (and accessing non-const members makes
abusing getSubtarget() unsuitable). Making it public in the base class
allows this forwarding pattern.

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

11 years agoConfigure: if we compile with clang, check that it is not broken
Dmitri Gribenko [Wed, 9 Jan 2013 15:25:30 +0000 (15:25 +0000)]
Configure: if we compile with clang, check that it is not broken

Some linux distibutions (for example, Mageia 2, Fedora 17) ship Clang that is
essentially broken for the end user.  Clang can not find or compile libstdc++
headers.

The issue is that our configure prefers clang over gcc, thus selecting a broken
Clang when a working GCC is available.

Now we detect this issue by compiling a simple program.  If it does not
compile, configure stops with an error suggesting the user to select a
different compiler.

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

11 years agoCheck whether MCInst operand isImm before calling getImm.
Tim Northover [Wed, 9 Jan 2013 13:32:04 +0000 (13:32 +0000)]
Check whether MCInst operand isImm before calling getImm.

When processing possible aliases, TableGen assumes that if an operand *can* be
an immediate, then it always *will* be. This is incorrect for the AArch64
backend. This patch inserts a check in the generated code to make sure isImm is
true first.

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

11 years agoRefactor to expose RTLIB calls to targets.
Tim Northover [Wed, 9 Jan 2013 13:18:15 +0000 (13:18 +0000)]
Refactor to expose RTLIB calls to targets.

fp128 is almost but not quite completely illegal as a type on AArch64. As a
result it needs to have a register class (for argument passing mainly), but all
operations need to be lowered to runtime calls. Currently there's no way for
targets to do this (without duplicating code), as the relevant functions are
hidden in SelectionDAG. This patch changes that.

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

11 years agoIncrase the number of parameters for AlignedCharArrayUnion.
Manuel Klimek [Wed, 9 Jan 2013 10:39:16 +0000 (10:39 +0000)]
Incrase the number of parameters for AlignedCharArrayUnion.

We need this to correctly fix ASTMatchers/ASTTypeTraits.h in clang.

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

11 years agoAlter the hasing computation when inserting into the folding set.
Bill Wendling [Wed, 9 Jan 2013 09:26:23 +0000 (09:26 +0000)]
Alter the hasing computation when inserting into the folding set.

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

11 years agoadd -march to the test
Nadav Rotem [Wed, 9 Jan 2013 07:04:23 +0000 (07:04 +0000)]
add -march to the test

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

11 years agotblgen: use an early return to reduce indentation.
Sean Silva [Wed, 9 Jan 2013 05:28:12 +0000 (05:28 +0000)]
tblgen: use an early return to reduce indentation.

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

11 years agoEfficient lowering of vector sdiv when the divisor is a splatted power of two constant.
Nadav Rotem [Wed, 9 Jan 2013 05:14:33 +0000 (05:14 +0000)]
Efficient lowering of vector sdiv when the divisor is a splatted power of two constant.
PR 14848. The lowered sequence is based on the existing sequence the target-independent
DAG Combiner creates for the scalar case.

Patch by Zvi Rackover.

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

11 years agotblgen: Factor out common code.
Sean Silva [Wed, 9 Jan 2013 04:49:14 +0000 (04:49 +0000)]
tblgen: Factor out common code.

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

11 years agoLast in the series of removing unnecessary '0' arguments for
Eric Christopher [Wed, 9 Jan 2013 03:52:05 +0000 (03:52 +0000)]
Last in the series of removing unnecessary '0' arguments for
address space. Reordered the EmitULEB128IntValue arguments to
make this easier.

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

11 years agoMIsched: add an ILP window property to machine model.
Andrew Trick [Wed, 9 Jan 2013 03:36:49 +0000 (03:36 +0000)]
MIsched: add an ILP window property to machine model.

This was an experimental option, but needs to be defined
per-target. e.g. PPC A2 needs to aggressively hide latency.

I converted some in-order scheduling tests to A2. Hal is working on
more test cases.

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

11 years ago[Object, DebugInfo] Make DWARFContext BE-aware.
NAKAMURA Takumi [Wed, 9 Jan 2013 02:45:05 +0000 (02:45 +0000)]
[Object, DebugInfo] Make DWARFContext BE-aware.

test/DebugInfo/member-pointers.ll would not fail in targetting BE any more.

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

11 years agoTableGen/LangRef: link bang operators into the productionlist
Sean Silva [Wed, 9 Jan 2013 02:20:31 +0000 (02:20 +0000)]
TableGen/LangRef: link bang operators into the productionlist

Now BangOperator should be nicely hyperlinked.

Pointed out by Joel Jones.

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

11 years agoTableGen/LangRef: discuss specific C-like escapes
Sean Silva [Wed, 9 Jan 2013 02:20:30 +0000 (02:20 +0000)]
TableGen/LangRef: discuss specific C-like escapes

Suggested by Joel Jones.

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

11 years agodocs: Fix mention of DefmID to MultiClassID.
Sean Silva [Wed, 9 Jan 2013 02:20:24 +0000 (02:20 +0000)]
docs: Fix mention of DefmID to MultiClassID.

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

11 years agoInline this into its only caller.
Sean Silva [Wed, 9 Jan 2013 02:17:14 +0000 (02:17 +0000)]
Inline this into its only caller.

It's clearer and additionally this gets rid of the usage of `DefmID`,
which doesn't really correspond to anything in the language (it was just
used in the name of this parsing function which parsed a `MultiClassID`
and returned that multiclass's record).

This area of the code still needs a lot of work.

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