platform/upstream/llvm.git
8 years ago[DAG] use !isUndef() ; NFCI
Sanjay Patel [Mon, 14 Mar 2016 18:09:43 +0000 (18:09 +0000)]
[DAG] use !isUndef() ; NFCI

llvm-svn: 263453

8 years agoAdd failing tests that I forgot to add to the last commit
Marshall Clow [Mon, 14 Mar 2016 17:58:54 +0000 (17:58 +0000)]
Add failing tests that I forgot to add to the last commit

llvm-svn: 263451

8 years agoImplement LWG#2566: Requirements on the first template parameter of container adaptors
Marshall Clow [Mon, 14 Mar 2016 17:58:11 +0000 (17:58 +0000)]
Implement LWG#2566: Requirements on the first template parameter of container adaptors

llvm-svn: 263450

8 years ago[modules] Don't diagnose non-modular includes from modular files that are
Richard Smith [Mon, 14 Mar 2016 17:52:37 +0000 (17:52 +0000)]
[modules] Don't diagnose non-modular includes from modular files that are
implementation units of modules rather than interface units.

llvm-svn: 263449

8 years ago[DAG] use isUndef() ; NFCI
Sanjay Patel [Mon, 14 Mar 2016 17:28:46 +0000 (17:28 +0000)]
[DAG] use isUndef() ; NFCI

llvm-svn: 263448

8 years agoAMDGPU/SI: Handle wait states required for DPP instructions
Tom Stellard [Mon, 14 Mar 2016 17:05:56 +0000 (17:05 +0000)]
AMDGPU/SI: Handle wait states required for DPP instructions

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 263447

8 years ago[x86, AVX] replace masked load with full vector load when possible
Sanjay Patel [Mon, 14 Mar 2016 16:54:43 +0000 (16:54 +0000)]
[x86, AVX] replace masked load with full vector load when possible

Converting masked vector loads to regular vector loads for x86 AVX should always be a win.
I raised the legality issue of reading the extra memory bytes on llvm-dev. I did not see any
objections.

1. x86 already does this kind of optimization for multiple scalar loads -> vector load.
2. If other targets have the same flexibility, we could move this transform up to CGP or DAGCombiner.

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

llvm-svn: 263446

8 years ago[mips] MIPS32R6 compact branch support
Daniel Sanders [Mon, 14 Mar 2016 16:24:05 +0000 (16:24 +0000)]
[mips] MIPS32R6 compact branch support

Summary:
MIPSR6 introduces a class of branches called compact branches. Unlike the
traditional MIPS branches which have a delay slot, compact branches do not
have a delay slot. The instruction following the compact branch is only
executed if the branch is not taken and must not be a branch.

It works by generating compact branches for MIPS32R6 when the delay slot
filler cannot fill a delay slot. Then, inspecting the generated code for
forbidden slot hazards (a compact branch with an adjacent branch or other
CTI) and inserting nops to clear this hazard.

Patch by Simon Dardis.

Reviewers: vkalintiris, dsanders

Subscribers: MatzeB, dsanders, llvm-commits

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

llvm-svn: 263444

8 years ago[OpenMP] Replace offloading option that start with -o with -fo.
Samuel Antao [Mon, 14 Mar 2016 15:57:41 +0000 (15:57 +0000)]
[OpenMP] Replace offloading option that start with -o with -fo.

Summary:
The current offloading implementation is using -omptargets and -omp-host-ir-file-path options in the frontend. This causes the user a lot of trouble due to to the conflicts with the -o option. E.g. if the user misspells  omptargets he will end up with a file with a weird name.

This patches replaces these two options with  -fomptargets and -fomp-host-ir-file-path to avoid these issues, and it is also more consistent with the other options like -fopenmp.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, caomhin, fraggamuffin

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

llvm-svn: 263442

8 years agoAMDGPU/SI: Incomplete shader binaries need to finish execution at the end
Marek Olsak [Mon, 14 Mar 2016 15:57:14 +0000 (15:57 +0000)]
AMDGPU/SI: Incomplete shader binaries need to finish execution at the end

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

llvm-svn: 263441

8 years agoAMDGPU: mark llvm.amdgcn.image.atomic.* as a source of divergence
Nicolai Haehnle [Mon, 14 Mar 2016 15:37:18 +0000 (15:37 +0000)]
AMDGPU: mark llvm.amdgcn.image.atomic.* as a source of divergence

Summary:
When multiple threads perform an atomic op with the same arguments, they
will usually see different return values.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

llvm-svn: 263440

