platform/upstream/llvm.git
9 years ago[CMake] Use .svn/wc.db as our VC dependency if it's available.
Jordan Rose [Thu, 20 Nov 2014 03:57:45 +0000 (03:57 +0000)]
[CMake] Use .svn/wc.db as our VC dependency if it's available.

In order to keep SVNVersion.inc from being regenerated on every build, we need
to specify as a dependency a file that only changes when the VC state updates.
I previously just had .svn/entries, but that's only used by Subversion 1.6.
1.7 uses .svn/wc.db instead; prefer that if it's present.

(Thanks, Nico!)

llvm-svn: 222407

9 years agoRemove xfail tag for darwin from quick_exit test
Eric Fiselier [Thu, 20 Nov 2014 03:40:32 +0000 (03:40 +0000)]
Remove xfail tag for darwin from quick_exit test

llvm-svn: 222406

9 years agoRemove tests that va_copy is not defined when C++ < 11.
Eric Fiselier [Thu, 20 Nov 2014 03:39:25 +0000 (03:39 +0000)]
Remove tests that va_copy is not defined when C++ < 11.

llvm-svn: 222405

9 years agoPreserve numeric literal suffixes during type canonicalization.
Richard Smith [Thu, 20 Nov 2014 03:37:32 +0000 (03:37 +0000)]
Preserve numeric literal suffixes during type canonicalization.
Patch by Pierre Gousseau! Test cases altered significantly by me.

llvm-svn: 222404

9 years agoAvoid earlier test interfering with later one.
Richard Smith [Thu, 20 Nov 2014 01:50:37 +0000 (01:50 +0000)]
Avoid earlier test interfering with later one.

llvm-svn: 222403

9 years agoWhen mangling member-expressions, skip implicit accesses of anonymous union
Richard Smith [Thu, 20 Nov 2014 01:35:11 +0000 (01:35 +0000)]
When mangling member-expressions, skip implicit accesses of anonymous union
objects. This is consistent with GCC's behavior. Patch by Tomasz Miąsko!

llvm-svn: 222402

9 years agoRemove support for undocumented SpecialCaseList entries.
Alexey Samsonov [Thu, 20 Nov 2014 01:27:19 +0000 (01:27 +0000)]
Remove support for undocumented SpecialCaseList entries.

"global-init", "global-init-src" and "global-init-type" were originally
used to blacklist entities in ASan init-order checker. However, they
were never documented, and later were replaced by "=init" category.

Old blacklist entries should be converted as follows:
  * global-init:foo -> global:foo=init
  * global-init-src:bar -> src:bar=init
  * global-init-type:baz -> type:baz=init

llvm-svn: 222401

9 years agoPR21531: fix crash on invalid with unexpanded pack in case value.
Richard Smith [Thu, 20 Nov 2014 01:24:12 +0000 (01:24 +0000)]
PR21531: fix crash on invalid with unexpanded pack in case value.

llvm-svn: 222400

9 years ago[Hexagon] Adding A2_xor instruction with IR selection pattern and test.
Colin LeMahieu [Wed, 19 Nov 2014 23:22:23 +0000 (23:22 +0000)]
[Hexagon] Adding A2_xor instruction with IR selection pattern and test.

llvm-svn: 222399

9 years agoRevert "[Reassociate] As the expression tree is rewritten make sure the operands...
Chad Rosier [Wed, 19 Nov 2014 23:21:20 +0000 (23:21 +0000)]
Revert "[Reassociate] As the expression tree is rewritten make sure the operands are"

This reverts commit r222142.  This is causing/exposing an execution-time regression
in spec2006/gcc and coremark on AArch64/A57/Ofast.

Conflicts:

test/Transforms/Reassociate/optional-flags.ll

llvm-svn: 222398

9 years agoRevert "[Reassociate] Update test cases due to r222142."
Chad Rosier [Wed, 19 Nov 2014 23:20:35 +0000 (23:20 +0000)]
Revert "[Reassociate] Update test cases due to r222142."

This reverts commit r222144.  Commit r222142 is being reverted due to
a spec2006/gcc execution-time regression.

Update mips-varargs test as well.

llvm-svn: 222397

9 years ago[Hexagon] Adding A2_or instruction with IR selection pattern and test.
Colin LeMahieu [Wed, 19 Nov 2014 22:58:04 +0000 (22:58 +0000)]
[Hexagon] Adding A2_or instruction with IR selection pattern and test.

llvm-svn: 222396

9 years agogold-plugin: Fix typo in error message
Duncan P. N. Exon Smith [Wed, 19 Nov 2014 22:39:21 +0000 (22:39 +0000)]
gold-plugin: Fix typo in error message

Spotted while reading code.

