platform/upstream/llvm.git
11 years agoFix up some asserts that are within an if statement. This removes the need
Richard Trieu [Mon, 1 Jul 2013 23:42:53 +0000 (23:42 +0000)]
Fix up some asserts that are within an if statement.  This removes the need
for assert(0 && "text").

llvm-svn: 185396

11 years agoTweak some comments that referred to the old bias computations.
Jakob Stoklund Olesen [Mon, 1 Jul 2013 23:36:37 +0000 (23:36 +0000)]
Tweak some comments that referred to the old bias computations.

llvm-svn: 185395

11 years ago[PowerPC] Add support for TLS data relocations
Ulrich Weigand [Mon, 1 Jul 2013 23:33:29 +0000 (23:33 +0000)]
[PowerPC] Add support for TLS data relocations

This adds support for TLS data relocations and modifiers:
       .quad target@dtpmod
       .quad target@tprel
       .quad target@dtprel
Currently exploited by the asm parser only.

llvm-svn: 185394

11 years agoRemove floating point computations form SpillPlacement.cpp.
Jakob Stoklund Olesen [Mon, 1 Jul 2013 23:19:39 +0000 (23:19 +0000)]
Remove floating point computations form SpillPlacement.cpp.

Patch by Benjamin Kramer!

Use the BlockFrequency class instead of floats in the Hopfield network
computations. This rescales the node Bias field from a [-2;2] float
range to two block frequencies BiasN and BiasP pulling in opposite
directions. This construct has a more predictable behavior when block
frequencies saturate.

The per-node scaling factors are no longer necessary, assuming the block
frequencies around a bundle are consistent.

This patch can cause the register allocator to make different spilling
decisions. The differences should be small.

llvm-svn: 185393

11 years agoChange if (cond) ... else llvm_unreachable("text") to assert(cond && "text") ...
Richard Trieu [Mon, 1 Jul 2013 23:06:23 +0000 (23:06 +0000)]
Change if (cond) ... else llvm_unreachable("text") to assert(cond && "text") ...

llvm-svn: 185392

11 years agoXFAIL this test on 10.7 and 10.8
Howard Hinnant [Mon, 1 Jul 2013 22:59:14 +0000 (22:59 +0000)]
XFAIL this test on 10.7 and 10.8

llvm-svn: 185391

11 years ago[PowerPC] Fix 32-bit PowerPC TLS relocs
Ulrich Weigand [Mon, 1 Jul 2013 22:27:57 +0000 (22:27 +0000)]
[PowerPC] Fix 32-bit PowerPC TLS relocs

Some TLS relocs were copied incorrectly from ppc64 to ppc32,
and some were missing completely.

llvm-svn: 185390

11 years agoPR16493: DebugInfo with TLS on PPC crashing due to invalid relocation
David Blaikie [Mon, 1 Jul 2013 21:45:25 +0000 (21:45 +0000)]
PR16493: DebugInfo with TLS on PPC crashing due to invalid relocation

Restrict the current TLS support to X86 ELF for now. Test that we don't
produce it on PPC & we can flesh that test case out with the right thing
once someone implements it.

llvm-svn: 185389

11 years agoAdded SymbolVendorELF to the wrong target (lldb-tool), now it is correctly added...
Greg Clayton [Mon, 1 Jul 2013 21:44:02 +0000 (21:44 +0000)]
Added SymbolVendorELF to the wrong target (lldb-tool), now it is correctly added to lldb-core.

llvm-svn: 185388

11 years ago[PowerPC] Support all condition register logical instructions
Ulrich Weigand [Mon, 1 Jul 2013 21:40:54 +0000 (21:40 +0000)]
[PowerPC] Support all condition register logical instructions

This adds support for all missing condition register logical
instructions and extended mnemonics to the asm parser.

llvm-svn: 185387

11 years agoFixed Xcode project to include SymbolVendorELF.
Greg Clayton [Mon, 1 Jul 2013 21:37:51 +0000 (21:37 +0000)]
Fixed Xcode project to include SymbolVendorELF.

llvm-svn: 185386

11 years agoAdd a newline.
Chad Rosier [Mon, 1 Jul 2013 21:31:10 +0000 (21:31 +0000)]
Add a newline.

llvm-svn: 185385

11 years agoSimplify code in mangler.
Eli Friedman [Mon, 1 Jul 2013 21:29:48 +0000 (21:29 +0000)]
Simplify code in mangler.

llvm-svn: 185384

11 years agoDebug Info: clean up usage of Verify.
Manman Ren [Mon, 1 Jul 2013 21:02:01 +0000 (21:02 +0000)]
Debug Info: clean up usage of Verify.

No functionality change. It should suffice to check the type of a debug info
metadata, instead of calling Verify.

llvm-svn: 185383