8 years ago[test] Correctly retry connections on android targets
Pavel Labath [Mon, 14 Mar 2016 15:33:25 +0000 (15:33 +0000)]
[test] Correctly retry connections on android targets

Summary:
Normally, when the remote stub is not ready, we will get ECONNREFUSED during the connect()
attempt. However, due to the way how ADB forwarding works, on android targets the connect() will
always be successful, but the connection will be immediately dropped if ADB could not connect on
the remote side. This commit tries to detect this situation, and report it as "connection
refused" so that the upper test layers attempt the connection again.

Reviewers: tfiala, tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 263439

8 years ago[mips] Use range-based for loops. NFC.
Vasileios Kalintiris [Mon, 14 Mar 2016 15:05:30 +0000 (15:05 +0000)]
[mips] Use range-based for loops. NFC.

llvm-svn: 263438

8 years agoRevert "Recommitted r261633 "Supporting all entities declared in lexical scope in...
Benjamin Kramer [Mon, 14 Mar 2016 14:58:36 +0000 (14:58 +0000)]
Revert "Recommitted r261633 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26715 at r263379."

This reverts commit r263424. Breaks self-host.

llvm-svn: 263437

8 years agoRevert "Recommitted r261634 "Supporting all entities declared in lexical scope in...
Benjamin Kramer [Mon, 14 Mar 2016 14:58:28 +0000 (14:58 +0000)]
Revert "Recommitted r261634 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26715 at r263379."

This reverts commit r263425. Breaks self-host.

llvm-svn: 263436

8 years agoFix some more tests with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Mon, 14 Mar 2016 14:34:10 +0000 (14:34 +0000)]
Fix some more tests with CLANG_DEFAULT_CXX_STDLIB

Also use -stdlib=platform instead of -stdlib=libstdc++ when testing if Clang
chooses the correct default for the given platform.

llvm-svn: 263435

8 years agoMake FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Mon, 14 Mar 2016 14:34:04 +0000 (14:34 +0000)]
Make FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIB

Also introduce -stdlib=platform to override the configured value
and use it to make the tests always pass.

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

llvm-svn: 263434

8 years agoRemove dead code. NFC.
George Rimar [Mon, 14 Mar 2016 14:25:28 +0000 (14:25 +0000)]
Remove dead code. NFC.

llvm-svn: 263433

8 years agoAllow any build-id length between 4 and 20 bytes inclusive
Ed Maste [Mon, 14 Mar 2016 14:06:00 +0000 (14:06 +0000)]
Allow any build-id length between 4 and 20 bytes inclusive

Build-id support is being added to lld and by default it may produce a
64-bit build-id.

Prior to this change lldb would reject such a build-id. However, it then
falls back to a 4-byte crc32, which is a poorer quality identifier.

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

llvm-svn: 263432

8 years ago[SystemZ] Avoid LER on z13 due to partial register dependencies
Ulrich Weigand [Mon, 14 Mar 2016 13:50:03 +0000 (13:50 +0000)]
[SystemZ] Avoid LER on z13 due to partial register dependencies

On the z13, it turns out to be more efficient to access a full
floating-point register than just the upper half (as done e.g.
by the LE and LER instructions).

Current code already takes this into account when loading from
memory by using the LDE instruction in place of LE.  However,
we still generate LER, which shows the same performance issues
as LE in certain circumstances.

This patch changes the back-end to emit LDR instead of LER to
implement FP32 register-to-register copies on z13.

llvm-svn: 263431

8 years ago[CVP] Replace nonnegative with positive, per Philip's request. NFC.
Chad Rosier [Mon, 14 Mar 2016 13:48:00 +0000 (13:48 +0000)]
[CVP] Replace nonnegative with positive, per Philip's request. NFC.

llvm-svn: 263430

8 years ago[Frontend] Disable value name discarding for all sanitizers.
Benjamin Kramer [Mon, 14 Mar 2016 13:23:58 +0000 (13:23 +0000)]
[Frontend] Disable value name discarding for all sanitizers.

ASan also relies on names on allocas and will emit unhelpful output if
they're not present. Just force-enable value names for now. Should
unbreak release builds of asan.

llvm-svn: 263429

8 years ago[mips] Fix an issue with long double when function roundl is defined
Zlatko Buljan [Mon, 14 Mar 2016 12:50:23 +0000 (12:50 +0000)]
[mips] Fix an issue with long double when function roundl is defined
Differential Revision: http://reviews.llvm.org/D17760

llvm-svn: 263428

8 years ago[mips] Range check uimm16_64
Daniel Sanders [Mon, 14 Mar 2016 12:44:44 +0000 (12:44 +0000)]
[mips] Range check uimm16_64