llvm-svn: 222395

9 years agoclang-format: [Java] Accept generic types in enum declaration
Daniel Jasper [Wed, 19 Nov 2014 22:38:18 +0000 (22:38 +0000)]
clang-format: [Java] Accept generic types in enum declaration

Before:
  enum Foo implements Bar<X, Y> {
    ABC {
      ...
    }
    , CDE {
      ...
    };
  }

After:
  enum Foo implements Bar<X, Y> {
    ABC {
      ...
    },
    CDE {
      ...
    };
  }

Patch by Harry Terkelsen.

llvm-svn: 222394

9 years ago[CMake] Always include the Clang repo version, just like the autoconf build.
Jordan Rose [Wed, 19 Nov 2014 22:03:48 +0000 (22:03 +0000)]
[CMake] Always include the Clang repo version, just like the autoconf build.

Now that LLVM's helper script GetSVN.cmake actually works consistently,
there's no reason not to use it. We avoid having to regenerate SVNVersion.inc
every time by marking it as dependent on Git's reflog or SVN's entries file.

This should end most of the issues of the AST format changing and breaking
old module files: CMake-Clang should now detect that the version changed just
like Autoconf-Clang has.

Based on r190557. Depends on LLVM r222391.

llvm-svn: 222393

9 years agoConstify a few IdentifierInfo * parameters.
Jordan Rose [Wed, 19 Nov 2014 22:03:46 +0000 (22:03 +0000)]
Constify a few IdentifierInfo * parameters.

No functionality change.

llvm-svn: 222392

9 years ago[CMake] Update GetSVN.cmake to use LLVM version control helper scripts.
Jordan Rose [Wed, 19 Nov 2014 22:03:21 +0000 (22:03 +0000)]
[CMake] Update GetSVN.cmake to use LLVM version control helper scripts.

This allows the logic to work with Git, and also uses the variable names
to match what Clang is actually looking for.

This is a re-application of r190556 and r190808. This changes the interface
of GetSVN.cmake. Clang change to follow.

llvm-svn: 222391

9 years agoRevert r222363: "[clang-tidy] Count errors in ClangTidyDiagnosticConsumer"
Hans Wennborg [Wed, 19 Nov 2014 22:02:11 +0000 (22:02 +0000)]
Revert r222363: "[clang-tidy] Count errors in ClangTidyDiagnosticConsumer"

This was causing clang-tidy invocations that would previously pass despite
source errors to fail.

llvm-svn: 222390

9 years agoADT: windows itanium targets msvcrt.dll
Saleem Abdulrasool [Wed, 19 Nov 2014 21:55:31 +0000 (21:55 +0000)]
ADT: windows itanium targets msvcrt.dll

Update the isOSMSVCRT to correctly identify that windows-itanium uses
msvcrt.dll.

llvm-svn: 222389

9 years ago[MSan] [MIPS] Adding support for MIPS64 (patch by Mohit Bhakkad).
Alexey Samsonov [Wed, 19 Nov 2014 21:42:33 +0000 (21:42 +0000)]
[MSan] [MIPS] Adding support for MIPS64 (patch by Mohit Bhakkad).

Reviewed at http://reviews.llvm.org/D5906

llvm-svn: 222388

9 years agoFix bug where a trivial constexpr copy/move operation couldn't copy from an
Richard Smith [Wed, 19 Nov 2014 21:27:17 +0000 (21:27 +0000)]
Fix bug where a trivial constexpr copy/move operation couldn't copy from an
empty non-constexpr object. Such a copy doesn't break any of the constexpr
rules.

llvm-svn: 222387

9 years agoTry to fix MSVS build after r222384. No intended behavior change.
Nico Weber [Wed, 19 Nov 2014 21:16:11 +0000 (21:16 +0000)]
Try to fix MSVS build after r222384. No intended behavior change.

llvm-svn: 222386

9 years agoFix Use-of-uninitialized-value for adrp_addr and adrp_inst in MachODump.cpp
Kevin Enderby [Wed, 19 Nov 2014 20:20:16 +0000 (20:20 +0000)]
Fix Use-of-uninitialized-value for adrp_addr and adrp_inst in MachODump.cpp

Fixes PR21607

llvm-svn: 222385

9 years agoSimplifyCFG: turn recursive GatherConstantCompares into iterative
Mehdi Amini [Wed, 19 Nov 2014 20:09:11 +0000 (20:09 +0000)]
SimplifyCFG: turn recursive GatherConstantCompares into iterative

A long sequence of || or && could lead to a stack explosion.

llvm-svn: 222384

9 years agoChange contradictory wording in va_copy test error message.
Eric Fiselier [Wed, 19 Nov 2014 20:01:26 +0000 (20:01 +0000)]
Change contradictory wording in va_copy test error message.