11 years agoRecognize "decltype(nullptr)" as a valid DW_AT_name for DW_TAG_unspecified_type tags...
Greg Clayton [Mon, 1 Jul 2013 21:01:52 +0000 (21:01 +0000)]
Recognize "decltype(nullptr)" as a valid DW_AT_name for DW_TAG_unspecified_type tags as meaning the C++11 null pointer type.

llvm-svn: 185382

11 years agoSimplify linkage code for static local vars.
Eli Friedman [Mon, 1 Jul 2013 20:53:07 +0000 (20:53 +0000)]
Simplify linkage code for static local vars.

The key insight here is that weak linkage for a static local variable
should always mean linkonce_odr, because every file that needs it will
generate a definition.  We don't actually care about the precise linkage
of the parent context.  I feel a bit silly that I didn't realize this before.

llvm-svn: 185381

11 years agoIndex: test/CodeGen/PowerPC/reloc-align.ll
Bill Schmidt [Mon, 1 Jul 2013 20:52:27 +0000 (20:52 +0000)]
Index: test/CodeGen/PowerPC/reloc-align.ll
===================================================================
--- test/CodeGen/PowerPC/reloc-align.ll (revision 0)
+++ test/CodeGen/PowerPC/reloc-align.ll (revision 0)
@@ -0,0 +1,34 @@
+; RUN: llc -mcpu=pwr7 -O1 < %s | FileCheck %s
+
+; This test verifies that the peephole optimization of address accesses
+; does not produce a load or store with a relocation that can't be
+; satisfied for a given instruction encoding.  Reduced from a test supplied
+; by Hal Finkel.
+
+target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+
+%struct.S1 = type { [8 x i8] }
+
+@main.l_1554 = internal global { i8, i8, i8, i8, i8, i8, i8, i8 } { i8 -1, i8 -6, i8 57, i8 62, i8 -48, i8 0, i8 58, i8 80 }, align 1
+
+; Function Attrs: nounwind readonly
+define signext i32 @main() #0 {
+entry:
+  %call = tail call fastcc signext i32 @func_90(%struct.S1* byval bitcast ({ i8, i8, i8, i8, i8, i8, i8, i8 }* @main.l_1554 to %struct.S1*))
+; CHECK-NOT: ld {{[0-9]+}}, main.l_1554@toc@l
+  ret i32 %call
+}
+
+; Function Attrs: nounwind readonly
+define internal fastcc signext i32 @func_90(%struct.S1* byval nocapture %p_91) #0 {
+entry:
+  %0 = bitcast %struct.S1* %p_91 to i64*
+  %bf.load = load i64* %0, align 1
+  %bf.shl = shl i64 %bf.load, 26
+  %bf.ashr = ashr i64 %bf.shl, 54
+  %bf.cast = trunc i64 %bf.ashr to i32
+  ret i32 %bf.cast
+}
+
+attributes #0 = { nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
Index: lib/Target/PowerPC/PPCAsmPrinter.cpp
===================================================================
--- lib/Target/PowerPC/PPCAsmPrinter.cpp (revision 185327)
+++ lib/Target/PowerPC/PPCAsmPrinter.cpp (working copy)
@@ -679,7 +679,26 @@ void PPCAsmPrinter::EmitInstruction(const MachineI
       OutStreamer.EmitRawText(StringRef("\tmsync"));
       return;
     }
+    break;
+  case PPC::LD:
+  case PPC::STD:
+  case PPC::LWA: {
+    // Verify alignment is legal, so we don't create relocations
+    // that can't be supported.
+    // FIXME:  This test is currently disabled for Darwin.  The test
+    // suite shows a handful of test cases that fail this check for
+    // Darwin.  Those need to be investigated before this sanity test
+    // can be enabled for those subtargets.
+    if (!Subtarget.isDarwin()) {
+      unsigned OpNum = (MI->getOpcode() == PPC::STD) ? 2 : 1;
+      const MachineOperand &MO = MI->getOperand(OpNum);
+      if (MO.isGlobal() && MO.getGlobal()->getAlignment() < 4)
+        llvm_unreachable("Global must be word-aligned for LD, STD, LWA!");
+    }
+    // Now process the instruction normally.
+    break;
   }
+  }

   LowerPPCMachineInstrToMCInst(MI, TmpInst, *this);
   OutStreamer.EmitInstruction(TmpInst);