Summary:

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 263427

8 years ago[clang-tidy] Fix "Name is not a simple identifier" assertion in `modernize-loop-conve...
Haojian Wu [Mon, 14 Mar 2016 12:41:24 +0000 (12:41 +0000)]
[clang-tidy] Fix "Name is not a simple identifier" assertion in `modernize-loop-convert` check.

Summary:
Fix assertion failure: "Name is not a simple identifier".

`Decl::GetName` assumes the name should be an identifier. When the check
processes the function calling statement with speciail key name like
'it.operator->()', it will trigger the assert in `GetName`.

Rather than using `Decl::GetName`, we use `getNameAsString` which works
with special key names in C++.

Reviewers: bkramer

Subscribers: cfe-commits

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

llvm-svn: 263426

8 years agoRecommitted r261634 "Supporting all entities declared in lexical scope in LLVM debug...
Amjad Aboud [Mon, 14 Mar 2016 12:03:55 +0000 (12:03 +0000)]
Recommitted r261634 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26715 at r263379.

llvm-svn: 263425

8 years agoRecommitted r261633 "Supporting all entities declared in lexical scope in LLVM debug...
Amjad Aboud [Mon, 14 Mar 2016 12:03:20 +0000 (12:03 +0000)]
Recommitted r261633 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26715 at r263379.

llvm-svn: 263424

8 years ago[mips] Simplify ordering of range checked immediate classes.
Daniel Sanders [Mon, 14 Mar 2016 11:46:30 +0000 (11:46 +0000)]
[mips] Simplify ordering of range checked immediate classes.

Summary:
With the addition of checks to ensure that operands have a strict ordering
it has become tricky to manage the order in the way I originally intended.

This patch linearizes the ordering which simplifies the implementation but
requires an order that is arbitrary in places. Here are some examples:
* uimm4 < uimm5 < uimm6
* simm4 < uimm4 < simm5 < uimm5
* uimm5 < uimm5_plus1 (1..32) < uimm5_plus32 (32..63) < uimm6
  The term 'superset' starts to break down here since the *_plus* classes
  are not true supersets of uimm5 (but they are still subsets of uimm6).
* uimm5 < uimm5_64, and uimm5 < vsplat_uimm5
  This is entirely arbitrary. We need an ordering and what we pick is
  unimportant since only one is possible for a given mnemonic.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 263423

8 years ago[Driver] Enable --rtlib option for MSVC target
Andrey Turetskiy [Mon, 14 Mar 2016 11:19:43 +0000 (11:19 +0000)]
[Driver] Enable --rtlib option for MSVC target

This enables "--rtlib compiler-rt" option under MSVC environment.

Patch by Roman Shirokiy.

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

llvm-svn: 263422

8 years agoExtend XFlaky in TestProcessIO to linux as well
Pavel Labath [Mon, 14 Mar 2016 11:19:39 +0000 (11:19 +0000)]
Extend XFlaky in TestProcessIO to linux as well

The test sometimes fails on local linux as well. The cause is the same.

llvm-svn: 263421

8 years ago[AMDGPU] Assembler: SOP* instruction fixes
Nikolay Haustov [Mon, 14 Mar 2016 11:17:19 +0000 (11:17 +0000)]
[AMDGPU] Assembler: SOP* instruction fixes

s_bitset0_b64, s_bitset1_b64 has 32-bit src0, not 64-bit.
s_rfe_b64 has just one destination operand and no source.
Uncomment S_BITCMP* and S_SETVSKIP, adjust SOPC_* classes for that.
Add s_memrealtime test and change comments in smem.s to follow common style.
Change test for s_memtime to use non-zero register to make it really test encoding.
Add tests for s_buffer_load*.
Add tests for SOPC instructions (same for SI and VI)

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

llvm-svn: 263420

8 years ago[mips] Range check uimm6_lsl2.
Daniel Sanders [Mon, 14 Mar 2016 11:16:56 +0000 (11:16 +0000)]
[mips] Range check uimm6_lsl2.

Summary:

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

llvm-svn: 263419

8 years agoTry to fix build of WebAssemblyRegStackify.cpp on Windows
Hans Wennborg [Mon, 14 Mar 2016 11:04:15 +0000 (11:04 +0000)]
Try to fix build of WebAssemblyRegStackify.cpp on Windows

It's failing to build on VS2015 with:

C:\b\build\slave\ClangToTWin\build\src\third_party\llvm\lib\Target\WebAssembly\WebAssemblyRegStackify.cpp(520):
error C2668: 'llvm::make_reverse_iterator': ambiguous call to overloaded function
C:\b\build\slave\ClangToTWin\build\src\third_party\llvm\include\llvm/ADT/STLExtras.h(217):
note: could be 'std::reverse_iterator<llvm::MachineBasicBlock::iterator>
llvm::make_reverse_iterator<llvm::MachineInstrBundleIterator<llvm::MachineInstr>>(IteratorTy)'
        with
        [
            IteratorTy=llvm::MachineInstrBundleIterator<llvm::MachineInstr>
        ]
C:\b\depot_tools\win_toolchain\vs_files\391bbf1220d3edcd3cc3fccdb56224181e3b13a7\win_sdk\bin\..\..\VC\include\xutility(1217):
note: or 'std::reverse_iterator<llvm::MachineBasicBlock::iterator>
std::make_reverse_iterator<llvm::MachineInstrBundleIterator<llvm::MachineInstr>>(_RanIt)' [found using argument-dependent lookup]
        with
        [
            _RanIt=llvm::MachineInstrBundleIterator<llvm::MachineInstr>
        ]

I don't have VS2015 locally at the moment, but hopefully this will help.

llvm-svn: 263418

8 years agoAVX512: icmp operation should be always lowered to CMPM (AVX-512) instruction on...
Igor Breger [Mon, 14 Mar 2016 10:26:39 +0000 (10:26 +0000)]
AVX512: icmp operation should be always lowered to CMPM (AVX-512) instruction on SKX.

implemented by delena

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

llvm-svn: 263417

8 years ago[ELF] implement --warn-common/--no-warn-common
George Rimar [Mon, 14 Mar 2016 09:19:30 +0000 (09:19 +0000)]
[ELF] implement --warn-common/--no-warn-common

-warn-common
Warn when a common symbol is combined with another common symbol
or with a symbol definition.  Unix linkers allow  this  somewhat
sloppy  practice, but linkers on some other operating systems do
not.  This option allows you to  find  potential  problems  from
combining global symbols.

Differential revision: http://reviews.llvm.org/D17998

llvm-svn: 263413

8 years agoTemporarily make discard value names depend on whether or not we're
Eric Christopher [Mon, 14 Mar 2016 08:10:47 +0000 (08:10 +0000)]
Temporarily make discard value names depend on whether or not we're
trying to track origins in the memory sanitizer since the backend
instrumentation pass currently takes names from the Instruction.

Fixes all of the origin tracking tests in compiler-rt after the
-discard-value-name option was added.

llvm-svn: 263412

8 years ago[AMDGPU] AsmParser: Factor out parseRegister. NFC.
Valery Pykhtin [Mon, 14 Mar 2016 07:43:42 +0000 (07:43 +0000)]
[AMDGPU] AsmParser: Factor out parseRegister. NFC.

llvm-svn: 263411

8 years agoGive the test a temporary output so it can be cleaned up.
Eric Christopher [Mon, 14 Mar 2016 06:21:07 +0000 (06:21 +0000)]
Give the test a temporary output so it can be cleaned up.

llvm-svn: 263410

8 years ago[AMDGPU] AsmParser: refactor post push_back vector access. NFC.
Valery Pykhtin [Mon, 14 Mar 2016 05:25:44 +0000 (05:25 +0000)]
[AMDGPU] AsmParser: refactor post push_back vector access. NFC.

llvm-svn: 263409

8 years ago[CodeView] Consistently handle overly large symbol names
David Majnemer [Mon, 14 Mar 2016 05:15:09 +0000 (05:15 +0000)]
[CodeView] Consistently handle overly large symbol names

Overly large symbol names weren't correctly handled for leaf function
records.

llvm-svn: 263408

8 years ago[AMDGPU] AsmParser: remove redundant isReg checks. NFC.
Valery Pykhtin [Mon, 14 Mar 2016 05:01:45 +0000 (05:01 +0000)]
[AMDGPU] AsmParser: remove redundant isReg checks. NFC.

llvm-svn: 263407

8 years ago[CVP] Convert an SDiv to a UDiv if both operands are known to be nonnegative
Haicheng Wu [Mon, 14 Mar 2016 03:24:28 +0000 (03:24 +0000)]
[CVP] Convert an SDiv to a UDiv if both operands are known to be nonnegative

The motivating example is this

for (j = n; j > 1; j = i) {
   i = j / 2;
}

The signed division is safely to be changed to an unsigned division (j is known
to be larger than 1 from the loop guard) and later turned into a single shift
without considering the sign bit.

llvm-svn: 263406

8 years agoMark exception-throwing test as XFAIL when exceptions are disabled
Marshall Clow [Mon, 14 Mar 2016 02:51:50 +0000 (02:51 +0000)]
Mark exception-throwing test as XFAIL when exceptions are disabled

llvm-svn: 263405

8 years agoAdd facility to add/remove/check attribute on function and arguments.
Amaury Sechet [Mon, 14 Mar 2016 01:37:29 +0000 (01:37 +0000)]
Add facility to add/remove/check attribute on function and arguments.

Summary: This comes from work to make attribute manipulable via the C API.

Reviewers: gottesmm, hfinkel, baldrick, echristo, tejohnson

Subscribers: llvm-commits

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

llvm-svn: 263404

8 years ago[MCSchedule] Remove comments about MinLatency. NFC
Junmo Park [Mon, 14 Mar 2016 00:36:19 +0000 (00:36 +0000)]
[MCSchedule] Remove comments about MinLatency. NFC

Summary:
There is no definition about MinLatency any more.

Reviewers: mcrosier, spatel, hfinkel

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

llvm-svn: 263403

8 years ago[X86][XOP] Added target shuffle combine tests for XOP's VPPERM 2-op shuffle
Simon Pilgrim [Mon, 14 Mar 2016 00:18:26 +0000 (00:18 +0000)]
[X86][XOP] Added target shuffle combine tests for XOP's VPPERM 2-op shuffle

Actual combing support will be added in a future patch

llvm-svn: 263402

8 years agoPrint out newline in both cases.
Rui Ueyama [Sun, 13 Mar 2016 23:07:42 +0000 (23:07 +0000)]
Print out newline in both cases.

llvm-svn: 263401

8 years agoTry to get cl-pch-showincludes passing on AArch64 bots.
Nico Weber [Sun, 13 Mar 2016 22:26:26 +0000 (22:26 +0000)]
Try to get cl-pch-showincludes passing on AArch64 bots.

llvm-svn: 263400

8 years agoRevert "Revert "Update Polly for the removal of PreserveNames from IRBuilder stuff""
Mehdi Amini [Sun, 13 Mar 2016 22:21:43 +0000 (22:21 +0000)]
Revert "Revert "Update Polly for the removal of PreserveNames from IRBuilder stuff""

This reverts commit r263322 and reapplies r263296. The original
r263258 was reapplied in LLVM after being reverted in r263321 due to
issues with Release testing in Clang.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263399

8 years agoSimplify. NFC.
Rui Ueyama [Sun, 13 Mar 2016 22:08:11 +0000 (22:08 +0000)]
Simplify. NFC.

llvm-svn: 263398

8 years agoRemove uint32_X type.
Rui Ueyama [Sun, 13 Mar 2016 22:02:04 +0000 (22:02 +0000)]
Remove uint32_X type.

This type is equivalent to Elf_Word type.

llvm-svn: 263397

8 years agoRemove some unused variables
David Blaikie [Sun, 13 Mar 2016 22:00:18 +0000 (22:00 +0000)]
Remove some unused variables

llvm-svn: 263396

8 years agoELF: Split initializeSections and add comments.
Rui Ueyama [Sun, 13 Mar 2016 21:52:57 +0000 (21:52 +0000)]
ELF: Split initializeSections and add comments.

llvm-svn: 263395

8 years agoRemove compile time PreserveName in favor of a runtime cc1 -discard-value-names option
Mehdi Amini [Sun, 13 Mar 2016 21:05:23 +0000 (21:05 +0000)]
Remove compile time PreserveName in favor of a runtime cc1 -discard-value-names option

Summary:
This flag is enabled by default in the driver when NDEBUG is set. It
is forwarded on the LLVMContext to discard all value names (but
GlobalValue) for performance purpose.

This an improved version of D18024

Reviewers: echristo, chandlerc

Subscribers: cfe-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263394

8 years agoRemove PreserveNames template parameter from IRBuilder
Mehdi Amini [Sun, 13 Mar 2016 21:05:13 +0000 (21:05 +0000)]
Remove PreserveNames template parameter from IRBuilder

This reapplies r263258, which was reverted in r263321 because
of issues on Clang side.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263393

8 years agoRemove `else` after `return`.
Rui Ueyama [Sun, 13 Mar 2016 20:54:38 +0000 (20:54 +0000)]
Remove `else` after `return`.

llvm-svn: 263392

8 years agoSimplify. NFC.
Rui Ueyama [Sun, 13 Mar 2016 20:34:34 +0000 (20:34 +0000)]
Simplify. NFC.

llvm-svn: 263391

8 years agoRemove unused #include.
Rui Ueyama [Sun, 13 Mar 2016 20:28:29 +0000 (20:28 +0000)]
Remove unused #include.

llvm-svn: 263390

8 years agoRemove a local variable. NFC.
Rui Ueyama [Sun, 13 Mar 2016 20:18:12 +0000 (20:18 +0000)]
Remove a local variable. NFC.

llvm-svn: 263389

8 years ago[ELF][MIPS] Use TargetInfo::needsGot call to check necessity of GOT for local symbols...
Simon Atanasyan [Sun, 13 Mar 2016 20:13:24 +0000 (20:13 +0000)]
[ELF][MIPS] Use TargetInfo::needsGot call to check necessity of GOT for local symbols. NFC.

llvm-svn: 263388

8 years agoELF: Add `Rela` member variable to Config.
Rui Ueyama [Sun, 13 Mar 2016 20:10:20 +0000 (20:10 +0000)]
ELF: Add `Rela` member variable to Config.

The member is true if we want to create relocatin sections with RELA
instead of REL.

llvm-svn: 263387

8 years agoELF: Redefine canBeDefined as a member function of SymbolBody.
Rui Ueyama [Sun, 13 Mar 2016 19:48:18 +0000 (19:48 +0000)]
ELF: Redefine canBeDefined as a member function of SymbolBody.

We want to make SymbolBody the central place to query symbol information.
This patch also renames canBePreempted to isPreemptible because I feel that
the latter is slightly better (the former is three words and the latter
is two words.)

llvm-svn: 263386

8 years agoELF: Set e_flags header only when MIPS.
Rui Ueyama [Sun, 13 Mar 2016 19:29:17 +0000 (19:29 +0000)]
ELF: Set e_flags header only when MIPS.

The field is zero by default, so this is NFC.

llvm-svn: 263385

8 years ago[X86][SSE] Added truncated vector arithmetic tests.
Simon Pilgrim [Sun, 13 Mar 2016 19:08:01 +0000 (19:08 +0000)]
[X86][SSE] Added truncated vector arithmetic tests.

For cases where we are truncating an integer vector arithmetic result, it may be better to pre-truncate the input operands - no code to support this yet (scalar is done with SimplifyDemandedBits but adding vector support could be a lot of work) but these tests represent the current codegen status.

Example bugs: PR14666, PR22703

llvm-svn: 263384

8 years ago[X86][SSE41] Avoid variable blend for constant v8i16 shifts
Simon Pilgrim [Sun, 13 Mar 2016 18:35:59 +0000 (18:35 +0000)]
[X86][SSE41] Avoid variable blend for constant v8i16 shifts

The SSE41 v8i16 shift lowering using (v)pblendvb is great for non-constant shift amounts, but if it is constant then we can efficiently reduce the VSELECT to shuffles with the pre-SSE41 lowering.

llvm-svn: 263383

8 years ago[ELF][MIPS] Add elf namespace name to the ObjectFile.
Simon Atanasyan [Sun, 13 Mar 2016 15:48:41 +0000 (15:48 +0000)]
[ELF][MIPS] Add elf namespace name to the ObjectFile.

NFC. Follow-up to r263381.

llvm-svn: 263382

8 years ago[ELF][MIPS] Factor out SumVA adjustments into a couple of separate functions. NFC.
Simon Atanasyan [Sun, 13 Mar 2016 15:37:38 +0000 (15:37 +0000)]
[ELF][MIPS] Factor out SumVA adjustments into a couple of separate functions. NFC.

The patch does not reduce the size of the code but makes
InputSectionBase::relocate cleaner a bit.

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

llvm-svn: 263381

8 years agoAdded test that covers changes in r263379.
Amjad Aboud [Sun, 13 Mar 2016 11:12:57 +0000 (11:12 +0000)]
Added test that covers changes in r263379.

llvm-svn: 263380

8 years agoFixed DIBuilder to verify that same imported entity will not be added twice to the...
Amjad Aboud [Sun, 13 Mar 2016 11:11:39 +0000 (11:11 +0000)]
Fixed DIBuilder to verify that same imported entity will not be added twice to the "imports" list of the DICompileUnit.

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

llvm-svn: 263379

8 years ago[CodeView] Truncate display names
David Majnemer [Sun, 13 Mar 2016 10:53:30 +0000 (10:53 +0000)]
[CodeView] Truncate display names

Fundamentally, the length of a variable or function name is bound by the
maximum size of a record: 0xffff.  However, the name doesn't live in a
vacuum; other data is associated with the name, lowering the bound
further.

We would naively attempt to emit the name, causing us to assert because
the record would no-longer fit in 16-bits.  Instead, truncate the name
but preserve as much as we can.

While I have tested this locally, I've decided to not commit it due to
the test's size.

N.B.  While this behavior is undesirable, it is better than MSVC's
behavior.  They seem to truncate to ~4000 characters.

llvm-svn: 263378

8 years ago[Bitcode] Make writeComdats less strange
David Majnemer [Sun, 13 Mar 2016 08:01:03 +0000 (08:01 +0000)]
[Bitcode] Make writeComdats less strange

It had a weird artificial limitation on the write side: the comdat name
couldn't be bigger than 2**16.  However, the reader had no such
limitation.  Make the reader and the writer agree.

llvm-svn: 263377

8 years agoCosmetic change. NFC.
Rui Ueyama [Sun, 13 Mar 2016 06:50:34 +0000 (06:50 +0000)]
Cosmetic change. NFC.

llvm-svn: 263376

8 years agoMove an OutputSectionBase member function to the top.
Rui Ueyama [Sun, 13 Mar 2016 06:50:33 +0000 (06:50 +0000)]
Move an OutputSectionBase member function to the top.

llvm-svn: 263375

8 years agoConstantFoldInstruction: avoid wasted calls to ConstantFoldConstantExpression
Fiona Glaser [Sun, 13 Mar 2016 05:36:15 +0000 (05:36 +0000)]
ConstantFoldInstruction: avoid wasted calls to ConstantFoldConstantExpression

Check to see if all operands are constant before calling simplify on them
so that we don't perform wasted simplifications.

llvm-svn: 263374

8 years agoSimplify. NFC.
Rui Ueyama [Sun, 13 Mar 2016 05:23:40 +0000 (05:23 +0000)]
Simplify. NFC.

llvm-svn: 263373

8 years agoFix build
Matt Arsenault [Sun, 13 Mar 2016 05:22:08 +0000 (05:22 +0000)]
Fix build

llvm-svn: 263372

8 years agoUpdate for new argument to scalbn
Matt Arsenault [Sun, 13 Mar 2016 05:12:47 +0000 (05:12 +0000)]
Update for new argument to scalbn

llvm-svn: 263371

8 years agoAPFloat: Fix ilogb for denormals
Matt Arsenault [Sun, 13 Mar 2016 05:12:32 +0000 (05:12 +0000)]
APFloat: Fix ilogb for denormals

llvm-svn: 263370

8 years agoAPFloat: Fix scalbn handling of denormals
Matt Arsenault [Sun, 13 Mar 2016 05:11:51 +0000 (05:11 +0000)]
APFloat: Fix scalbn handling of denormals

This was incorrect for denormals, and also failed
on longer exponent ranges.

llvm-svn: 263369

8 years agoUse RelTy instead of Elf_Rel_Impl<ELFT, isRela> for readability.
Rui Ueyama [Sun, 13 Mar 2016 05:06:50 +0000 (05:06 +0000)]
Use RelTy instead of Elf_Rel_Impl<ELFT, isRela> for readability.

llvm-svn: 263368

8 years agoDefine IsRela static const member to Elf_Rel type.
Rui Ueyama [Sun, 13 Mar 2016 04:55:44 +0000 (04:55 +0000)]
Define IsRela static const member to Elf_Rel type.

So that we can write RelTy::IsRela to query its type.

llvm-svn: 263367

8 years agoCosmetic change to reduce repetitions. NFC.
Rui Ueyama [Sun, 13 Mar 2016 04:40:17 +0000 (04:40 +0000)]
Cosmetic change to reduce repetitions. NFC.

llvm-svn: 263366

8 years agoRedefine isGnuIfunc as a member function of SymbolBody.
Rui Ueyama [Sun, 13 Mar 2016 04:40:14 +0000 (04:40 +0000)]
Redefine isGnuIfunc as a member function of SymbolBody.

llvm-svn: 263365

8 years agoBody can never be null in this context.
Rui Ueyama [Sun, 13 Mar 2016 04:40:12 +0000 (04:40 +0000)]
Body can never be null in this context.

Because of the recent commit to allocate SymbolBodies for local symbols.

llvm-svn: 263364

8 years agoRemove dead code.
Rui Ueyama [Sun, 13 Mar 2016 04:25:43 +0000 (04:25 +0000)]
Remove dead code.

llvm-svn: 263363

8 years agoDo not return a bool value from error().
Rui Ueyama [Sun, 13 Mar 2016 04:25:41 +0000 (04:25 +0000)]
Do not return a bool value from error().

error returned true if there was an error. This allows us to replace
the code like this

  if (EC) {
    error(EC, "something failed");
    return;
  }

with

  if (error(EC, "something failed"))
    return;

I thought that that was a good idea, but it turned out that we only
have two places to use this pattern. So this patch removes that feature.

llvm-svn: 263362

8 years agoThe difference of getBss() and Out<ELFT>::Bss is subtle, so remove that function.
Rui Ueyama [Sun, 13 Mar 2016 04:11:53 +0000 (04:11 +0000)]
The difference of getBss() and Out<ELFT>::Bss is subtle, so remove that function.

llvm-svn: 263361

8 years agoSplit addCopyRelSymbols. NFC.
Rui Ueyama [Sun, 13 Mar 2016 04:05:42 +0000 (04:05 +0000)]
Split addCopyRelSymbols. NFC.

llvm-svn: 263360

8 years agoRemove redundant check.
Rui Ueyama [Sun, 13 Mar 2016 03:43:32 +0000 (03:43 +0000)]
Remove redundant check.

The control reaches here only when linking MIPS binaries.

llvm-svn: 263359

8 years agoFix spelling.
Rui Ueyama [Sun, 13 Mar 2016 03:17:44 +0000 (03:17 +0000)]
Fix spelling.

llvm-svn: 263358

8 years ago"Windows" is a product name, so it should be spelled correctly.
Rui Ueyama [Sun, 13 Mar 2016 03:17:42 +0000 (03:17 +0000)]
"Windows" is a product name, so it should be spelled correctly.

llvm-svn: 263357

8 years agoSimplify findMipsPairedReloc function signature. NFC.
Rui Ueyama [Sun, 13 Mar 2016 03:09:40 +0000 (03:09 +0000)]
Simplify findMipsPairedReloc function signature. NFC.

llvm-svn: 263356

8 years agoAlso test that the pch file is not printed in /showIncludes
Nico Weber [Sun, 13 Mar 2016 03:04:46 +0000 (03:04 +0000)]
Also test that the pch file is not printed in /showIncludes

llvm-svn: 263355

8 years ago[X86] Remove many operands that represent memory stores from outs to ins. These opera...
Craig Topper [Sun, 13 Mar 2016 02:56:31 +0000 (02:56 +0000)]
[X86] Remove many operands that represent memory stores from outs to ins. These operands are the registers and immediates that specify the memory address not the memory itself thus they are inputs.

llvm-svn: 263354

8 years agoMake test a bit stricter to check not just the file basename is printed.
Nico Weber [Sun, 13 Mar 2016 02:48:51 +0000 (02:48 +0000)]
Make test a bit stricter to check not just the file basename is printed.

llvm-svn: 263353

8 years agoclang-cl: Add /Yc argument to /showIncludes output.
Nico Weber [Sun, 13 Mar 2016 02:44:13 +0000 (02:44 +0000)]
clang-cl: Add /Yc argument to /showIncludes output.

To make this work, delay printing of ExtraDeps in HeaderIncludesCallback a bit,
so that it happens after CompilerInstance::InitializeSourceManager() has run.

General /FI arguments are still missing from /showIncludes output, this still
needs to be fixed.

llvm-svn: 263352

8 years agoELF: Include the build ID section in the first page.
Rui Ueyama [Sun, 13 Mar 2016 01:54:48 +0000 (01:54 +0000)]
ELF: Include the build ID section in the first page.

At least Linux has the kernel configuration to include the first page
of the executable into core files. We want build ID section to be
included in core files to identify them.

Here is the link to the description about the kernel configuration.

https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/fs/Kconfig.binfmt#L46

llvm-svn: 263351

8 years agoAdd echo test for constant data arrays in the LLVM C API
Amaury Sechet [Sun, 13 Mar 2016 00:58:25 +0000 (00:58 +0000)]
Add echo test for constant data arrays in the LLVM C API

llvm-svn: 263350

8 years agoUse templated version of unwrap instead of cats in the Core.cpp. NFC
Amaury Sechet [Sun, 13 Mar 2016 00:54:40 +0000 (00:54 +0000)]
Use templated version of unwrap instead of cats in the Core.cpp. NFC

llvm-svn: 263349

8 years agoMove LLVMConstStructInContext so that declarationa nd definition order match. NFC
Amaury Sechet [Sun, 13 Mar 2016 00:40:12 +0000 (00:40 +0000)]
Move LLVMConstStructInContext so that declarationa nd definition order match. NFC

llvm-svn: 263348