llvm-svn: 222383

9 years agoRegisterCoalescer: Improve debug messages
Matthias Braun [Wed, 19 Nov 2014 19:46:17 +0000 (19:46 +0000)]
RegisterCoalescer: Improve debug messages

- Show "Considering..." message after flipping so you actually see the final
  destination vreg as destination.
- Add a message on final join, so you can grep for "Success" messages to obtain
  a list of which register got merged with which.

llvm-svn: 222382

9 years agoAdd a print and verify pass after the RegisterCoalescer
Matthias Braun [Wed, 19 Nov 2014 19:46:15 +0000 (19:46 +0000)]
Add a print and verify pass after the RegisterCoalescer

llvm-svn: 222381

9 years agoMachineVerifier: Report register for bad liveranges
Matthias Braun [Wed, 19 Nov 2014 19:46:13 +0000 (19:46 +0000)]
MachineVerifier: Report register for bad liveranges

llvm-svn: 222380

9 years agoIntroduce register dump helper
Matthias Braun [Wed, 19 Nov 2014 19:46:11 +0000 (19:46 +0000)]
Introduce register dump helper

llvm-svn: 222379

9 years agoImplement N4280 - 'Non-member size() and more'
Marshall Clow [Wed, 19 Nov 2014 19:43:23 +0000 (19:43 +0000)]
Implement N4280 - 'Non-member size() and more'

llvm-svn: 222378

9 years agoDebugInfo: Don't emit a 'global variable' when a static member declaration is referen...
David Blaikie [Wed, 19 Nov 2014 19:42:40 +0000 (19:42 +0000)]
DebugInfo: Don't emit a 'global variable' when a static member declaration is referenced without a definition, just ensure the enclosing class (with the static member declaration) is emitted.

Addresses PR21511 by emitting appropriate metadata rather than
faux-global definitions for a variable that doesn't have a definition.

llvm-svn: 222377

9 years agoAliasSet: Simplify mergeSetIn
David Majnemer [Wed, 19 Nov 2014 19:36:18 +0000 (19:36 +0000)]
AliasSet: Simplify mergeSetIn

No functional change intended.

llvm-svn: 222376

9 years ago[X86] Improved lowering of v4x32 build_vector dag nodes.
Andrea Di Biagio [Wed, 19 Nov 2014 19:34:29 +0000 (19:34 +0000)]
[X86] Improved lowering of v4x32 build_vector dag nodes.

This patch improves the lowering of v4f32 and v4i32 build_vector dag nodes
that are known to have at least two non-zero elements.

With this patch, a build_vector that performs a blend with zero is
converted into a shuffle. This is done to let the shuffle legalizer expand
the dag node in a optimal way. For example, if we know that a build_vector
performs a blend with zero, we can try to lower it as a movq/blend instead of
always selecting an insertps.

This patch also improves the logic that lowers a build_vector into a insertps
with zero masking. See for example the extra test cases added to test sse41.ll.

Differential Revision: http://reviews.llvm.org/D6311

llvm-svn: 222375

9 years ago[ADT] Fix PR20728 - Incorrect APFloat::fusedMultiplyAdd results for x86_fp80.
Lang Hames [Wed, 19 Nov 2014 19:15:41 +0000 (19:15 +0000)]
[ADT] Fix PR20728 - Incorrect APFloat::fusedMultiplyAdd results for x86_fp80.

As detailed at http://llvm.org/PR20728, due to an internal overflow in
APFloat::multiplySignificand the APFloat::fusedMultiplyAdd method can return
incorrect results for x87DoubleExtended (x86_fp80) values. This commonly
manifests as incorrect constant folding of libm fmal calls on x86. E.g.

fmal(1.0L, 1.0L, 3.0L) == 0.0L      (should be 4.0L)

This patch fixes PR20728 by adding an extra bit to the significand for
intermediate results of APFloat::multiplySignificand, avoiding the overflow.

llvm-svn: 222374

9 years agoFix a temporary MDNode leak.
Frederic Riss [Wed, 19 Nov 2014 18:53:46 +0000 (18:53 +0000)]
Fix a temporary MDNode leak.

While emitting debug information for function forward decalrations, we
create DISubprogram objects that aran't stored in the AllSubprograms
list, and thus won't get finalized by the DIBuilder. During the DIBuilder
finalize(), the temporary MDNode allocated for the DISubprogram
Variables field gets RAUWd with a non temporary DIArray. For the forward
declarations, simply delete that temporary node before we delete the
parent node, so that it doesn't leak.

llvm-svn: 222373