Index: lib/Target/PowerPC/PPCISelDAGToDAG.cpp
===================================================================
--- lib/Target/PowerPC/PPCISelDAGToDAG.cpp (revision 185327)
+++ lib/Target/PowerPC/PPCISelDAGToDAG.cpp (working copy)
@@ -1530,6 +1530,14 @@ void PPCDAGToDAGISel::PostprocessISelDAG() {
       if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(ImmOpnd)) {
         SDLoc dl(GA);
         const GlobalValue *GV = GA->getGlobal();
+        // We can't perform this optimization for data whose alignment
+        // is insufficient for the instruction encoding.
+        if (GV->getAlignment() < 4 &&
+            (StorageOpcode == PPC::LD || StorageOpcode == PPC::STD ||
+             StorageOpcode == PPC::LWA)) {
+          DEBUG(dbgs() << "Rejected this candidate for alignment.\n\n");
+          continue;
+        }
         ImmOpnd = CurDAG->getTargetGlobalAddress(GV, dl, MVT::i64, 0, Flags);
       } else if (ConstantPoolSDNode *CP =
                  dyn_cast<ConstantPoolSDNode>(ImmOpnd)) {

llvm-svn: 185380

11 years ago[ARMAsmParser] Sort the ARM register lists based on the encoding value, not the
Chad Rosier [Mon, 1 Jul 2013 20:49:23 +0000 (20:49 +0000)]
[ARMAsmParser] Sort the ARM register lists based on the encoding value, not the
tablegen enum values.  This should be the last fix due to fallout from r185094.

llvm-svn: 185379

11 years agoMake PBQP require/preserve MachineLoopInfo - the spiller requires it.
Lang Hames [Mon, 1 Jul 2013 20:47:47 +0000 (20:47 +0000)]
Make PBQP require/preserve MachineLoopInfo - the spiller requires it.

llvm-svn: 185378

11 years ago[docs] Amend confusing title
Sean Silva [Mon, 1 Jul 2013 20:45:12 +0000 (20:45 +0000)]
[docs] Amend confusing title

"Writing an LLVM Compiler Backend" can be misinterpreted as meaning
"backend" in the sense of "using LLVM as a backend for your compiler for
your new language". This new name is less ambiguous.

As a bonus, this brings the title in line with the file name.

llvm-svn: 185377

11 years ago[mips] Reverse the order of source operands of shift and rotate instructions that
Akira Hatanaka [Mon, 1 Jul 2013 20:39:53 +0000 (20:39 +0000)]
[mips] Reverse the order of source operands of shift and rotate instructions that
have three register operands.

No intended functionality changes.

llvm-svn: 185376

11 years ago[PowerPC] Also add "msync" alias
Ulrich Weigand [Mon, 1 Jul 2013 20:39:50 +0000 (20:39 +0000)]
[PowerPC] Also add "msync" alias

This adds an alias for "msync" (which is used on Book E
systems instead of "sync").

llvm-svn: 185375

11 years agoFix CMakeLists.txt.
Eli Friedman [Mon, 1 Jul 2013 20:34:51 +0000 (20:34 +0000)]
Fix CMakeLists.txt.

Sorry about that.

llvm-svn: 185374

11 years ago[mips] Increase the number of floating point control registers available to 32.
Akira Hatanaka [Mon, 1 Jul 2013 20:31:44 +0000 (20:31 +0000)]
[mips] Increase the number of floating point control registers available to 32.
Create a dedicated register class for floating point condition code registers and
move FCC0 from register class CCR to the new register class.

llvm-svn: 185373

11 years agoFix mangling for block literals.
Eli Friedman [Mon, 1 Jul 2013 20:22:57 +0000 (20:22 +0000)]
Fix mangling for block literals.

Blocks, like lambdas, can be written in contexts which are required to be
treated as the same under ODR.  Unlike lambdas, it isn't possible to actually
take the address of a block, so the mangling of the block itself doesn't
matter. However, objects like static variables inside a block do need to
be mangled in a consistent way.

There are basically three components here. One, block literals need a
consistent numbering.  Two, objects/types inside a block literal need
to be mangled using it.  Three, objects/types inside a block literal need
to have their linkage computed correctly.

llvm-svn: 185372

11 years ago[mips] Fix test case to check that mips64 instructions are generated.
Akira Hatanaka [Mon, 1 Jul 2013 20:18:58 +0000 (20:18 +0000)]
[mips] Fix test case to check that mips64 instructions are generated.

llvm-svn: 185371

11 years agoReally fix the test. Sorry for the breakage...
Anton Korobeynikov [Mon, 1 Jul 2013 19:51:36 +0000 (19:51 +0000)]
Really fix the test. Sorry for the breakage...

llvm-svn: 185369

11 years agoFix the test which relies on uncommitted change
Anton Korobeynikov [Mon, 1 Jul 2013 19:50:31 +0000 (19:50 +0000)]
Fix the test which relies on uncommitted change

llvm-svn: 185368

11 years agoFix the build after r185363. Use llvm::next instead of raw next.
Cameron Zwarich [Mon, 1 Jul 2013 19:49:48 +0000 (19:49 +0000)]
Fix the build after r185363. Use llvm::next instead of raw next.

llvm-svn: 185367

11 years agoSplit symbol support for ELF and Linux.
Michael Sartain [Mon, 1 Jul 2013 19:45:50 +0000 (19:45 +0000)]
Split symbol support for ELF and Linux.

llvm-svn: 185366

11 years agoAdd jump tables handling for MSP430.
Anton Korobeynikov [Mon, 1 Jul 2013 19:44:44 +0000 (19:44 +0000)]
Add jump tables handling for MSP430.
Patch by Job Noorman!

llvm-svn: 185364

11 years agoFix PR16508.
Cameron Zwarich [Mon, 1 Jul 2013 19:42:46 +0000 (19:42 +0000)]
Fix PR16508.

When phis get lowered, destination copies are inserted using an iterator that is
determined once for all phis in the block, which BuildMI interprets as a request
to insert an instruction directly before the iterator. In the case of a cyclic
phi, source copies may also be inserted directly before this iterator, which can
cause source copies to be inserted before destination copies. The fix is to keep
an iterator to the last phi and then advance it while lowering each phi in order
to insert destination copies directly after the phis.

llvm-svn: 185363

11 years agoFix MSP430 builtin types.
Anton Korobeynikov [Mon, 1 Jul 2013 19:42:40 +0000 (19:42 +0000)]
Fix MSP430 builtin types.

Patch by Job Noorman!

llvm-svn: 185362

11 years agoDon't form PPC CTR loops for over-sized exit counts
Hal Finkel [Mon, 1 Jul 2013 19:34:59 +0000 (19:34 +0000)]
Don't form PPC CTR loops for over-sized exit counts

Although you can't generate this from C on PPC64, if you have a loop using a
64-bit counter on PPC32 then you can't form a CTR-based loop for it. This had
been cauing the PPCCTRLoops pass to assert.

Thanks to Joerg Sonnenberger for providing a test case!

llvm-svn: 185361

11 years agoAArch64: correct CodeGen of MOVZ/MOVK combinations.
Tim Northover [Mon, 1 Jul 2013 19:23:10 +0000 (19:23 +0000)]
AArch64: correct CodeGen of MOVZ/MOVK combinations.

According to the AArch64 ELF specification (4.6.8), it's the
assembler's responsibility to make sure the shift amount is correct in
relocated MOVZ/MOVK instructions.

This wasn't being obeyed by either the MCJIT CodeGen or RuntimeDyldELF
(which happened to work out well for JIT tests). This commit should
make us compliant in this area.

llvm-svn: 185360

11 years ago(1) Add ".test" to test/Other/lit.local.cfg, so llvm-cov.test is actually run.
Matt Beaumont-Gay [Mon, 1 Jul 2013 18:58:53 +0000 (18:58 +0000)]
(1) Add ".test" to test/Other/lit.local.cfg, so llvm-cov.test is actually run.
(2) Rename llvm-cov test inputs so the string "llvm-cov" doesn't get
substituted by lit within the input filenames on the RUN line.
(3) XFAIL llvm-cov.test because it asserts:
include/llvm/ADT/SmallVector.h:140: reference llvm::SmallVectorTemplateCommon<llvm::GCOVBlock *, void>::operator[](unsigned int) [T = llvm::GCOVBlock *]: Assertion `begin() + idx < end()' failed.

llvm-svn: 185358

11 years agoFormatting cleanup.
Jim Ingham [Mon, 1 Jul 2013 18:49:43 +0000 (18:49 +0000)]
Formatting cleanup.

llvm-svn: 185357

11 years agoRevert r185339 (ARM: relax the atomic release barrier to "dmb ishst")
Tim Northover [Mon, 1 Jul 2013 18:37:33 +0000 (18:37 +0000)]
Revert r185339 (ARM: relax the atomic release barrier to "dmb ishst")

Turns out I'd misread the architecture reference manual and thought
that was a load/store-store barrier, when it's not.

Thanks for pointing it out Eli!

llvm-svn: 185356

11 years agoDebug Info: Scope of a DebugLoc should not be null.
Manman Ren [Mon, 1 Jul 2013 18:20:30 +0000 (18:20 +0000)]
Debug Info: Scope of a DebugLoc should not be null.

No functionality change. Remove handling for the null case.

llvm-svn: 185354

11 years ago[PowerPC] Fix @got references to local symbols
Ulrich Weigand [Mon, 1 Jul 2013 18:19:56 +0000 (18:19 +0000)]
[PowerPC] Fix @got references to local symbols

A @got reference must always result in a relocation, so that
the linker has a chance to set up the GOT entry, even if the
symbol happens to be local.

Add a PPCELFObjectWriter::ExplicitRelSym routine that enforces
a relocation to be emitted for GOT references.

llvm-svn: 185353

11 years agoImplement n3656 - make_unique. Thanks to Howard for the review and suggestions.
Marshall Clow [Mon, 1 Jul 2013 18:16:03 +0000 (18:16 +0000)]
Implement n3656 - make_unique. Thanks to Howard for the review and suggestions.

llvm-svn: 185352

11 years ago[PowerPC] Add "wait" instruction
Ulrich Weigand [Mon, 1 Jul 2013 17:21:23 +0000 (17:21 +0000)]
[PowerPC] Add "wait" instruction

This adds the "wait" instruction and its extended mnemonics.

llvm-svn: 185350

11 years ago[PowerPC] Support "eieio" instruction
Ulrich Weigand [Mon, 1 Jul 2013 17:06:26 +0000 (17:06 +0000)]
[PowerPC] Support "eieio" instruction

This adds support for the "eieio" instruction to
the asm parser.

llvm-svn: 185349

11 years agoAdded c++ mode selector to head of SelectionDAGBuilder.h so editors open it in c...
Michael Gottesman [Mon, 1 Jul 2013 16:53:41 +0000 (16:53 +0000)]
Added c++ mode selector to head of SelectionDAGBuilder.h so editors open it in c++ mode instead of c mode.

llvm-svn: 185348

11 years ago[PowerPC] Add some existing instructions to ppc64-encoding-bookII.s
Ulrich Weigand [Mon, 1 Jul 2013 16:52:55 +0000 (16:52 +0000)]
[PowerPC] Add some existing instructions to ppc64-encoding-bookII.s

The test case had a couple of FIXMEs where the instruction is in
fact already supported by the back-end.  In some other case, while
the generic form of the instruction is not yet supported, a
specialized form is.  This adds tests for those already supported
instructions / instruction forms.

llvm-svn: 185347

11 years agoFix incorrect token counting introduced by r185319.
Daniel Jasper [Mon, 1 Jul 2013 16:43:38 +0000 (16:43 +0000)]
Fix incorrect token counting introduced by r185319.

This lead to weird formatting.
Before:
DoSomethingWithVector({ {} /* No data */ }, {
  { 1, 2 }
});
After:
DoSomethingWithVector({ {} /* No data */ }, { { 1, 2 } });

llvm-svn: 185346

11 years ago[ASan] try to fix Windows build
Alexey Samsonov [Mon, 1 Jul 2013 16:38:38 +0000 (16:38 +0000)]
[ASan] try to fix Windows build

llvm-svn: 185345

11 years ago[PowerPC] Add variants of "sync" instruction
Ulrich Weigand [Mon, 1 Jul 2013 16:37:52 +0000 (16:37 +0000)]
[PowerPC] Add variants of "sync" instruction

This adds support for the "sync $L" instruction with operand,
and provides aliases for "lwsync" and "ptesync".

llvm-svn: 185344

11 years agoImplement n3658 - Compile-time integer sequences
Marshall Clow [Mon, 1 Jul 2013 16:26:55 +0000 (16:26 +0000)]
Implement n3658 - Compile-time integer sequences

llvm-svn: 185343

11 years ago[ASan] Properly disable strict init-order checking when pthread_create is called
Alexey Samsonov [Mon, 1 Jul 2013 16:16:41 +0000 (16:16 +0000)]
[ASan] Properly disable strict init-order checking when pthread_create is called

llvm-svn: 185342

11 years ago[msan] Intercept stpcpy.
Evgeniy Stepanov [Mon, 1 Jul 2013 15:19:37 +0000 (15:19 +0000)]
[msan] Intercept stpcpy.

llvm-svn: 185340

11 years agoARM: relax the atomic release barrier to "dmb ishst"
Tim Northover [Mon, 1 Jul 2013 14:48:48 +0000 (14:48 +0000)]
ARM: relax the atomic release barrier to "dmb ishst"

I believe the full "dmb ish" barrier is not required to guarantee release
semantics for atomic operations. The weaker "dmb ishst" prevents previous
operations being reordered with a store executed afterwards, which is enough.

A key point to note (fortunately already correct) is that this barrier alone is
*insufficient* for sequential consistency, no matter how liberally placed.

llvm-svn: 185339

11 years ago[sanitizer] Intercept getnameinfo.
Evgeniy Stepanov [Mon, 1 Jul 2013 13:51:31 +0000 (13:51 +0000)]
[sanitizer] Intercept getnameinfo.

llvm-svn: 185338

11 years agoAvoid column limit violation in block comments in certain cases.
Alexander Kornienko [Mon, 1 Jul 2013 13:42:42 +0000 (13:42 +0000)]
Avoid column limit violation in block comments in certain cases.

Summary:
Add penalty when an excessively long line in a block comment can not be
broken on a leading whitespace. Lack of this addition can lead to severe column
width violations when they can be easily avoided.

Reviewers: djasper

Reviewed By: djasper

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

llvm-svn: 185337

11 years ago[NVPTX] Add support for module-scope inline asm
Justin Holewinski [Mon, 1 Jul 2013 13:00:14 +0000 (13:00 +0000)]
[NVPTX] Add support for module-scope inline asm

Since we were explicitly not calling AsmPrinter::doInitialization,
any module-scope inline asm was not being printed.

llvm-svn: 185336

11 years ago[NVPTX] We dont use NVBuiltin anymore
Justin Holewinski [Mon, 1 Jul 2013 12:59:08 +0000 (12:59 +0000)]
[NVPTX] We dont use NVBuiltin anymore

llvm-svn: 185335

11 years ago[NVPTX] Cut down on physical register defs
Justin Holewinski [Mon, 1 Jul 2013 12:59:06 +0000 (12:59 +0000)]
[NVPTX] Cut down on physical register defs

We are using virtual registers throughout now, but we still need
to keep a few physical registers per class around to keep the
infrastructure happy.

llvm-svn: 185334

11 years ago[NVPTX] 64-bit ADDC/ADDE are not legal
Justin Holewinski [Mon, 1 Jul 2013 12:59:04 +0000 (12:59 +0000)]
[NVPTX] 64-bit ADDC/ADDE are not legal

llvm-svn: 185333

11 years ago[NVPTX] Fix vector loads from parameters that span multiple loads, and fix some typos
Justin Holewinski [Mon, 1 Jul 2013 12:59:01 +0000 (12:59 +0000)]
[NVPTX] Fix vector loads from parameters that span multiple loads, and fix some typos

llvm-svn: 185332

11 years ago[NVPTX] Handle signext/zeroext attributes properly
Justin Holewinski [Mon, 1 Jul 2013 12:58:58 +0000 (12:58 +0000)]
[NVPTX] Handle signext/zeroext attributes properly

Fix a case where we were incorrectly sign-extending a value when we should have been zero-extending the value.

Also change some SIGN_EXTEND to ANY_EXTEND because we really dont care and may have more opportunity to fold subexpressions

llvm-svn: 185331

11 years ago[NVPTX] Add support for native SIGN_EXTEND_INREG where available
Justin Holewinski [Mon, 1 Jul 2013 12:58:56 +0000 (12:58 +0000)]
[NVPTX] Add support for native SIGN_EXTEND_INREG where available

llvm-svn: 185330

11 years ago[NVPTX] Add isel patterns for [reg+offset] form of ldg/ldu.
Justin Holewinski [Mon, 1 Jul 2013 12:58:52 +0000 (12:58 +0000)]
[NVPTX] Add isel patterns for [reg+offset] form of ldg/ldu.

llvm-svn: 185329

11 years ago[NVPTX] Make sure we zero out high-order 24 bits for 8-bit load into 32-bit value
Justin Holewinski [Mon, 1 Jul 2013 12:58:48 +0000 (12:58 +0000)]
[NVPTX] Make sure we zero out high-order 24 bits for 8-bit load into 32-bit value

llvm-svn: 185328

11 years agoDon't align "} // namespace" comments.
Daniel Jasper [Mon, 1 Jul 2013 11:22:57 +0000 (11:22 +0000)]
Don't align "} // namespace" comments.

This is not all bad, but people are often surprised by it.

Before:
namespace {
int SomeVariable = 0; // comment
}                     // namespace

After:
namespace {
int SomeVariable = 0; // comment
} // namespace

llvm-svn: 185327

11 years agoChange __sanitizer_symbolize_demangle hook return type to 'int'
Alexey Samsonov [Mon, 1 Jul 2013 11:20:56 +0000 (11:20 +0000)]
Change __sanitizer_symbolize_demangle hook return type to 'int'

llvm-svn: 185326

11 years ago[ASan] Cache atos processes to make Darwin symbolication faster.
Alexander Potapenko [Mon, 1 Jul 2013 10:51:31 +0000 (10:51 +0000)]
[ASan] Cache atos processes to make Darwin symbolication faster.

Patch by Jesse Ruderman<jruderman@gmail.com>

llvm-svn: 185325

11 years ago[sanitizer] Use the correct macro to check glibc version.
Sergey Matveev [Mon, 1 Jul 2013 10:15:29 +0000 (10:15 +0000)]
[sanitizer] Use the correct macro to check glibc version.

llvm-svn: 185324

11 years agoclang/test/lit.cfg: Improve is_filesystem_case_insensitive() to work properly on...
NAKAMURA Takumi [Mon, 1 Jul 2013 09:51:55 +0000 (09:51 +0000)]
clang/test/lit.cfg: Improve is_filesystem_case_insensitive() to work properly on cygwin.

Cygwin does not accept the form /CYGDRIVE/X/PATH/TO/FILE against /cygdrive/X/PATH/TO/FILE.
"cygdrive" must be lower-cased.

llvm-svn: 185323

11 years agollvm-symbolizer: Recognize a drive letter on win32. Then "REQUIRES: shell" can be...
NAKAMURA Takumi [Mon, 1 Jul 2013 09:51:42 +0000 (09:51 +0000)]
llvm-symbolizer: Recognize a drive letter on win32. Then "REQUIRES: shell" can be removed.

FIXME: Could we use llvm::sys::Path here?
llvm-svn: 185322

11 years agoDon't add an extra space before ellipsis after pointers.
Daniel Jasper [Mon, 1 Jul 2013 09:47:25 +0000 (09:47 +0000)]
Don't add an extra space before ellipsis after pointers.

Before (for styles where the pointer binds to the type):
template <class... Ts> void Foo(Ts... ts) {}
template <class... Ts> void Foo(Ts* ... ts) {}
After:
template <class... Ts> void Foo(Ts... ts) {}
template <class... Ts> void Foo(Ts*... ts) {}

llvm-svn: 185321

11 years agoKeep space between pointer and block comment.
Daniel Jasper [Mon, 1 Jul 2013 09:34:09 +0000 (09:34 +0000)]
Keep space between pointer and block comment.

Before: void f(int */* unused */) {}
After:  void f(int * /* unused */) {}

The previous version seems to be valid C++ code but confuses many syntax
highlighters.

llvm-svn: 185320

11 years agoFix braced-list detection in lieu of trailing comments.
Daniel Jasper [Mon, 1 Jul 2013 09:15:46 +0000 (09:15 +0000)]
Fix braced-list detection in lieu of trailing comments.

Before:
DoSomethingWithVector({
} /* No data */);
After:
DoSomethingWithVector({} /* No data */);

llvm-svn: 185319

11 years ago[ASan] Add sanity test for asan_symbolize.py script
Alexey Samsonov [Mon, 1 Jul 2013 09:15:19 +0000 (09:15 +0000)]
[ASan] Add sanity test for asan_symbolize.py script

llvm-svn: 185318

11 years ago[sanitizer] Fix build with older kernels.
Evgeniy Stepanov [Mon, 1 Jul 2013 09:10:34 +0000 (09:10 +0000)]
[sanitizer] Fix build with older kernels.

PTRACE_SETREGSET & PTRACE_GETREGSET may be missing from linux headers.

llvm-svn: 185317

11 years agoAdded the test missed from r185080.
Serge Pavlov [Mon, 1 Jul 2013 09:02:33 +0000 (09:02 +0000)]
Added the test missed from r185080.

llvm-svn: 185316

11 years ago[ASan] Remove leading underscores from function names in output tests
Alexey Samsonov [Mon, 1 Jul 2013 08:41:45 +0000 (08:41 +0000)]
[ASan] Remove leading underscores from function names in output tests

llvm-svn: 185315

11 years agoHide mlock/munlock info message under verbosity flag.
Alexey Samsonov [Mon, 1 Jul 2013 08:25:29 +0000 (08:25 +0000)]
Hide mlock/munlock info message under verbosity flag.

llvm-svn: 185314

11 years agoFollowing the modification introduced in llvm by commit 185311
Sylvestre Ledru [Mon, 1 Jul 2013 08:21:36 +0000 (08:21 +0000)]
Following the modification introduced in llvm by commit 185311

The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct.

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16446.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185313

11 years agoFollowing the modification introduced in llvm by commit 185311
Sylvestre Ledru [Mon, 1 Jul 2013 08:13:34 +0000 (08:13 +0000)]
Following the modification introduced in llvm by commit 185311

The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct.

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16445.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185312

11 years agoThe build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
Sylvestre Ledru [Mon, 1 Jul 2013 08:07:52 +0000 (08:07 +0000)]
The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct.

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16444.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185311

11 years ago[PECOFF][Writer] Set SizeOfInitializedData file header.
Rui Ueyama [Mon, 1 Jul 2013 08:06:48 +0000 (08:06 +0000)]
[PECOFF][Writer] Set SizeOfInitializedData file header.

llvm-svn: 185310

11 years ago[PECOFF][Writer] Add setter methods that sets the import address table location to...
Rui Ueyama [Mon, 1 Jul 2013 07:59:17 +0000 (07:59 +0000)]
[PECOFF][Writer] Add setter methods that sets the import address table location to file header.

llvm-svn: 185309

11 years ago[PECOFF][Writer] Do not emit the empty section as Windows loader rejects such executable.
Rui Ueyama [Mon, 1 Jul 2013 07:32:12 +0000 (07:32 +0000)]
[PECOFF][Writer] Do not emit the empty section as Windows loader rejects such executable.

llvm-svn: 185308

11 years ago[PECOFF][Writer] Amend the comment about DLL linking.
Rui Ueyama [Mon, 1 Jul 2013 07:25:30 +0000 (07:25 +0000)]
[PECOFF][Writer] Amend the comment about DLL linking.

llvm-svn: 185307

11 years agoPut helper class in anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 06:34:58 +0000 (06:34 +0000)]
Put helper class in anonymous namespace.

llvm-svn: 185306

11 years agoPut helper class in anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 06:29:40 +0000 (06:29 +0000)]
Put helper class in anonymous namespace.

llvm-svn: 185305

11 years agoPR16502: Fix a dumb bug where we might look past the last initializer in an
Richard Smith [Mon, 1 Jul 2013 06:08:20 +0000 (06:08 +0000)]
PR16502: Fix a dumb bug where we might look past the last initializer in an
InitListExpr.

llvm-svn: 185304

11 years agoPut helper classes in an anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 04:21:54 +0000 (04:21 +0000)]
Put helper classes in an anonymous namespace.

llvm-svn: 185303

11 years agoUse LLVM_DELETED_FUNCTION on unimplemented copy constructor and assignment operator.
Craig Topper [Mon, 1 Jul 2013 04:07:34 +0000 (04:07 +0000)]
Use LLVM_DELETED_FUNCTION on unimplemented copy constructor and assignment operator.

llvm-svn: 185302

11 years agoPut helper classes in an anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 04:03:19 +0000 (04:03 +0000)]
Put helper classes in an anonymous namespace.

llvm-svn: 185301

11 years agoUse static for helper functions instead of an anonymous namespace per coding standards.
Craig Topper [Mon, 1 Jul 2013 03:38:29 +0000 (03:38 +0000)]
Use static for helper functions instead of an anonymous namespace per coding standards.

llvm-svn: 185300

11 years agoLoopVectorize: Math functions only read rounding mode
Arnold Schwaighofer [Mon, 1 Jul 2013 00:54:44 +0000 (00:54 +0000)]
LoopVectorize: Math functions only read rounding mode

Math functions are mark as readonly because they read the floating point
rounding mode. Because we don't vectorize loops that would contain function
calls that set the rounding mode it is safe to ignore this memory read.

llvm-svn: 185299

11 years agoIn istream::ignore, check the delimeter as an int_type, not as a char_type, so as...
Howard Hinnant [Mon, 1 Jul 2013 00:37:50 +0000 (00:37 +0000)]
In istream::ignore, check the delimeter as an int_type, not as a char_type, so as to correctly handle EOF.  This fixes llvm.org/bugs/show_bug.cgi?id=16427

llvm-svn: 185298

11 years agoThe bind and function functor constructors and assignment operators were overly gener...
Howard Hinnant [Mon, 1 Jul 2013 00:01:51 +0000 (00:01 +0000)]
The bind and function functor constructors and assignment operators were overly general and getting confused with the copy constructor and copy assignment operators.  Constrained them.  This fixes llvm.org/bugs/show_bug.cgi?id=16385

llvm-svn: 185297

11 years agoMake string pointer const.
Craig Topper [Sun, 30 Jun 2013 22:44:02 +0000 (22:44 +0000)]
Make string pointer const.

llvm-svn: 185296

11 years agoPut helper classes into anonymous namespace.
Craig Topper [Sun, 30 Jun 2013 22:29:28 +0000 (22:29 +0000)]
Put helper classes into anonymous namespace.

llvm-svn: 185295

11 years agoR600: Fix an unitialized variable in R600InstrInfo.cpp
Vincent Lejeune [Sun, 30 Jun 2013 21:44:06 +0000 (21:44 +0000)]
R600: Fix an unitialized variable in R600InstrInfo.cpp

llvm-svn: 185294

11 years agoDocumentation cleanup for TypeOrdering.h.
James Dennett [Sun, 30 Jun 2013 21:23:07 +0000 (21:23 +0000)]
Documentation cleanup for TypeOrdering.h.

llvm-svn: 185293

11 years agoX86: POP*rmm: move address operand to (ins) from (outs).
Ahmed Bougacha [Sun, 30 Jun 2013 20:44:50 +0000 (20:44 +0000)]
X86: POP*rmm: move address operand to (ins) from (outs).

llvm-svn: 185292

11 years agoRestore r184205 and associated commits (after commit of r185290)
Stephen Lin [Sun, 30 Jun 2013 20:40:16 +0000 (20:40 +0000)]
Restore r184205 and associated commits (after commit of r185290)

This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in ARM and MSVC C++ ABIs.

llvm-svn: 185291