platform/upstream/llvm.git
10 years agoRemove unused variable to fix clang warning
Reid Kleckner [Fri, 3 Jan 2014 00:36:32 +0000 (00:36 +0000)]
Remove unused variable to fix clang warning

llvm-svn: 198382

10 years ago[ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cpp
Reid Kleckner [Fri, 3 Jan 2014 00:14:35 +0000 (00:14 +0000)]
[ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cpp

Summary:
No functionality change.

This code should live here long-term because we should be able to use it
to compute correct vftable names.

It turns out that the most natural way to implement the naming algorithm
is to use a caching layer similar to what we already have for virtual
table info in VTableContext.  Subsequent changes will take advantage of
this to fix PR17748, where we have a vbtable name collision.

Reviewers: majnemer

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2499

llvm-svn: 198380

10 years agoFix break introduced in r198377 due to using a local type as a template parameter.
David Blaikie [Fri, 3 Jan 2014 00:00:41 +0000 (00:00 +0000)]
Fix break introduced in r198377 due to using a local type as a template parameter.

llvm-svn: 198379

10 years agoTest coverage for non-default-constructible elements in a StringMap
David Blaikie [Thu, 2 Jan 2014 23:57:28 +0000 (23:57 +0000)]
Test coverage for non-default-constructible elements in a StringMap

This functionality was enabled by r198374. Here's a test to ensure it
works and we don't regress it.

Based on a patch by Maciej Piechotka.

llvm-svn: 198377

10 years agoIntroduce -polly-canonicalize pass
Tobias Grosser [Thu, 2 Jan 2014 23:39:18 +0000 (23:39 +0000)]
Introduce -polly-canonicalize pass

This ModulePass schedules the set of Polly canonicalization passes. It is a
debugging tool that can be used to preoptimize .ll files for Polly processing.

llvm-svn: 198376

10 years agoRemoved an unnecessary %select from the alignas diagnostics. The attribute already...
Aaron Ballman [Thu, 2 Jan 2014 23:39:11 +0000 (23:39 +0000)]
Removed an unnecessary %select from the alignas diagnostics. The attribute already knows how it was spelled.

llvm-svn: 198375

10 years agoRemove StringMapEntryInitializer support.
David Blaikie [Thu, 2 Jan 2014 23:28:39 +0000 (23:28 +0000)]
Remove StringMapEntryInitializer support.

It was never specialized so let's just remove that unused
configurability and always do the default.

llvm-svn: 198374

10 years agoThis diagnostic should not have had the manual quotation marks. Its only usage passed...
Aaron Ballman [Thu, 2 Jan 2014 23:22:40 +0000 (23:22 +0000)]
This diagnostic should not have had the manual quotation marks. Its only usage passed in an Attr object, which was already quoted when printing the diagnostic. However, there was no test case that caught this bug -- one has been added.

llvm-svn: 198373

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics. Updated...
Aaron Ballman [Thu, 2 Jan 2014 23:15:58 +0000 (23:15 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics. Updated the associated testcase because QualType pretty printing was an improvement.

llvm-svn: 198372

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Thu, 2 Jan 2014 23:02:01 +0000 (23:02 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

llvm-svn: 198371

10 years agoRegisterPasses: Do not claim we schedule canonicalization passes at -O0
Tobias Grosser [Thu, 2 Jan 2014 22:48:50 +0000 (22:48 +0000)]
RegisterPasses: Do not claim we schedule canonicalization passes at -O0

Also the code makes the impression this was happening, shouldEnablePolly()
always returns false for optlevel equal to zero. This was previously different,
but was accidentally changed by a commit a couple of months ago. As this
behavior was mainly a debugging tool and adding this to clang never really made
sense, we just remove the last traces.

llvm-svn: 198370

10 years ago[RegAlloc] Make tryInstructionSplit less aggressive.
Quentin Colombet [Thu, 2 Jan 2014 22:47:22 +0000 (22:47 +0000)]
[RegAlloc] Make tryInstructionSplit less aggressive.

The greedy register allocator tries to split a live-range around each
instruction where it is used or defined to relax the constraints on the entire
live-range (this is a last chance split before falling back to spill).
The goal is to have a big live-range that is unconstrained (i.e., that can use
the largest legal register class) and several small local live-range that carry
the constraints implied by each instruction.
E.g.,
Let csti be the constraints on operation i.

V1=
op1 V1(cst1)
op2 V1(cst2)

V1 live-range is constrained on the intersection of cst1 and cst2.

tryInstructionSplit relaxes those constraints by aggressively splitting each
def/use point:
V1=
V2 = V1
V3 = V2
op1 V3(cst1)
V4 = V2
op2 V4(cst2)

Because of how the coalescer infrastructure works, each new variable (V3, V4)
that is alive at the same time as V1 (or its copy, here V2) interfere with V1.
Thus, we end up with an uncoalescable copy for each split point.

To make tryInstructionSplit less aggressive, we check if the split point
actually relaxes the constraints on the whole live-range. If it does not, we do
not insert it.
Indeed, it will not help the global allocation problem:
- V1 will have the same constraints.
- V1 will have the same interference + possibly the newly added split variable
  VS.
- VS will produce an uncoalesceable copy if alive at the same time as V1.

<rdar://problem/15570057>

llvm-svn: 198369

10 years agoReworded the NSObject attribute diagnostics to be more consistent with other attribut...
Aaron Ballman [Thu, 2 Jan 2014 22:45:33 +0000 (22:45 +0000)]
Reworded the NSObject attribute diagnostics to be more consistent with other attribute diagnostics. Also updated the associated test case.

llvm-svn: 198368

10 years agoObjectiveC. Remove false positive warning for missing property
Fariborz Jahanian [Thu, 2 Jan 2014 22:42:09 +0000 (22:42 +0000)]
ObjectiveC. Remove false positive warning for missing property
backing ivar by not issuing this warning if ivar is referenced
somewhere and accessor makes method calls. // rdar://15727325

llvm-svn: 198367

10 years agoRemoving some manual quotes from this diagnostic, since the AST diagnostics engine...
Aaron Ballman [Thu, 2 Jan 2014 22:29:41 +0000 (22:29 +0000)]
Removing some manual quotes from this diagnostic, since the AST diagnostics engine knows how to handle NamedDecl objects.

llvm-svn: 198365

10 years agoScopInfo: Ensure the RegionInfo analysis is always available
Tobias Grosser [Thu, 2 Jan 2014 22:28:53 +0000 (22:28 +0000)]
ScopInfo: Ensure the RegionInfo analysis is always available

This fixes a crash that appeared when generating dotty graphs for functions
without loops (for which we do not calculate polyhedral information).

llvm-svn: 198364

10 years ago[PPC] Fix comment to match function name
Hal Finkel [Thu, 2 Jan 2014 22:09:39 +0000 (22:09 +0000)]
[PPC] Fix comment to match function name

llvm-svn: 198362

10 years agoRemove comments on CU skeleton construction, they're probably
Eric Christopher [Thu, 2 Jan 2014 22:04:47 +0000 (22:04 +0000)]
Remove comments on CU skeleton construction, they're probably
obvious.

llvm-svn: 198361

10 years ago[PPC] Fix the scheduling of CR logicals on the P7
Hal Finkel [Thu, 2 Jan 2014 21:38:26 +0000 (21:38 +0000)]
[PPC] Fix the scheduling of CR logicals on the P7

CR logicals (crand, crxor, etc.) on the P7 need to be in the first slot of each
dispatch group. The old itinerary entry was just wrong (but has not mattered
because we don't generate these instructions).

This will matter when, in an upcoming commit, we start generating these
instructions.

llvm-svn: 198359

10 years agoElaborate on comment for skeleton CU construction.
Eric Christopher [Thu, 2 Jan 2014 21:38:18 +0000 (21:38 +0000)]
Elaborate on comment for skeleton CU construction.

llvm-svn: 198358

10 years agoRevert seemingly unnecessary section sym for the data section.
Eric Christopher [Thu, 2 Jan 2014 21:38:13 +0000 (21:38 +0000)]
Revert seemingly unnecessary section sym for the data section.

llvm-svn: 198357

10 years ago[PPC] Use the correct immediate operands on 64-bit instructions
Hal Finkel [Thu, 2 Jan 2014 21:26:59 +0000 (21:26 +0000)]
[PPC] Use the correct immediate operands on 64-bit instructions

Several of the 64-bit fixed-point instructions with immediate operands were
using the 32-bit (i32) operand nodes instead of the corresponding 64-bit (i64)
operand definitions (u16imm instead of u16imm64, for example).

This error has had no effect so far, but would have caused type-checking
violations with an upcoming change.

llvm-svn: 198356

10 years agoUpdated the wording of two attribute-related diagnostics so that they print the offen...
Aaron Ballman [Thu, 2 Jan 2014 21:26:14 +0000 (21:26 +0000)]
Updated the wording of two attribute-related diagnostics so that they print the offending attribute name. Also updates the associated test cases.

llvm-svn: 198355

10 years agoDisable compare sinking in CodeGenPrepare when multiple condition registers are available
Hal Finkel [Thu, 2 Jan 2014 21:13:43 +0000 (21:13 +0000)]
Disable compare sinking in CodeGenPrepare when multiple condition registers are available

As noted in the comment above CodeGenPrepare::OptimizeInst, which aggressively
sinks compares to reduce pressure on the condition register(s), for targets
such as PowerPC with multiple condition registers, this may not be the right
thing to do. This adds an HasMultipleConditionRegisters boolean to TLI, and
CodeGenPrepare::OptimizeInst is skipped when HasMultipleConditionRegisters is
true.

This functionality will be used by the PowerPC backend in an upcoming commit.
Especially when the PowerPC backend starts tracking individual condition
register bits as separate allocatable entities (which will happen in this
upcoming commit), this sinking from CodeGenPrepare::OptimizeInst is
significantly suboptimial.

llvm-svn: 198354

10 years agoindvars: cleanup the IV visitor. It does more than gather sext/zext info.
Andrew Trick [Thu, 2 Jan 2014 21:12:11 +0000 (21:12 +0000)]
indvars: cleanup the IV visitor. It does more than gather sext/zext info.

llvm-svn: 198353

10 years agoFix all the verifier tests I added for address spaces.
Matt Arsenault [Thu, 2 Jan 2014 21:09:05 +0000 (21:09 +0000)]
Fix all the verifier tests I added for address spaces.

I originally had these using opt -verify, and I never removed the
-verify when converting them to use llvm-as instead, so these were
failing because of using the -verify argument which llvm-as doesn't have
instead of what it's actually supposed to be testing.

llvm-svn: 198352

10 years agoFix up a couple of review comments:
Eric Christopher [Thu, 2 Jan 2014 21:03:28 +0000 (21:03 +0000)]
Fix up a couple of review comments:

Use an if statement instead of a pair of ternary operators checking
the same condition.
Use a cheap method call rather than returning the local symbol.

llvm-svn: 198351

10 years agoSimplify conditional.
Eric Christopher [Thu, 2 Jan 2014 21:03:22 +0000 (21:03 +0000)]
Simplify conditional.

llvm-svn: 198350

10 years agoAllow addrspacecast in global aliases
Matt Arsenault [Thu, 2 Jan 2014 20:55:01 +0000 (20:55 +0000)]
Allow addrspacecast in global aliases

llvm-svn: 198349

10 years ago[TableGen] Correctly generate implicit anonymous prototype defs in multiclasses
Hal Finkel [Thu, 2 Jan 2014 20:47:09 +0000 (20:47 +0000)]
[TableGen] Correctly generate implicit anonymous prototype defs in multiclasses

Even within a multiclass, we had been generating concrete implicit anonymous
defs when parsing values (generally in value lists). This behavior was
incorrect, and led to errors when multiclass parameters were used in the
parameter list of the implicit anonymous def.

If we had some multiclass:

multiclass mc<string n> {

 ... : SomeClass<SomeOtherClass<n> >

The capture of the multiclass parameter 'n' would not work correctly, and
depending on how the implicit SomeOtherClass was used, either TableGen would
ignore something it shouldn't, or would crash.

To fix this problem, when inside a multiclass, we generate prototype anonymous
defs for implicit anonymous defs (just as we do for explicit anonymous defs).
Within the multiclass, the current record prototype is populated with a node
that is essentially: !cast<SomeOtherClass>(!strconcat(NAME, anon_value_name)).
This is then resolved to the correct concrete anonymous def, in the usual way,
when NAME is resolved during multiclass instantiation.

llvm-svn: 198348

10 years ago[TableGen] Handle ValueType in CodeGenDAGPatterns GetNumNodeResults
Hal Finkel [Thu, 2 Jan 2014 20:47:05 +0000 (20:47 +0000)]
[TableGen] Handle ValueType in CodeGenDAGPatterns GetNumNodeResults

A ValueType in a pattern dag is a type cast, and GetNumNodeResults should
handle it (the type cast has only one result).

This comes up, for example, during the type checking of pattern fragments, for
example, AArch64's Neon_combine_2d fragment is:
  dag Operands = (ops node:$Rm, node:$Rn);
  dag Fragment = (v2f64 (concat_vectors (v1f64 node:$Rm), (v1f64 node:$Rn)));

llvm-svn: 198347

10 years agoDelete unread globals through addrspacecast
Matt Arsenault [Thu, 2 Jan 2014 20:01:43 +0000 (20:01 +0000)]
Delete unread globals through addrspacecast

llvm-svn: 198346

10 years agoFix addrspacecast with metadata globals
Matt Arsenault [Thu, 2 Jan 2014 19:53:49 +0000 (19:53 +0000)]
Fix addrspacecast with metadata globals

llvm-svn: 198345

10 years ago[CMake] Add missing set_output_directory after Takumi's change in r198205.
Jordan Rose [Thu, 2 Jan 2014 19:47:45 +0000 (19:47 +0000)]
[CMake] Add missing set_output_directory after Takumi's change in r198205.

Plugins need to go in build/Debug/lib as well (rather than build/lib/Debug).

Also, fix the SHLIBDIR path for Xcode, which by default includes Xcode build
settings rather than a simple %(build_mode)s parameter.

llvm-svn: 198344

10 years agoObjective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.
Douglas Gregor [Thu, 2 Jan 2014 19:42:02 +0000 (19:42 +0000)]
Objective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.

Fixes <rdar://problem/15713945>.

llvm-svn: 198343

10 years agoRemove redundant fold call introduced in r195944. Thanks very much to Juergen
Lang Hames [Thu, 2 Jan 2014 19:38:41 +0000 (19:38 +0000)]
Remove redundant fold call introduced in r195944. Thanks very much to Juergen
for pointing this out.

llvm-svn: 198341

10 years ago[TableGen] Use the same anonymous name as the prefix on all multiclass defs
Hal Finkel [Thu, 2 Jan 2014 19:35:33 +0000 (19:35 +0000)]
[TableGen] Use the same anonymous name as the prefix on all multiclass defs

TableGen had been generating a different name for an anonymous multiclass's
NAME for every def in the multiclass. This had an unfortunate side effect: it
was impossible to reference one def within the multiclass from another (in the
parameter list, for example). By making sure we only generate an anonymous name
once per multiclass (which, as it turns out, requires only changing the name
parameter to reference type), we can now concatenate NAME within the multiclass
with a def name in order to generate a reference to that def.

This does not matter so much, in and of itself, but is necessary for a
follow-up commit that will fix variable capturing in implicit anonymous
multiclass defs (and that is important).

llvm-svn: 198340

10 years agoNo else after return.
Joerg Sonnenberger [Thu, 2 Jan 2014 19:30:56 +0000 (19:30 +0000)]
No else after return.

llvm-svn: 198339

10 years agoindvars: insert truncate at loop boundary to avoid redundant IVs.
Andrew Trick [Thu, 2 Jan 2014 19:29:38 +0000 (19:29 +0000)]
indvars: insert truncate at loop boundary to avoid redundant IVs.

When widening an IV to remove s/zext, we generally try to eliminate
the original narrow IV. However, LCSSA phi nodes outside the loop were
still using the original IV. Clean this up more aggressively to avoid
redundancy in generated code.

llvm-svn: 198338

10 years agoAdd default search path if -nostdlib is not provided.
Joerg Sonnenberger [Thu, 2 Jan 2014 19:18:36 +0000 (19:18 +0000)]
Add default search path if -nostdlib is not provided.
Add basic emulation mapping for NetBSD/amd64, so that clang -m32 works
as expected.

llvm-svn: 198337

10 years agoMark REX64_PREFIX as In64BitMode, remove hack from X86RecognizableInstr.
Craig Topper [Thu, 2 Jan 2014 19:12:10 +0000 (19:12 +0000)]
Mark REX64_PREFIX as In64BitMode, remove hack from X86RecognizableInstr.

llvm-svn: 198336

10 years agoCMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.
Douglas Gregor [Thu, 2 Jan 2014 19:07:19 +0000 (19:07 +0000)]
CMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.

llvm-svn: 198335

10 years agoMake llvm::Regex non-copyable but movable.
David Blaikie [Thu, 2 Jan 2014 19:04:59 +0000 (19:04 +0000)]
Make llvm::Regex non-copyable but movable.

Based on a patch by Maciej Piechotka.

llvm-svn: 198334

10 years agoRevert "Debug info: Add enumerators to the __apple_names accelerator table."
Adrian Prantl [Thu, 2 Jan 2014 18:48:24 +0000 (18:48 +0000)]
Revert "Debug info: Add enumerators to the __apple_names accelerator table."

This reverts r197927 until the discussion on llvm-commits comes to a
conclusion.

llvm-svn: 198333

10 years agoRemove unused HasFROperands field from disassembler.
Craig Topper [Thu, 2 Jan 2014 18:44:21 +0000 (18:44 +0000)]
Remove unused HasFROperands field from disassembler.

llvm-svn: 198332

10 years agoCMake separate projects: finish output-directory changes.
Douglas Gregor [Thu, 2 Jan 2014 18:37:47 +0000 (18:37 +0000)]
CMake separate projects: finish output-directory changes.

Make sure clang-tblgen, clang++, and clang-cl get created in the Clang
binary build directory.

llvm-svn: 198331

10 years agoUse LLVM_STATIC_ASSERT rather than a hand-rolled implementation.
David Blaikie [Thu, 2 Jan 2014 18:29:40 +0000 (18:29 +0000)]
Use LLVM_STATIC_ASSERT rather than a hand-rolled implementation.

llvm-svn: 198330

10 years ago[CMake] Add missing set_output_directory after Takumi's change in r198205.
Jordan Rose [Thu, 2 Jan 2014 18:28:32 +0000 (18:28 +0000)]
[CMake] Add missing set_output_directory after Takumi's change in r198205.

In a standalone build, Clang binaries should end up in Clang's build folder,
not LLVM's.

Xcode still has a few issues finding auxiliary tools and libraries in the
build folders. I'll fix those next.

llvm-svn: 198328

10 years agoMark PUSHFS64/PUSHGS64/POPFS64/POPGS64 as In64BitMode and remove the hack from the...
Craig Topper [Thu, 2 Jan 2014 18:20:48 +0000 (18:20 +0000)]
Mark PUSHFS64/PUSHGS64/POPFS64/POPGS64 as In64BitMode and remove the hack from the disassembler table builder.

llvm-svn: 198327

10 years agoUsing the quoted version of an attribute name for consistency with other attribute...
Aaron Ballman [Thu, 2 Jan 2014 18:10:17 +0000 (18:10 +0000)]
Using the quoted version of an attribute name for consistency with other attribute diagnostics.

llvm-svn: 198326

10 years agoRemove unnecessary stirng comparison from disassembler.
Craig Topper [Thu, 2 Jan 2014 17:41:40 +0000 (17:41 +0000)]
Remove unnecessary stirng comparison from disassembler.

llvm-svn: 198325

10 years agoMark all x86 Int_ and _Int patterns as isCodeGenOnly so the disassembler table builde...
Craig Topper [Thu, 2 Jan 2014 17:28:14 +0000 (17:28 +0000)]
Mark all x86 Int_ and _Int patterns as isCodeGenOnly so the disassembler table builder doesn't need to string match them to exclude them.

llvm-svn: 198323

10 years agoObjectiveC. Class methods must be ignored when looking for
Fariborz Jahanian [Thu, 2 Jan 2014 17:24:32 +0000 (17:24 +0000)]
ObjectiveC. Class methods must be ignored when looking for
property accessor's missing backing ivar. This eliminates
the bogus warning being issued. // rdar://15728901

llvm-svn: 198322

10 years agoAdd test for r198311.
Roman Divacky [Thu, 2 Jan 2014 17:18:03 +0000 (17:18 +0000)]
Add test for r198311.

llvm-svn: 198321

10 years agoCMake: Unbreak separated LLVM/Clang project builds for Xcode.
Douglas Gregor [Thu, 2 Jan 2014 17:11:02 +0000 (17:11 +0000)]
CMake: Unbreak separated LLVM/Clang project builds for Xcode.

The separate Xcode project generated for Clang is putting the clang
executables into the same location where the LLVM executables are
going. This is wrong, and breaks the Clang build because we try to
create clang++ and clang-cl symlinks in the wrong place and to the
wrong place.

As a stop-gap to get these builds working again, teach the symlink
generation to point into the LLVM executable directory instead.

llvm-svn: 198319

10 years agoRemove CMake-Xcode hack that symlinked llvm-config into a common place.
Douglas Gregor [Thu, 2 Jan 2014 16:30:55 +0000 (16:30 +0000)]
Remove CMake-Xcode hack that symlinked llvm-config into a common place.

When building Clang separately from LLVM with CMake, one should set
the path of llvm-config via the cache variable LLVM_CONFIG.

llvm-svn: 198316

10 years ago[arm] Add softvfp to supported FPU names.
Logan Chien [Thu, 2 Jan 2014 15:50:02 +0000 (15:50 +0000)]
[arm] Add softvfp to supported FPU names.

llvm-svn: 198313

10 years agoRemove a tab that snuck in.
Roman Divacky [Thu, 2 Jan 2014 15:34:59 +0000 (15:34 +0000)]
Remove a tab that snuck in.

llvm-svn: 198312

10 years agoIn the FreeBSD assembler driver, inform the sparc assembler that we're producing
Roman Divacky [Thu, 2 Jan 2014 15:13:18 +0000 (15:13 +0000)]
In the FreeBSD assembler driver, inform the sparc assembler that we're producing
PIC code.

llvm-svn: 198311

10 years agoAdded an option to avoid splitting certain kinds of comments into lines.
Alexander Kornienko [Thu, 2 Jan 2014 15:13:14 +0000 (15:13 +0000)]
Added an option to avoid splitting certain kinds of comments into lines.

Summary: Added CommentPragmas option for this.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2460

llvm-svn: 198310

10 years agoVerify that clang TargetInfo descriptions match DataLayout strings from LLVM
Alp Toker [Thu, 2 Jan 2014 15:08:04 +0000 (15:08 +0000)]
Verify that clang TargetInfo descriptions match DataLayout strings from LLVM

The backend string is only verified when available as it's possible to run
clang IRGen for targets that haven't been built or don't exist in LLVM.

llvm-svn: 198309

10 years agoRemove the now unused 's' specifications.
Rafael Espindola [Thu, 2 Jan 2014 14:06:59 +0000 (14:06 +0000)]
Remove the now unused 's' specifications.

llvm-svn: 198308

10 years agoPass the aapcs and apcs features down to llvm.
Rafael Espindola [Thu, 2 Jan 2014 13:57:18 +0000 (13:57 +0000)]
Pass the aapcs and apcs features down to llvm.

No functionality change, but unblocks asserting that llvm's and clang's
datalayout strings are the same.

llvm-svn: 198306

10 years agoMake the ARM ABI selectable via SubtargetFeature.
Rafael Espindola [Thu, 2 Jan 2014 13:40:08 +0000 (13:40 +0000)]
Make the ARM ABI selectable via SubtargetFeature.

This patch makes it possible to select the ABI with -mattr. It will be used to
forward clang's -target-abi option to llvm's CodeGen.

llvm-svn: 198304

10 years ago[OpenCL] The kernel attribute can only be used on functions.
Joey Gouly [Thu, 2 Jan 2014 12:04:42 +0000 (12:04 +0000)]
[OpenCL] The kernel attribute can only be used on functions.

llvm-svn: 198300

10 years agoSupport LLVM_STATIC_ASSERT() in clang pre-C++11 mode
Alp Toker [Thu, 2 Jan 2014 04:07:41 +0000 (04:07 +0000)]
Support LLVM_STATIC_ASSERT() in clang pre-C++11 mode

llvm-svn: 198292

10 years agoRemove unused function argument.
Craig Topper [Thu, 2 Jan 2014 03:58:45 +0000 (03:58 +0000)]
Remove unused function argument.

llvm-svn: 198291

10 years agoBasicAA: Fix value equality and phi cycles
Arnold Schwaighofer [Thu, 2 Jan 2014 03:31:36 +0000 (03:31 +0000)]
BasicAA: Fix value equality and phi cycles

When there are cycles in the value graph we have to be careful interpreting
"Value*" identity as "value" equivalence. We interpret the value of a phi node
as the value of its operands.
When we check for value equivalence now we make sure that the "Value*" dominates
all cycles (phis).

%0 = phi [%noaliasval, %addr2]
%l = load %ptr
%addr1 = gep @a, 0, %l
%addr2 = gep @a, 0, (%l + 1)
store %ptr ...

Before this patch we would return NoAlias for (%0, %addr1) which is wrong
because the value of the load is from different iterations of the loop.

Tested on x86_64 -mavx at O3 and O3 -flto with no performance or compile time
regressions.

PR18068
radar://15653794

llvm-svn: 198290

10 years agoRename 'assert' to something less loaded in CompileAssertHasType
Alp Toker [Wed, 1 Jan 2014 23:34:16 +0000 (23:34 +0000)]
Rename 'assert' to something less loaded in CompileAssertHasType

Suggested by Aaron Ballman.

llvm-svn: 198288

10 years agoRemove the 's' DataLayout specification
Rafael Espindola [Wed, 1 Jan 2014 22:29:43 +0000 (22:29 +0000)]
Remove the 's' DataLayout specification

During the years there have been some attempts at figuring out how to
align byval arguments. A look at the commit log suggests that they
were

* Use the ABI alignment.
* When that was not sufficient for x86-64, I added the 's' specification to
  DataLayout.
* When that was not sufficient Evan added the virtual getByValTypeAlignment.
* When even that was not sufficient, we just got the FE to add the alignment
  to the byval.

This patch is just a simple cleanup that removes my first attempt at fixing the
problem. I also added an AArch64 implementation of getByValTypeAlignment to
make sure this patch is a nop. I also left the 's' parsing for backward
compatibility.

I will send a short email to llvmdev about the change for anyone maintaining
an out of tree target.

llvm-svn: 198287

10 years ago[Sparc] Handle atomic loads/stores in sparc backend.
Venkatraman Govindaraju [Wed, 1 Jan 2014 22:11:54 +0000 (22:11 +0000)]
[Sparc] Handle atomic loads/stores in sparc backend.

llvm-svn: 198286

10 years agoRemove modifierType/Base from X86 disassembler tables as they are no longer used...
Craig Topper [Wed, 1 Jan 2014 21:52:57 +0000 (21:52 +0000)]
Remove modifierType/Base from X86 disassembler tables as they are no longer used. Removes ~11.5K from static tables.

llvm-svn: 198284

10 years ago[SparcV9]: Custom lower UMULO/SMULO so that the arguments are send to __multi3()...
Venkatraman Govindaraju [Wed, 1 Jan 2014 20:22:45 +0000 (20:22 +0000)]
[SparcV9]: Custom lower UMULO/SMULO so that the arguments are send to __multi3() in correct order.

llvm-svn: 198281

10 years ago[SparcV9]: Use SRL instead of SLL to clear top 32-bits in ctpop:i32. SLL does not...
Venkatraman Govindaraju [Wed, 1 Jan 2014 19:00:10 +0000 (19:00 +0000)]
[SparcV9]: Use SRL instead of SLL to clear top 32-bits in ctpop:i32. SLL does not clear top 32 bit, only SRL does.

llvm-svn: 198280

10 years agoX86Disassembler.cpp: Prune stray @return on translateFPRegister(). [-Wdocumentation]
NAKAMURA Takumi [Wed, 1 Jan 2014 16:19:26 +0000 (16:19 +0000)]
X86Disassembler.cpp: Prune stray @return on translateFPRegister(). [-Wdocumentation]

llvm-svn: 198279

10 years agoRemove need for MODIFIER_OPCODE in the disassembler tables. AddRegFrms are really...
Craig Topper [Wed, 1 Jan 2014 15:29:32 +0000 (15:29 +0000)]
Remove need for MODIFIER_OPCODE in the disassembler tables. AddRegFrms are really more like OrRegFrm so we don't need a difference since we can just mask bits.

llvm-svn: 198278

10 years agoAVX-512: Added intrinsics for vcvt, vcvtt, vrndscale, vcmp
Elena Demikhovsky [Wed, 1 Jan 2014 15:12:34 +0000 (15:12 +0000)]
AVX-512: Added intrinsics for vcvt, vcvtt, vrndscale, vcmp
Printing rounding control.
Enncoding for EVEX_RC (rounding control).

llvm-svn: 198277

10 years agoSecond attempt at Removing special form of AddRegFrm used by FP instructions. These...
Craig Topper [Wed, 1 Jan 2014 14:22:37 +0000 (14:22 +0000)]
Second attempt at Removing special form of AddRegFrm used by FP instructions. These instructions can be handled by MRMXr instead.

llvm-svn: 198276

10 years agoRemove extra semicolon.
Joey Gouly [Wed, 1 Jan 2014 10:07:45 +0000 (10:07 +0000)]
Remove extra semicolon.

llvm-svn: 198275

10 years agoUpdate the copyright credits -- Happy new year 2014!
NAKAMURA Takumi [Wed, 1 Jan 2014 08:27:31 +0000 (08:27 +0000)]
Update the copyright credits -- Happy new year 2014!

FIXME: Dragonegg may be updated at non-trivial changes.
llvm-svn: 198274

10 years agoSilence g++ 4.9 build issue in unit tests
Alp Toker [Wed, 1 Jan 2014 06:57:01 +0000 (06:57 +0000)]
Silence g++ 4.9 build issue in unit tests

Stopgap measure until we can just use static_assert().

llvm-svn: 198273

10 years agoRemove an unused diag left over from r198046
Alp Toker [Wed, 1 Jan 2014 06:07:48 +0000 (06:07 +0000)]
Remove an unused diag left over from r198046

llvm-svn: 198272

10 years agoEliminate UnaryTypeTraitExpr
Alp Toker [Wed, 1 Jan 2014 05:57:51 +0000 (05:57 +0000)]
Eliminate UnaryTypeTraitExpr

Remove UnaryTypeTraitExpr and switch all remaining type trait related handling
over to TypeTraitExpr.

The UTT/BTT/TT enum prefix and evaluation code is retained pending further
cleanup.

This is part of the ongoing work to unify type traits following the removal of
BinaryTypeTraitExpr in r197273.

llvm-svn: 198271

10 years agoExpectAndConsume: Diagnose errors automatically
Alp Toker [Wed, 1 Jan 2014 03:08:43 +0000 (03:08 +0000)]
ExpectAndConsume: Diagnose errors automatically

 1) Teach ExpectAndConsume() to emit expected and expected-after diagnostics
    using the generic diagnostic descriptions added in r197972, eliminating another
    set of trivial err_expected_* variations while maintaining existing behaviour.

 2) Lift SkipUntil() recovery out of ExpectAndConsume(). The Expect/Consume
    family of functions are primitive parser operations that now have the
    well-defined property of operating on single tokens. Factoring out recovery
    exposes opportunities for more consistent and tailored error recover at the
    call sites instead of just relying on a bottled SkipUntil formula.

llvm-svn: 198270

10 years agoAdd two fp test cases I missed in my previous commit.
Craig Topper [Tue, 31 Dec 2013 23:15:19 +0000 (23:15 +0000)]
Add two fp test cases I missed in my previous commit.

llvm-svn: 198269

10 years agoAdd more X86 FP stack disassembler test cases.
Craig Topper [Tue, 31 Dec 2013 22:51:53 +0000 (22:51 +0000)]
Add more X86 FP stack disassembler test cases.

llvm-svn: 198268

10 years agoFold vector selects with undef elements in the condition. Fixes PR18319.
Nick Lewycky [Tue, 31 Dec 2013 19:30:47 +0000 (19:30 +0000)]
Fold vector selects with undef elements in the condition. Fixes PR18319.
Patch by Ilia Filippov!

llvm-svn: 198267

10 years agoThe return value of createInternalFiles is unused, so remove it.
Joey Gouly [Tue, 31 Dec 2013 19:15:42 +0000 (19:15 +0000)]
The return value of createInternalFiles is unused, so remove it.

llvm-svn: 198266

10 years agoRevert r198238 and add FP disassembler tests. It didn't work and I didn't realized...
Craig Topper [Tue, 31 Dec 2013 17:21:44 +0000 (17:21 +0000)]
Revert r198238 and add FP disassembler tests. It didn't work and I didn't realized we had no FP disassembler test cases.

llvm-svn: 198265

10 years ago[OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.
Joey Gouly [Tue, 31 Dec 2013 15:47:49 +0000 (15:47 +0000)]
[OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.

Patch by joey.gouly@arm.com

llvm-svn: 198264

10 years agoRemove old comment referring to an argument that no longer exists.
Craig Topper [Tue, 31 Dec 2013 15:29:14 +0000 (15:29 +0000)]
Remove old comment referring to an argument that no longer exists.

llvm-svn: 198263

10 years agoFix misaligned indentation in "if" block in MipsMCCodeEmitter.cpp
Mark Seaborn [Tue, 31 Dec 2013 13:05:15 +0000 (13:05 +0000)]
Fix misaligned indentation in "if" block in MipsMCCodeEmitter.cpp

llvm-svn: 198262

10 years agotsan: fix Go build
Dmitry Vyukov [Tue, 31 Dec 2013 09:38:23 +0000 (09:38 +0000)]
tsan: fix Go build
Currently fails with:
gotsan.cc:7686:40: error: the address of 'int __sanitizer_pthread_attr_getstack(void*, void**, size_t*)' will always evaluate as 'true' [-Werror=address]

llvm-svn: 198261

10 years agoRecover from errors in enum definition
Serge Pavlov [Tue, 31 Dec 2013 06:26:03 +0000 (06:26 +0000)]
Recover from errors in enum definition

Previously any error in enum definition body stopped parsing it. With this
change parser tries to recover from errors.
The patch fixes PR10982.

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

llvm-svn: 198259

10 years agoAdd missing MRM_XX forms to the old JIT emitter for consistency.
Craig Topper [Tue, 31 Dec 2013 03:26:24 +0000 (03:26 +0000)]
Add missing MRM_XX forms to the old JIT emitter for consistency.

llvm-svn: 198258

10 years agoRemove MRMInitReg form now that it's last use is gone.
Craig Topper [Tue, 31 Dec 2013 03:19:03 +0000 (03:19 +0000)]
Remove MRMInitReg form now that it's last use is gone.

llvm-svn: 198257

10 years agoSilence g++ 4.9 build issue
Alp Toker [Tue, 31 Dec 2013 03:16:57 +0000 (03:16 +0000)]
Silence g++ 4.9 build issue

lib/ASTMatchers/ASTMatchFinder.cpp:276:28: error: typedef 'traverse_can_only_be_instantiated_with_base_type' locally defined but not used [-Werror=unused-local-typedefs]
                            traverse_can_only_be_instantiated_with_base_type);

llvm-svn: 198256

10 years agoSilence g++ 4.9 build issue
Alp Toker [Tue, 31 Dec 2013 03:16:55 +0000 (03:16 +0000)]
Silence g++ 4.9 build issue

lib/Support/ThreadLocal.cpp:53:15: error: typedef 'SIZE_TOO_BIG' locally defined but not used [-Werror=unused-local-typedefs]
   typedef int SIZE_TOO_BIG[sizeof(pthread_key_t) <= sizeof(data) ? 1 : -1];

Done the C++11 way, switching on and using LLVM_STATIC_ASSERT() instead of LLVM_ATTRIBUTE_UNUSED.

llvm-svn: 198255

10 years agoHandle MOV32r0 in expandPostRAPseudo instead of MCInst lowering. No functional change...
Craig Topper [Tue, 31 Dec 2013 03:05:38 +0000 (03:05 +0000)]
Handle MOV32r0 in expandPostRAPseudo instead of MCInst lowering. No functional change intended.

llvm-svn: 198254

10 years agoFix an ODR violation in the sanitizer runtimes.
Chandler Carruth [Mon, 30 Dec 2013 23:36:11 +0000 (23:36 +0000)]
Fix an ODR violation in the sanitizer runtimes.

A helper function is a C++ function, and so even though one of the two
definitions is weak, it still technically triggers the ODR. Perhaps
these two definitions are ODR equivalent, but I'm not even confident in
that.

Instead, just define the function once, declare it as weak, and use
a wrapper that is clearly file-local. This avoids two definitions. Also
make the function extern "C" so that we can't even mess up the type
signature somehow or otherwise fail to match up the weak declaration
here with the interceptor defined elsewhere.

llvm-svn: 198253