9 years agoAdd test for denied process attach by pid and fix found bugs in Process/ProcessPOSIX.cpp
Oleksiy Vyalov [Wed, 19 Nov 2014 18:27:45 +0000 (18:27 +0000)]
Add test for denied process attach by pid and fix found bugs in Process/ProcessPOSIX.cpp
and FreeBSD/ProcessMonitor.

http://reviews.llvm.org/D6240

llvm-svn: 222372

9 years agoDriver: correct typo
Saleem Abdulrasool [Wed, 19 Nov 2014 17:59:00 +0000 (17:59 +0000)]
Driver: correct typo

Fix a typo in the search path identified by Justin Bogner.

llvm-svn: 222371

9 years agoFix broken build after removing StringMap::GetOrCreateValue in favor of StringMap...
Oleksiy Vyalov [Wed, 19 Nov 2014 17:24:58 +0000 (17:24 +0000)]
Fix broken build after removing StringMap::GetOrCreateValue in favor of StringMap::insert.

llvm-svn: 222370

9 years ago[llvm-readobj][NFC]
Colin LeMahieu [Wed, 19 Nov 2014 17:10:39 +0000 (17:10 +0000)]
[llvm-readobj][NFC]
Appeasing mingw without C++11 std::to_string

llvm-svn: 222369

9 years agoR600/SI: Make SIInstrInfo::isOperandLegal() more strict
Tom Stellard [Wed, 19 Nov 2014 16:58:49 +0000 (16:58 +0000)]
R600/SI: Make SIInstrInfo::isOperandLegal() more strict

A register operand that has a common sub-class with its instruction's
defined register class is not always legal.  For example,
SReg_32 and M0Reg both have a common sub-class, but we can't
use an SReg_32 in instructions that expect a M0Reg.

This prevents the llvm.SI.sendmsg.ll test from failing when the fold
operand pass is added.

llvm-svn: 222368

9 years ago[mips][micromips] Implement SWM32 and LWM32 instructions
Zoran Jovanovic [Wed, 19 Nov 2014 16:44:02 +0000 (16:44 +0000)]
[mips][micromips] Implement SWM32 and LWM32 instructions
Differential Revision: http://reviews.llvm.org/D5519

llvm-svn: 222367

9 years agotodo: We can support modifiable memory access functions
Tobias Grosser [Wed, 19 Nov 2014 16:31:33 +0000 (16:31 +0000)]
todo: We can support modifiable memory access functions

llvm-svn: 222366

9 years agotodo: We now have OpenMP support in isl backend
Tobias Grosser [Wed, 19 Nov 2014 16:30:16 +0000 (16:30 +0000)]
todo: We now have OpenMP support in isl backend

llvm-svn: 222365

9 years agoVectorize a reduction chain feeding into a 'return' statement.
Suyog Sarda [Wed, 19 Nov 2014 16:07:38 +0000 (16:07 +0000)]
Vectorize a reduction chain feeding into a 'return' statement.
e.x
return (a[0]+b[0]) + (a[1]+b[1])

Differential Revision: http://reviews.llvm.org/D6227

llvm-svn: 222364

9 years ago[clang-tidy] Count errors in ClangTidyDiagnosticConsumer
Alexander Kornienko [Wed, 19 Nov 2014 16:07:26 +0000 (16:07 +0000)]
[clang-tidy] Count errors in ClangTidyDiagnosticConsumer

llvm-svn: 222363

9 years agoChange states in the www/todo.html list
Johannes Doerfert [Wed, 19 Nov 2014 15:59:50 +0000 (15:59 +0000)]
Change states in the www/todo.html list

llvm-svn: 222362

9 years agoAdded entries for bugs 2118 and 2306, which were closed in Urbana
Marshall Clow [Wed, 19 Nov 2014 15:59:16 +0000 (15:59 +0000)]
Added entries for bugs 2118 and 2306, which were closed in Urbana

llvm-svn: 222361

9 years agoSimplify the SCEVAffinator [NFC]
Johannes Doerfert [Wed, 19 Nov 2014 15:36:59 +0000 (15:36 +0000)]
Simplify the SCEVAffinator [NFC]

llvm-svn: 222360

9 years agoUse new Small(Ptr)Set API
Tobias Grosser [Wed, 19 Nov 2014 14:32:32 +0000 (14:32 +0000)]
Use new Small(Ptr)Set API

This fixes the recent build failures.

llvm-svn: 222358

9 years agoclang-format: [Java] Ignore C++-specific keywords
Daniel Jasper [Wed, 19 Nov 2014 14:11:11 +0000 (14:11 +0000)]
clang-format: [Java] Ignore C++-specific keywords

Before:
  public void union
  (Object o);
  public void struct
  (Object o);
  public void delete (Object o);

After:
  public void union(Object o);
  public void struct(Object o);
  public void delete(Object o);

Patch by Harry Terkelsen, thank you!

llvm-svn: 222357

9 years ago[mips][microMIPS] Fix opcodes of MFHC1 and MTHC1 instructions.
Jozef Kolek [Wed, 19 Nov 2014 13:37:51 +0000 (13:37 +0000)]
[mips][microMIPS] Fix opcodes of MFHC1 and MTHC1 instructions.

Differential Revision: http://reviews.llvm.org/D6169

llvm-svn: 222355

9 years agoFix tail recursion elimination
Arnaud A. de Grandmaison [Wed, 19 Nov 2014 13:32:51 +0000 (13:32 +0000)]
Fix tail recursion elimination

When the BasicBlock containing the return instrution has a PHI with 2
incoming values, FoldReturnIntoUncondBranch will remove the no longer
used incoming value and remove the no longer needed phi as well. This
leaves us with a BB that no longer has a PHI, but the subsequent call
to FoldReturnIntoUncondBranch from FoldReturnAndProcessPred will not
remove the return instruction (which still uses the result of the call
instruction). This prevents EliminateRecursiveTailCall to remove
the value, as it is still being used in a basicblock which has no
predecessors.

The basicblock can not be erased on the spot, because its iterator is
still being used in runTRE.

This issue was exposed when removing the threshold on size for lifetime
marker insertion for named temporaries in clang. The testcase is a much
reduced version of peelOffOuterExpr(const Expr*, const ExplodedNode *)
from clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp.

llvm-svn: 222354

9 years ago[mips][microMIPS] Implement CodeGen support for 16-bit instruction ADDIUR2.
Jozef Kolek [Wed, 19 Nov 2014 13:23:58 +0000 (13:23 +0000)]
[mips][microMIPS] Implement CodeGen support for 16-bit instruction ADDIUR2.

Differential Revision: http://reviews.llvm.org/D5800

llvm-svn: 222352

9 years ago[mips][microMIPS] Implement CodeGen support for ADDIUS5 instruction.
Jozef Kolek [Wed, 19 Nov 2014 13:11:09 +0000 (13:11 +0000)]
[mips][microMIPS] Implement CodeGen support for ADDIUS5 instruction.

Differential Revision: http://reviews.llvm.org/D5799

llvm-svn: 222351

9 years ago[mips][microMIPS] Add disassembler tests for new microMIPS 32-bit
Jozef Kolek [Wed, 19 Nov 2014 11:49:57 +0000 (11:49 +0000)]
[mips][microMIPS] Add disassembler tests for new microMIPS 32-bit
instructions: LWXS, BGEZALS, BLTZALS, BEQZC, BNEZC, JALS and JALRS.

http://reviews.llvm.org/D5413

llvm-svn: 222349

9 years ago[mips][microMIPS] Implement LWXS instruction.
Jozef Kolek [Wed, 19 Nov 2014 11:39:12 +0000 (11:39 +0000)]
[mips][microMIPS] Implement LWXS instruction.

Differential Revision: http://reviews.llvm.org/D5407

llvm-svn: 222348

9 years ago[mips][microMIPS] Implement SDBBP and RDHWR instructions.
Jozef Kolek [Wed, 19 Nov 2014 11:25:50 +0000 (11:25 +0000)]
[mips][microMIPS] Implement SDBBP and RDHWR instructions.

Differential Revision: http://reviews.llvm.org/D5240

llvm-svn: 222347

9 years agotsan: fix binary names in tests
Dmitry Vyukov [Wed, 19 Nov 2014 10:47:06 +0000 (10:47 +0000)]
tsan: fix binary names in tests
test_output.sh produces source.cc.exe binaries

llvm-svn: 222345

9 years agotsan: exclude unsupported test from test_output.sh script
Dmitry Vyukov [Wed, 19 Nov 2014 10:46:23 +0000 (10:46 +0000)]
tsan: exclude unsupported test from test_output.sh script

llvm-svn: 222344

9 years agotsan: don't add -pie when compiling tests
Dmitry Vyukov [Wed, 19 Nov 2014 10:45:53 +0000 (10:45 +0000)]
tsan: don't add -pie when compiling tests
driver should add it as necessary

llvm-svn: 222343

9 years agotsan: fix Go build
Dmitry Vyukov [Wed, 19 Nov 2014 10:43:11 +0000 (10:43 +0000)]
tsan: fix Go build

llvm-svn: 222342

9 years agoUse ninja pools to limit the number of concurrent compile/link jobs.
Evgeniy Stepanov [Wed, 19 Nov 2014 10:30:02 +0000 (10:30 +0000)]
Use ninja pools to limit the number of concurrent compile/link jobs.

This change makes use of the new "job pool" capability in cmake 3.0
with ninja generator to allow limiting the number of concurrent jobs
of a certain type.

llvm-svn: 222341

9 years ago[X86][SSE] pslldq/psrldq byte shifts/rotation for SSE2
Simon Pilgrim [Wed, 19 Nov 2014 10:06:49 +0000 (10:06 +0000)]
[X86][SSE] pslldq/psrldq byte shifts/rotation for SSE2

This patch builds on http://reviews.llvm.org/D5598 to perform byte rotation shuffles (lowerVectorShuffleAsByteRotate) on pre-SSSE3 (palignr) targets - pre-SSSE3 is only enabled on i8 and i16 vector targets where it is a more definite performance gain.

I've also added a separate byte shift shuffle (lowerVectorShuffleAsByteShift) that makes use of the ability of the SLLDQ/SRLDQ instructions to implicitly shift in zero bytes to avoid the need to create a zero register if we had used palignr.

Differential Revision: http://reviews.llvm.org/D5699

llvm-svn: 222340

9 years agoAllow EmitVAArg() to promote types and use this to fix some N32/N64 vararg issues...
Daniel Sanders [Wed, 19 Nov 2014 10:01:35 +0000 (10:01 +0000)]
Allow EmitVAArg() to promote types and use this to fix some N32/N64 vararg issues for Mips.

Summary:
With this patch, passing a va_list to another function and reading 10 int's from
it works correctly on a big-endian target.

Based on a pair of patches by David Chisnall, one of which I've reworked
for the current trunk.

Reviewers: theraven, atanasyan

Reviewed By: theraven, atanasyan

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6248

llvm-svn: 222339

9 years agoAliasSetTracker: UnknownInsts should contribute to the refcount
David Majnemer [Wed, 19 Nov 2014 09:41:05 +0000 (09:41 +0000)]
AliasSetTracker: UnknownInsts should contribute to the refcount

AliasSetTracker::addUnknown may create an AliasSet devoid of pointers
just to contain an instruction if no suitable AliasSet already exists.
It will then AliasSet::addUnknownInst and we will be done.

However, it's possible for addUnknown to choose an existing AliasSet to
addUnknownInst.
If this were to occur, we are in a bit of a pickle: removing pointers
from the AliasSet can cause the entire AliasSet to become destroyed,
taking our unknown instructions out with them.

Instead, keep track whether or not our AliasSet has any unknown
instructions.

This fixes PR21582.

llvm-svn: 222338

9 years agoAdd missing header
David Blaikie [Wed, 19 Nov 2014 08:12:55 +0000 (08:12 +0000)]
Add missing header

llvm-svn: 222337

9 years agoUpdate for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool...
David Blaikie [Wed, 19 Nov 2014 07:49:54 +0000 (07:49 +0000)]
Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept.

llvm-svn: 222336

9 years agoUpdate for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool...
David Blaikie [Wed, 19 Nov 2014 07:49:47 +0000 (07:49 +0000)]
Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept.

llvm-svn: 222335

9 years agoUpdate SetVector to rely on the underlying set's insert to return a pair<iterator...
David Blaikie [Wed, 19 Nov 2014 07:49:26 +0000 (07:49 +0000)]
Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool>

This is to be consistent with StringSet and ultimately with the standard
library's associative container insert function.

This lead to updating SmallSet::insert to return pair<iterator, bool>,
and then to update SmallPtrSet::insert to return pair<iterator, bool>,
and then to update all the existing users of those functions...

llvm-svn: 222334

9 years ago[AArch64] Disable useAA for Cortex-A57.
Hao Liu [Wed, 19 Nov 2014 06:48:56 +0000 (06:48 +0000)]
[AArch64] Disable useAA for Cortex-A57.
Using AA during CodeGen is very useful for in-order cores. It is less useful for ooo cores. Also I find
enabling useAA for Cortex-A57 may generate worse code for some test cases. If useAA in codegen is improved
and benefical for ooo cores, we can enable it again.

llvm-svn: 222333

9 years agoRevert "[ELF] Sectionkey should also contain path."
Shankar Easwaran [Wed, 19 Nov 2014 06:47:29 +0000 (06:47 +0000)]
Revert "[ELF] Sectionkey should also contain path."

This reverts commit r222309.

Reverting because of failures on darwin bot.

llvm-svn: 222332

9 years ago[AArch64] Enable SeparateConstOffsetFromGEP, EarlyCSE and LICM passes on AArch64...
Hao Liu [Wed, 19 Nov 2014 06:39:53 +0000 (06:39 +0000)]
[AArch64] Enable SeparateConstOffsetFromGEP, EarlyCSE and LICM passes on AArch64 backend.
SeparateConstOffsetFromGEP can gives more optimizaiton opportunities related to GEPs, which benefits EarlyCSE
and LICM. By enabling these passes we can have better address calculations and generate a better addressing
mode. Some SPEC 2006 benchmarks (astar, gobmk, namd) have obvious improvements on Cortex-A57.

Reviewed in http://reviews.llvm.org/D5864.

llvm-svn: 222331

9 years agoRevert "[ELF] Rename MergedSection to OutputSection."
Shankar Easwaran [Wed, 19 Nov 2014 06:24:53 +0000 (06:24 +0000)]
Revert "[ELF] Rename MergedSection to OutputSection."

This reverts commit r222310.

Not sure which commit is the cause of the failure on the darwin bot. Will need
to revert my changes and commit one change at a time.

llvm-svn: 222330

9 years agoRevert "[ELF] Create input and output section names"
Shankar Easwaran [Wed, 19 Nov 2014 06:24:51 +0000 (06:24 +0000)]
Revert "[ELF] Create input and output section names"

This reverts commit r222311.

Reverting because of failure in the darwin bot.

llvm-svn: 222329

9 years ago[SeparateConstOffsetFromGEP] Allow SeparateConstOffsetFromGEP pass to lower GEPs.
Hao Liu [Wed, 19 Nov 2014 06:24:44 +0000 (06:24 +0000)]
[SeparateConstOffsetFromGEP] Allow SeparateConstOffsetFromGEP pass to lower GEPs.
If LowerGEP is enabled, it can lower a GEP with multiple indices into GEPs with a single index
or arithmetic operations. Lowering GEPs can always extract structure indices. Lowering GEPs can
also give use more optimization opportunities. It can benefit passes like CSE, LICM and CGP.

Reviewed in http://reviews.llvm.org/D5864

llvm-svn: 222328

9 years agoAdd the exception for strings in logical and expressions to -Wstring-conversion
Richard Trieu [Wed, 19 Nov 2014 06:08:18 +0000 (06:08 +0000)]
Add the exception for strings in logical and expressions to -Wstring-conversion
for C code.

llvm-svn: 222327

9 years agoRevert "[ELF] Fix creation of segments."
Shankar Easwaran [Wed, 19 Nov 2014 05:53:13 +0000 (05:53 +0000)]
Revert "[ELF] Fix creation of segments."

This reverts commit r222312.

There looks to be an intermittent failure in the darwin buildbot.

llvm-svn: 222326

9 years ago[Mips] Remove unnecessary debug logging code
Simon Atanasyan [Wed, 19 Nov 2014 05:51:16 +0000 (05:51 +0000)]
[Mips] Remove unnecessary debug logging code

No functional changes

llvm-svn: 222325

9 years ago[Mips] Configure PLT and LA25 entries in the corresponding constructors
Simon Atanasyan [Wed, 19 Nov 2014 05:51:10 +0000 (05:51 +0000)]
[Mips] Configure PLT and LA25 entries in the corresponding constructors

No functional changes.

llvm-svn: 222324

9 years ago[Mips] Inline the configurePLTReference method
Simon Atanasyan [Wed, 19 Nov 2014 05:51:05 +0000 (05:51 +0000)]
[Mips] Inline the configurePLTReference method

No functional changes.

llvm-svn: 222323

9 years ago[Mips] Remove redundant const_cast
Simon Atanasyan [Wed, 19 Nov 2014 05:50:59 +0000 (05:50 +0000)]
[Mips] Remove redundant const_cast

No functional changes.

llvm-svn: 222322

9 years ago[Mips] Make the function return type constant pointer
Simon Atanasyan [Wed, 19 Nov 2014 05:50:53 +0000 (05:50 +0000)]
[Mips] Make the function return type constant pointer

No functional changes.

llvm-svn: 222321

9 years ago[Mips] Move setup of LLD_R_MIPS_STO_PLT relocation to the getPLTEntry() routine
Simon Atanasyan [Wed, 19 Nov 2014 05:50:47 +0000 (05:50 +0000)]
[Mips] Move setup of LLD_R_MIPS_STO_PLT relocation to the getPLTEntry() routine

No functional changes.

llvm-svn: 222320

9 years agoRemove StringMap::GetOrCreateValue in favor of StringMap::insert
David Blaikie [Wed, 19 Nov 2014 05:49:42 +0000 (05:49 +0000)]
Remove StringMap::GetOrCreateValue in favor of StringMap::insert

Having two ways to do this doesn't seem terribly helpful and
consistently using the insert version (which we already has) seems like
it'll make the code easier to understand to anyone working with standard
data structures. (I also updated many references to the Entry's
key and value to use first() and second instead of getKey{Data,Length,}
and get/setValue - for similar consistency)

Also removes the GetOrCreateValue functions so there's less surface area
to StringMap to fix/improve/change/accommodate move semantics, etc.

llvm-svn: 222319

9 years agoOverhaul and separate nullptr_t tests to pass with C++03.
Eric Fiselier [Wed, 19 Nov 2014 05:49:03 +0000 (05:49 +0000)]
Overhaul and separate nullptr_t tests to pass with C++03.

The standard requires that nullptr_t can be reinterpret_cast to an integral type
at least the size of nullptr_t. There is no way to emulate this conversion in
the C++03 nullptr_t implementation. The test for this conversion has been moved
to a new test and marked XFAIL with c++03.

This recommits what was originally r222296.

llvm-svn: 222318

9 years agoclang-format a recent commit I made
David Blaikie [Wed, 19 Nov 2014 05:48:40 +0000 (05:48 +0000)]
clang-format a recent commit I made

llvm-svn: 222317

9 years agoRevert r222296 to fix bad commit message
Eric Fiselier [Wed, 19 Nov 2014 05:41:29 +0000 (05:41 +0000)]
Revert r222296 to fix bad commit message

llvm-svn: 222316

9 years agoWrap to 80 columns, no behavior change.
Nico Weber [Wed, 19 Nov 2014 05:21:39 +0000 (05:21 +0000)]
Wrap to 80 columns, no behavior change.

llvm-svn: 222315

9 years agoRemove accidentally commited line in commit. Sorry
Eric Fiselier [Wed, 19 Nov 2014 05:00:57 +0000 (05:00 +0000)]
Remove accidentally commited line in commit. Sorry

llvm-svn: 222314

9 years ago[ELF] Handle ctors/dtors sections
Shankar Easwaran [Wed, 19 Nov 2014 03:51:50 +0000 (03:51 +0000)]
[ELF] Handle ctors/dtors sections

Move functionality from MIPS target to DefaultLayout.

No change in functionality.

llvm-svn: 222313

9 years ago[ELF] Fix creation of segments.
Shankar Easwaran [Wed, 19 Nov 2014 03:51:48 +0000 (03:51 +0000)]
[ELF] Fix creation of segments.

Linker was creating a separate output segment in some cases if input sections
had huge alignments. This patch fixes the issue.

llvm-svn: 222312

9 years ago[ELF] Create input and output section names
Shankar Easwaran [Wed, 19 Nov 2014 03:51:45 +0000 (03:51 +0000)]
[ELF] Create input and output section names

No change in functionality.

llvm-svn: 222311

9 years ago[ELF] Rename MergedSection to OutputSection.
Shankar Easwaran [Wed, 19 Nov 2014 03:51:43 +0000 (03:51 +0000)]
[ELF] Rename MergedSection to OutputSection.

No change in functionality.

llvm-svn: 222310

9 years ago[ELF] Sectionkey should also contain path.
Shankar Easwaran [Wed, 19 Nov 2014 03:51:41 +0000 (03:51 +0000)]
[ELF] Sectionkey should also contain path.

No change in functionality.

llvm-svn: 222309

9 years agoTeach llvm-build to avoid touching LibraryDependencies.inc unless the contents
Peter Collingbourne [Wed, 19 Nov 2014 03:34:20 +0000 (03:34 +0000)]
Teach llvm-build to avoid touching LibraryDependencies.inc unless the contents
change. This saves us from rebuilding llvm-config each time we reconfigure.

llvm-svn: 222308

9 years agoExpose LLVM version string via macro in llvm-config.h, and modify Go bindings
Peter Collingbourne [Wed, 19 Nov 2014 03:34:17 +0000 (03:34 +0000)]
Expose LLVM version string via macro in llvm-config.h, and modify Go bindings
to make use of it.

llvm-svn: 222307

9 years agoStandardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.
David Blaikie [Wed, 19 Nov 2014 03:06:06 +0000 (03:06 +0000)]
Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.

llvm-svn: 222306

9 years agoRemove uses of StringMap::GetOrCreateValue in favor of stl-compatible API usage
David Blaikie [Wed, 19 Nov 2014 03:05:07 +0000 (03:05 +0000)]
Remove uses of StringMap::GetOrCreateValue in favor of stl-compatible API usage

llvm-svn: 222305

9 years agoUpdate for LLVM API change
David Blaikie [Wed, 19 Nov 2014 03:04:29 +0000 (03:04 +0000)]
Update for LLVM API change

llvm-svn: 222304

9 years agoUpdate for LLVM API change
David Blaikie [Wed, 19 Nov 2014 02:56:13 +0000 (02:56 +0000)]
Update for LLVM API change

llvm-svn: 222303