platform/upstream/llvm.git
8 years agoRemove redundant test
David Blaikie [Mon, 22 Aug 2016 17:49:50 +0000 (17:49 +0000)]
Remove redundant test

test/CodeGenCXX/debug-info-zero-length-arrays.cpp tests this
functionality more comprehensively

llvm-svn: 279444

8 years ago[SimplifyCFG] Rewrite SinkThenElseCodeToEnd
James Molloy [Mon, 22 Aug 2016 17:40:23 +0000 (17:40 +0000)]
[SimplifyCFG] Rewrite SinkThenElseCodeToEnd

The new version has several advantages:
  1) IMSHO it's more readable and neater
  2) It handles loads and stores properly
  3) It can handle any number of incoming blocks rather than just two. I'll be taking advantage of this in a followup patch.

With this change we can now finally sink load-modify-store idioms such as:

    if (a)
      return *b += 3;
    else
      return *b += 4;

    =>

    %z = load i32, i32* %y
    %.sink = select i1 %a, i32 5, i32 7
    %b = add i32 %z, %.sink
    store i32 %b, i32* %y
    ret i32 %b

When this works for switches it'll be even more powerful.

Round 4. This time we should handle all instructions correctly, and not replace any operands that need to be constant with variables.

This was really hard to determine safely, so the helper function should be put into the Instruction API. I'll do that as a followup.

llvm-svn: 279443

8 years ago[clang-tidy docs] Further cleanup of options
Alexander Kornienko [Mon, 22 Aug 2016 17:19:23 +0000 (17:19 +0000)]
[clang-tidy docs] Further cleanup of options

llvm-svn: 279442

8 years ago[X86][AVX] Don't use SubVectorBroadcast if there are additional users of the chain...
Simon Pilgrim [Mon, 22 Aug 2016 16:47:55 +0000 (16:47 +0000)]
[X86][AVX] Don't use SubVectorBroadcast if there are additional users of the chain (PR29088)

We could improve on this by making X86SubVBroadcast a full memory intrinsic similar to X86vzload

llvm-svn: 279441

8 years agoFix Gold Plugin after API change in the LTO API (constify callback type)
Mehdi Amini [Mon, 22 Aug 2016 16:41:58 +0000 (16:41 +0000)]
Fix Gold Plugin after API change in the LTO API (constify callback type)

llvm-svn: 279440

8 years ago[mips][ias] Support .dtprel[d]word and .tprel[d]word directives
Simon Atanasyan [Mon, 22 Aug 2016 16:18:42 +0000 (16:18 +0000)]
[mips][ias] Support .dtprel[d]word and .tprel[d]word directives

Assembler directives .dtprelword, .dtpreldword, .tprelword, and
.tpreldword generates relocations R_MIPS_TLS_DTPREL32, R_MIPS_TLS_DTPREL64,
R_MIPS_TLS_TPREL32, and R_MIPS_TLS_TPREL64 respectively.

The main motivation for this patch is to be able to write test cases
for checking correctness of the LLD linker's behaviour.

Differential Revision: https://reviews.llvm.org/D23669

llvm-svn: 279439

8 years ago[LTO] Constify the Module Hook function (NFC)
Mehdi Amini [Mon, 22 Aug 2016 16:17:40 +0000 (16:17 +0000)]
[LTO] Constify the Module Hook function (NFC)

It use to be non-const for the sole purpose of custom handling of
commons symbol. This is moved now in the regular LTO handling now
and such we can constify the callback.

llvm-svn: 279438

8 years agoReset isUndef when removing subreg from a def operand
Krzysztof Parzyszek [Mon, 22 Aug 2016 14:50:12 +0000 (14:50 +0000)]
Reset isUndef when removing subreg from a def operand

llvm-svn: 279437

8 years agoclang-format: [JS] supports casts to types starting with punctuation ("{[(").
Martin Probst [Mon, 22 Aug 2016 14:23:30 +0000 (14:23 +0000)]
clang-format: [JS] supports casts to types starting with punctuation ("{[(").

Before:

    x as{x: number}

After:

    x as {x: number}

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D23761

llvm-svn: 279436

8 years ago[X86] Only accept SM_SentinelUndef (-1) as an undefined shuffle mask in range
Simon Pilgrim [Mon, 22 Aug 2016 13:18:56 +0000 (13:18 +0000)]
[X86] Only accept SM_SentinelUndef (-1) as an undefined shuffle mask in range

As discussed on D23027 we should be trying to be more strict on what is an undefined mask value.

llvm-svn: 279435

8 years agoRemove missing file from r279433 reversal
Artur Pilipenko [Mon, 22 Aug 2016 13:18:19 +0000 (13:18 +0000)]
Remove missing file from r279433 reversal

llvm-svn: 279434

8 years agoRevert -r278267 [ValueTracking] An improvement to IR ValueTracking on Non-negative...
Artur Pilipenko [Mon, 22 Aug 2016 13:14:07 +0000 (13:14 +0000)]
Revert -r278267 [ValueTracking] An improvement to IR ValueTracking on Non-negative Integers

This change cause performance regression on MultiSource/Benchmarks/TSVC/Symbolics-flt/Symbolics-flt from LNT and some other bechmarks.

See https://reviews.llvm.org/D18777 for details.

llvm-svn: 279433

8 years agoRevert -r278269 [IndVarSimplify] Eliminate zext of a signed IV when the IV is known...
Artur Pilipenko [Mon, 22 Aug 2016 13:12:07 +0000 (13:12 +0000)]
Revert -r278269 [IndVarSimplify] Eliminate zext of a signed IV when the IV is known to be non-negative

This change needs to be reverted in order to revert -r278267 which cause performance regression on MultiSource/Benchmarks/TSVC/Symbolics-flt/Symbolics-flt from LNT and some other bechmarks.

See comments on https://reviews.llvm.org/D18777 for details.

llvm-svn: 279432

8 years ago[PM] Port LoopDataPrefetch AArch64 tests to new pass manager
Balaram Makam [Mon, 22 Aug 2016 12:59:58 +0000 (12:59 +0000)]
[PM] Port LoopDataPrefetch AArch64 tests to new pass manager

Reviewers: mcrosier, tejohnson

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D23724

llvm-svn: 279431

8 years ago[X86][SSE] Avoid specifying unused arguments in SHUFPD lowering
Simon Pilgrim [Mon, 22 Aug 2016 12:56:54 +0000 (12:56 +0000)]
[X86][SSE] Avoid specifying unused arguments in SHUFPD lowering

As discussed on PR26491, we are missing the opportunity to make use of the smaller MOVHLPS instruction because we set both arguments of a SHUFPD when using it to lower a single input shuffle.

This patch sets the lowered argument to UNDEF if that shuffle element is undefined. This in turn makes it easier for target shuffle combining to decode UNDEF shuffle elements, allowing combines to MOVHLPS to occur.

A fix to match against MOVHPD stores was necessary as well.

This builds on the improved MOVLHPS/MOVHLPS lowering and memory folding support added in D16956

Adding similar support for SHUFPS will have to wait until have better support for target combining of binary shuffles.

Differential Revision: https://reviews.llvm.org/D23027

llvm-svn: 279430

8 years ago[mips][microMIPS] Implement BLTZC, BLEZC, BGEZC and BGTZC instructions, fix disassemb...
Hrvoje Varga [Mon, 22 Aug 2016 12:17:59 +0000 (12:17 +0000)]
[mips][microMIPS] Implement BLTZC, BLEZC, BGEZC and BGTZC instructions, fix disassembly and add operand checking to existing B<cond>C implementations
Differential Revision: https://reviews.llvm.org/D22667

llvm-svn: 279429

8 years ago[MC] Remove guard(s). NFCI.
Davide Italiano [Mon, 22 Aug 2016 11:55:22 +0000 (11:55 +0000)]
[MC] Remove guard(s). NFCI.

All the methods are already marked with
LLVM_DUMP_METHOD.

llvm-svn: 279428

8 years agoReapply "[analyzer] Added valist related checkers."
Gabor Horvath [Mon, 22 Aug 2016 11:21:30 +0000 (11:21 +0000)]
Reapply "[analyzer] Added valist related checkers."

Differential Revision: https://reviews.llvm.org/D15227

llvm-svn: 279427

8 years ago[ThinLTO][X86] Fix windows build
Simon Pilgrim [Mon, 22 Aug 2016 10:49:37 +0000 (10:49 +0000)]
[ThinLTO][X86] Fix windows build

Windows 'rm' complains about non-existent files if a wildcard is used. Be more explicit about the files deleted to avoid this.

llvm-svn: 279426

8 years ago[analyzer] Correctly add assumptions based on array bounds.
Gabor Horvath [Mon, 22 Aug 2016 10:07:32 +0000 (10:07 +0000)]
[analyzer] Correctly add assumptions based on array bounds.

Also simplify the constraints generated by the checker.

Differential Revision: https://reviews.llvm.org/D23112

llvm-svn: 279425

8 years ago[X86] Create a new instruction format to handle 4VOp3 encoding. This saves one bit...
Craig Topper [Mon, 22 Aug 2016 07:38:50 +0000 (07:38 +0000)]
[X86] Create a new instruction format to handle 4VOp3 encoding. This saves one bit in TSFlags and simplifies MRMSrcMem/MRMSrcReg format handling.

llvm-svn: 279424

8 years ago[X86] Create a new instruction format to handle MemOp4 encoding. This saves one bit...
Craig Topper [Mon, 22 Aug 2016 07:38:45 +0000 (07:38 +0000)]
[X86] Create a new instruction format to handle MemOp4 encoding. This saves one bit in TSFlags and simplifies MRMSrcMem/MRMSrcReg format handling.

llvm-svn: 279423

8 years ago[X86] Space out the encodings of X86 instruction formats. I plan to add some new...
Craig Topper [Mon, 22 Aug 2016 07:38:41 +0000 (07:38 +0000)]
[X86] Space out the encodings of X86 instruction formats. I plan to add some new encodings in future commits and this will reduce the size of those commits. NFC

This tries to keep all the ModRM memory and register forms in their own regions of the encodings. Hoping to make it simple on some of the switch statements that operate on these encodings.

llvm-svn: 279422

8 years ago[X86] Merge small helper function into the switch that calls it since they both opera...
Craig Topper [Mon, 22 Aug 2016 07:38:36 +0000 (07:38 +0000)]
[X86] Merge small helper function into the switch that calls it since they both operate on the same variable. NFC

llvm-svn: 279421

8 years ago[X86] Explicitly list all X86 instruction forms in switch statement so its easier...
Craig Topper [Mon, 22 Aug 2016 07:38:30 +0000 (07:38 +0000)]
[X86] Explicitly list all X86 instruction forms in switch statement so its easier to detect when one is missing. NFC

llvm-svn: 279420

8 years agoTest commit (Removing trailing whitespace).
Elad Cohen [Mon, 22 Aug 2016 07:34:21 +0000 (07:34 +0000)]
Test commit (Removing trailing whitespace).

llvm-svn: 279419

8 years agoAdd REQUIRES:X86 to test/tools/llvm-lto2/common.ll
Mehdi Amini [Mon, 22 Aug 2016 06:37:41 +0000 (06:37 +0000)]
Add REQUIRES:X86 to test/tools/llvm-lto2/common.ll

llvm-svn: 279418

8 years ago[LTO] Handles commons in monolithic LTO
Mehdi Amini [Mon, 22 Aug 2016 06:25:46 +0000 (06:25 +0000)]
[LTO] Handles commons in monolithic LTO

The gold-plugin was doing this internally, now the API is handling
commons correctly based on the given resolution.

Differential Revision: https://reviews.llvm.org/D23739

llvm-svn: 279417

8 years ago[LTO] Add a "CodeGenOnly" option. Allows the client to skip the optimizer.
Mehdi Amini [Mon, 22 Aug 2016 06:25:41 +0000 (06:25 +0000)]
[LTO] Add a "CodeGenOnly" option. Allows the client to skip the optimizer.

Summary: Slowly getting on par with libLTO

Reviewers: tejohnson

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D23615

llvm-svn: 279416

8 years agoFormat.
Rui Ueyama [Mon, 22 Aug 2016 04:55:41 +0000 (04:55 +0000)]
Format.

llvm-svn: 279415

8 years agoDo not add .interp, .dynamic nor .eh_frame_hdr to segments just by type.
Rui Ueyama [Mon, 22 Aug 2016 04:55:20 +0000 (04:55 +0000)]
Do not add .interp, .dynamic nor .eh_frame_hdr to segments just by type.

Summary:
We previously added these output sections to segments just by type.
Therefore, if there's a PHDRS command like this

  PHDRS {
    headers PT_PHDR PHDRS;
    interp PT_INTERP;
  }

  SECTIONS {
    . = SIZEOF_HEADERS;
    .interp : { *(.interp) } :text
  }

then .interp was added to "interp" segment even though the linker
is not instructed to do so by SECTIONS command. This patch removes
the default behavior to simplify.

Differential Revision: https://reviews.llvm.org/D23702

llvm-svn: 279414

8 years ago[asan] Use 1 byte aligned stores to poison shadow memory
Vitaly Buka [Mon, 22 Aug 2016 04:16:14 +0000 (04:16 +0000)]
[asan] Use 1 byte aligned stores to poison shadow memory

Summary: r279379 introduced crash on arm 32bit bot. I suspect this is alignment issue.

Reviewers: eugenis

Subscribers: llvm-commits, aemerson

Differential Revision: https://reviews.llvm.org/D23762

llvm-svn: 279413

8 years ago[X86] Merge hasVEX_i8ImmReg into the ImmFormat type which had extra unused encodings...
Craig Topper [Mon, 22 Aug 2016 01:37:19 +0000 (01:37 +0000)]
[X86] Merge hasVEX_i8ImmReg into the ImmFormat type which had extra unused encodings. This saves one bit in TSFlags. NFC

llvm-svn: 279412

8 years ago[X86] Remove ignoreVEX_L from TSFlags. Only the disassembler needs it and the disasse...
Craig Topper [Mon, 22 Aug 2016 01:37:16 +0000 (01:37 +0000)]
[X86] Remove ignoreVEX_L from TSFlags. Only the disassembler needs it and the disassembler doesn't use TSFlags. NFC

llvm-svn: 279411

8 years agoReformat.
NAKAMURA Takumi [Mon, 22 Aug 2016 00:58:47 +0000 (00:58 +0000)]
Reformat.

llvm-svn: 279409

8 years agoUntabify.
NAKAMURA Takumi [Mon, 22 Aug 2016 00:58:04 +0000 (00:58 +0000)]
Untabify.

llvm-svn: 279408

8 years agoCOFF: hoist a local variable
Saleem Abdulrasool [Sun, 21 Aug 2016 23:05:43 +0000 (23:05 +0000)]
COFF: hoist a local variable

Create a local variable for the rdata section.  NFC.

llvm-svn: 279407

8 years ago[CostModel][X86] Removed shift tests
Simon Pilgrim [Sun, 21 Aug 2016 19:56:02 +0000 (19:56 +0000)]
[CostModel][X86] Removed shift tests

There are more thorough tests found in vshift-*-cost.ll

llvm-svn: 279406

8 years ago[CostModel][X86] Added costs for vXi16 and vXi8 vectors for add/sub/mul/and/or/xor...
Simon Pilgrim [Sun, 21 Aug 2016 19:44:44 +0000 (19:44 +0000)]
[CostModel][X86] Added costs for vXi16 and vXi8 vectors for add/sub/mul/and/or/xor tests

llvm-svn: 279405

8 years ago[CostModel][X86] Replaced SSSE3 with SSE2 costs to create a better baseline
Simon Pilgrim [Sun, 21 Aug 2016 19:14:48 +0000 (19:14 +0000)]
[CostModel][X86] Replaced SSSE3 with SSE2 costs to create a better baseline

llvm-svn: 279404

8 years ago[CostModel][X86] Added fsqrt and fma costs
Simon Pilgrim [Sun, 21 Aug 2016 19:06:25 +0000 (19:06 +0000)]
[CostModel][X86] Added fsqrt and fma costs

llvm-svn: 279403

8 years ago[CostModel][X86] Split off float arithmetic cost tests
Simon Pilgrim [Sun, 21 Aug 2016 18:34:47 +0000 (18:34 +0000)]
[CostModel][X86] Split off float arithmetic cost tests

llvm-svn: 279402

8 years ago[InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vector...
Sanjay Patel [Sun, 21 Aug 2016 17:10:07 +0000 (17:10 +0000)]
[InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vectors, part 4

This concludes the fixes for icmp+shl in this series:
https://reviews.llvm.org/rL279339
https://reviews.llvm.org/rL279398
https://reviews.llvm.org/rL279399

llvm-svn: 279401

8 years agoremove FIXME comment; fixed by previous commit
Sanjay Patel [Sun, 21 Aug 2016 16:40:42 +0000 (16:40 +0000)]
remove FIXME comment; fixed by previous commit

llvm-svn: 279400

8 years ago[InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vector...
Sanjay Patel [Sun, 21 Aug 2016 16:35:34 +0000 (16:35 +0000)]
[InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vectors, part 3

This is a partial enablement (move the ConstantInt guard down).

llvm-svn: 279399

8 years ago[InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vector...
Sanjay Patel [Sun, 21 Aug 2016 16:28:22 +0000 (16:28 +0000)]
[InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vectors, part 2

This is a partial enablement (move the ConstantInt guard down).

llvm-svn: 279398

8 years ago[X86][AVX] Dropped combineShuffle256 - this can now be performed by EltsFromConsecuti...
Simon Pilgrim [Sun, 21 Aug 2016 15:39:45 +0000 (15:39 +0000)]
[X86][AVX] Dropped combineShuffle256 - this can now be performed by EltsFromConsecutiveLoads

llvm-svn: 279397

8 years ago[InstCombine] use APInt instead of ConstantInt in isSignBitCheck(); NFCI
Sanjay Patel [Sun, 21 Aug 2016 15:07:45 +0000 (15:07 +0000)]
[InstCombine] use APInt instead of ConstantInt in isSignBitCheck(); NFCI

The callers still have ConstantInt guards, so there is no functional change
intended from this change. But relaxing the callers will allow more folds
for vector types.

llvm-svn: 279396

8 years agoAdd a flag to dump SCoP optimized with the IslScheduleOptimizer pass
Roman Gareev [Sun, 21 Aug 2016 11:20:39 +0000 (11:20 +0000)]
Add a flag to dump SCoP optimized with the IslScheduleOptimizer pass

Dump polyhedral descriptions of Scops optimized with the isl scheduling
optimizer and the set of post-scheduling transformations applied
on the schedule tree to be able to check the work of the IslScheduleOptimizer
pass at the polyhedral level.

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: https://reviews.llvm.org/D23740

llvm-svn: 279395

8 years agoSimplify AccFuncMap to vector<> AccessFunctions
Roman Gareev [Sun, 21 Aug 2016 11:09:19 +0000 (11:09 +0000)]
Simplify AccFuncMap to vector<> AccessFunctions

getAccessFunctions() is dead code and the 'BB' argument
of getOrCreateAccessFunctions() is not used. This patch deletes
getAccessFunctions and transforms AccFuncMap into
a std::vector<std::unique_ptr<MemoryAccess>> AccessFunctions.

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: https://reviews.llvm.org/D23759

llvm-svn: 279394

8 years ago[AVX512][FastISel] Do not use K registers in TEST instructions
Guy Blank [Sun, 21 Aug 2016 08:02:27 +0000 (08:02 +0000)]
[AVX512][FastISel] Do not use K registers in TEST instructions

In some cases, FastIsel was emitting TEST instruction with K reg input, which is illegal.
Changed to using KORTEST when dealing with K regs.

Differential Revision: https://reviews.llvm.org/D23163

llvm-svn: 279393

8 years ago[X86][AVX512F] minor fix of the parameter names
Asaf Badouh [Sun, 21 Aug 2016 07:56:47 +0000 (07:56 +0000)]
[X86][AVX512F] minor fix of the parameter names
add "__" prefix

Bug 28842 https://llvm.org/bugs/show_bug.cgi?id=29040

Differential Revision: https://reviews.llvm.org/D23753

llvm-svn: 279392

8 years agoARM: Avoid dereferencing end() in ARMFrameLowering::emitEpilogue
Duncan P. N. Exon Smith [Sun, 21 Aug 2016 00:08:10 +0000 (00:08 +0000)]
ARM: Avoid dereferencing end() in ARMFrameLowering::emitEpilogue

This fixes the crash from PR29072, where the MachineBasicBlock::iterator
wasn't being properly checked against MachineBasicBlock::end() before
iterating.  This was another bug exposed by the new
ilist::iterator::operator*() assertion from r279314.

This testcase is poor quality.  bugpoint couldn't reduce any further,
and I haven't had time to dig into what's going on so I can't invent a
better one.  I didn't even get good CHECK lines in: this is just a
crasher.

I'm committing anyway since this is a real crash with an obvious fix,
but I'll leave PR29072 open and ask an ARM maintainer to help improve
the testcase.

llvm-svn: 279391

8 years agoFix broken macOS LLDB Xcode build from r279314
Todd Fiala [Sat, 20 Aug 2016 23:24:02 +0000 (23:24 +0000)]
Fix broken macOS LLDB Xcode build from r279314

llvm-svn: 279390

8 years ago[X86][SSE] Regenerate 32-bit buildvector test
Simon Pilgrim [Sat, 20 Aug 2016 23:09:57 +0000 (23:09 +0000)]
[X86][SSE] Regenerate 32-bit buildvector test

llvm-svn: 279389

8 years ago[X86][SSE] Regenerate subvector extraction widening test
Simon Pilgrim [Sat, 20 Aug 2016 22:00:53 +0000 (22:00 +0000)]
[X86][SSE] Regenerate subvector extraction widening test

llvm-svn: 279388

8 years ago[X86] Regenerate fp truncate tests
Simon Pilgrim [Sat, 20 Aug 2016 21:56:33 +0000 (21:56 +0000)]
[X86] Regenerate fp truncate tests

llvm-svn: 279387

8 years agoRegenerate test
Simon Pilgrim [Sat, 20 Aug 2016 21:37:30 +0000 (21:37 +0000)]
Regenerate test

llvm-svn: 279386

8 years agoRegenerate test
Simon Pilgrim [Sat, 20 Aug 2016 21:35:45 +0000 (21:35 +0000)]
Regenerate test

llvm-svn: 279385

8 years ago[X86][XOP] Tweak vpermil2pd test to stop it being combined away
Simon Pilgrim [Sat, 20 Aug 2016 21:07:41 +0000 (21:07 +0000)]
[X86][XOP] Tweak vpermil2pd test to stop it being combined away

llvm-svn: 279384

8 years ago[asan] Minimize code size by using __asan_set_shadow_* for large blocks
Vitaly Buka [Sat, 20 Aug 2016 20:23:50 +0000 (20:23 +0000)]
[asan] Minimize code size by using __asan_set_shadow_* for large blocks

Summary:
We can insert function call instead of multiple store operation.
Current default is blocks larger than 64 bytes.
Changes are hidden behind -asan-experimental-poisoning flag.

PR27453

Differential Revision: https://reviews.llvm.org/D23711

llvm-svn: 279383

8 years agoWdocumentation fix
Simon Pilgrim [Sat, 20 Aug 2016 20:21:27 +0000 (20:21 +0000)]
Wdocumentation fix

llvm-svn: 279382

8 years agoUse SDValue::getOpcode() helper instead of via SDValue::getNode()
Simon Pilgrim [Sat, 20 Aug 2016 20:04:18 +0000 (20:04 +0000)]
Use SDValue::getOpcode() helper instead of via SDValue::getNode()

llvm-svn: 279381

8 years ago[asan] Initialize __asan_set_shadow_* callbacks
Vitaly Buka [Sat, 20 Aug 2016 18:34:39 +0000 (18:34 +0000)]
[asan] Initialize __asan_set_shadow_* callbacks

Summary:
Callbacks are not being used yet.

PR27453

Reviewers: kcc, eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23634

llvm-svn: 279380

8 years ago[asan] Optimize store size in FunctionStackPoisoner::poisonRedZones
Vitaly Buka [Sat, 20 Aug 2016 18:34:36 +0000 (18:34 +0000)]
[asan] Optimize store size in FunctionStackPoisoner::poisonRedZones

Summary: Reduce store size to avoid leading and trailing zeros.

Reviewers: kcc, eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23648

llvm-svn: 279379

8 years ago[analyzer] Use faster hashing (MD5) in CloneDetector.
Artem Dergachev [Sat, 20 Aug 2016 17:35:53 +0000 (17:35 +0000)]
[analyzer] Use faster hashing (MD5) in CloneDetector.

This replaces the old approach of fingerprinting every AST node into a string,
which avoided collisions and was simple to implement, but turned out to be
extremely ineffective with respect to both performance and memory.

The collisions are now dealt with in a separate pass, which no longer causes
performance problems because collisions are rare.

Patch by Raphael Isemann!

Differential Revision: https://reviews.llvm.org/D22515

llvm-svn: 279378

8 years ago[asan] Rename asan-instrument-allocas -> asan-instrument-dynamic-allocas
Vitaly Buka [Sat, 20 Aug 2016 17:22:36 +0000 (17:22 +0000)]
[asan] Rename asan-instrument-allocas -> asan-instrument-dynamic-allocas

Summary: Depends on D23707.

Subscribers: kubabrecka

Differential Revision: https://reviews.llvm.org/D23709

llvm-svn: 279377

8 years ago[asan] Cleanup instrumentation of dynamic allocas
Vitaly Buka [Sat, 20 Aug 2016 17:22:27 +0000 (17:22 +0000)]
[asan] Cleanup instrumentation of dynamic allocas

Summary:
Extract instrumenting dynamic allocas into separate method.
Rename asan-instrument-allocas -> asan-instrument-dynamic-allocas

Differential Revision: https://reviews.llvm.org/D23707

llvm-svn: 279376

8 years ago[X86][SSE] Added vector interleave test (PR21281)
Simon Pilgrim [Sat, 20 Aug 2016 17:07:38 +0000 (17:07 +0000)]
[X86][SSE] Added vector interleave test (PR21281)

llvm-svn: 279375

8 years ago[Sema] Don't crash on scanf on forward-declared enums.
Benjamin Kramer [Sat, 20 Aug 2016 16:51:33 +0000 (16:51 +0000)]
[Sema] Don't crash on scanf on forward-declared enums.

This is valid in GNU C, which allows pointers to incomplete enums. GCC
just pretends that the underlying type is 'int' in those cases, follow
that behavior.

llvm-svn: 279374

8 years ago[asan] Add support of lifetime poisoning into ComputeASanStackFrameLayout
Vitaly Buka [Sat, 20 Aug 2016 16:48:24 +0000 (16:48 +0000)]
[asan] Add support of lifetime poisoning into ComputeASanStackFrameLayout

Summary:
We are going to combine poisoning of red zones and scope poisoning.

PR27453

Reviewers: kcc, eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23623

llvm-svn: 279373

8 years agoMove unittests/Support/IteratorTest.cpp to unittests/ADT/
Duncan P. N. Exon Smith [Sat, 20 Aug 2016 14:58:31 +0000 (14:58 +0000)]
Move unittests/Support/IteratorTest.cpp to unittests/ADT/

This testing stuff from ADT, not Support.  Fix the file location.

llvm-svn: 279372

8 years agoPR28423: Compare primary declaration contexts.
Vassil Vassilev [Sat, 20 Aug 2016 14:50:22 +0000 (14:50 +0000)]
PR28423: Compare primary declaration contexts.

In certain cases (mostly coming from modules), Sema's idea of the StdNamespace
does not point to the first declaration of namespace std.

Patch by Cristina Cristescu!

Reviewed by Richard Smith.

llvm-svn: 279371

8 years agoReapply "[SLP] Initialize VectorizedValue when gathering"
Matthew Simpson [Sat, 20 Aug 2016 14:49:02 +0000 (14:49 +0000)]
Reapply "[SLP] Initialize VectorizedValue when gathering"

The test case included in r279125 exposed existing undefined behavior in the
SLP vectorizer that it did not introduce. This patch reapplies the original
patch, but modifies the test case to avoid hitting the undefined behavior. This
allows us to close PR28330 while keeping the UBSan bot happy. The undefined
behavior the original test uncovered will be addressed in a follow-on patch.

Reference: https://llvm.org/bugs/show_bug.cgi?id=28330
llvm-svn: 279370

8 years ago[SLP] Add command line option for minimum tree size (NFC)
Matthew Simpson [Sat, 20 Aug 2016 14:10:06 +0000 (14:10 +0000)]
[SLP] Add command line option for minimum tree size (NFC)

llvm-svn: 279369

8 years agoAdd R_386_TLS_LE as a relocation having an implicit addend.
Ed Schouten [Sat, 20 Aug 2016 10:54:51 +0000 (10:54 +0000)]
Add R_386_TLS_LE as a relocation having an implicit addend.

TLS on i386 in non-PIE/PIC code seems broken right now, because we don't
properly add the addend encoded in the instruction to the resulting
offset when processing R_386_TLS_LE relocations.

Extend one of the existing tests for TLS on i686 to use an addend.

PR: https://llvm.org/bugs/show_bug.cgi?id=29068
Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D23741

llvm-svn: 279368

8 years ago[analyzer] Make CloneDetector consider macro expansions.
Artem Dergachev [Sat, 20 Aug 2016 10:06:59 +0000 (10:06 +0000)]
[analyzer] Make CloneDetector consider macro expansions.

So far macro-generated code was treated by the CloneDetector as normal code.
This caused that some macros where reported as false-positive clones because
large chunks of code coming from otherwise concise macro expansions were treated
as copy-pasted code.

This patch ensures that macros are treated in the same way as literals/function
calls. This prevents macros that expand into multiple statements
from being reported as clones.

Patch by Raphael Isemann!

Differential Revision: https://reviews.llvm.org/D23316

llvm-svn: 279367

8 years ago[analyzer] Make CloneDetector consider template arguments.
Artem Dergachev [Sat, 20 Aug 2016 09:57:21 +0000 (09:57 +0000)]
[analyzer] Make CloneDetector consider template arguments.

For example, code samples `isa<Stmt>(S)' and `isa<Expr>(S)'
are no longer considered to be clones.

Patch by Raphael Isemann!

Differential Revision: https://reviews.llvm.org/D23555

llvm-svn: 279366

8 years agoRevert "[SLP] Initialize VectorizedValue when gathering" to fix ubsan bot.
Vitaly Buka [Sat, 20 Aug 2016 07:09:39 +0000 (07:09 +0000)]
Revert "[SLP] Initialize VectorizedValue when gathering" to fix ubsan bot.

This reverts commit r279125.

https://reviews.llvm.org/D23410

llvm-svn: 279363

8 years ago[CMake/ASan] Skip using libedit if ASan is enabled -- it leaks memory.
Chandler Carruth [Sat, 20 Aug 2016 07:05:13 +0000 (07:05 +0000)]
[CMake/ASan] Skip using libedit if ASan is enabled -- it leaks memory.

Note that you'll have to clear this variable from your CMake cache for
it to take effect.

llvm-svn: 279362

8 years ago[Profile] add test with large counts
Xinliang David Li [Sat, 20 Aug 2016 05:28:42 +0000 (05:28 +0000)]
[Profile] add test with large counts

llvm-svn: 279361

8 years ago[PM] Introduce an abstraction for all the analyses over a particular IR
Chandler Carruth [Sat, 20 Aug 2016 04:57:28 +0000 (04:57 +0000)]
[PM] Introduce an abstraction for all the analyses over a particular IR
unit for use in the PreservedAnalyses set.

This doesn't have any important functional change yet but it cleans
things up and makes the analysis substantially more efficient by
avoiding querying through the type erasure for every analysis.

I also think it makes it much easier to reason about how analyses are
preserved when walking across pass managers and across IR unit
abstractions.

Thanks to Sean and Mehdi both for the comments and suggestions.

Differential Revision: https://reviews.llvm.org/D23691

llvm-svn: 279360

8 years agoamdgpu: Fix default case value for get_local_size
Matt Arsenault [Sat, 20 Aug 2016 04:17:17 +0000 (04:17 +0000)]
amdgpu: Fix default case value for get_local_size

llvm-svn: 279359

8 years agoRevert r279351 and r279357 due to bot failures
Manman Ren [Sat, 20 Aug 2016 03:00:54 +0000 (03:00 +0000)]
Revert r279351 and r279357 due to bot failures

llvm-svn: 279358

8 years agoFix windows bot
Manman Ren [Sat, 20 Aug 2016 02:28:15 +0000 (02:28 +0000)]
Fix windows bot

llvm-svn: 279357

8 years ago[gold/ThinLTO] Restore ThinLTO file management in gold plugin
Teresa Johnson [Sat, 20 Aug 2016 01:24:07 +0000 (01:24 +0000)]
[gold/ThinLTO] Restore ThinLTO file management in gold plugin

Summary:
The gold-plugin changes added along with the new LTO API in r278338 had
the effect of removing the management of the PluginInputFile that
ensured the files weren't released back to gold until the backend
threads were complete. Add back the old file handling.

Fixes PR29020.

Reviewers: mehdi_amini

Subscribers: mehdi_amini, llvm-commits, hjl.tools

Differential Revision: https://reviews.llvm.org/D23721

llvm-svn: 279356

8 years ago[gold] Fix new gold test to specify emulation mode
Teresa Johnson [Sat, 20 Aug 2016 01:22:10 +0000 (01:22 +0000)]
[gold] Fix new gold test to specify emulation mode

Add emulation mode option for new test added in r279023.

llvm-svn: 279355

8 years agoadded Xcode lldb-gtest-for-debugging target
Todd Fiala [Sat, 20 Aug 2016 00:54:03 +0000 (00:54 +0000)]
added Xcode lldb-gtest-for-debugging target

The lldb-gtest target is for CI and runs the tests as
part of the build phase.  It does not support debugging
the gtests from Xcode, though, due to the run happening
during the build phase.

This change adds a lldb-gtest-for-debugging target that
can be used to debug gtests.

llvm-svn: 279354

8 years agoAdd logic to the ObjC runtime in LLDB to extract the pointer values of the two single...
Enrico Granata [Sat, 20 Aug 2016 00:48:11 +0000 (00:48 +0000)]
Add logic to the ObjC runtime in LLDB to extract the pointer values of the two singleton (pairtons?) instances of __NSCFBoolean that represent true and false

This is useful because that knowledge will in turn allow no-code-running formatting of boolean NSNumbers; but that's a commit that will have to wait Monday..

llvm-svn: 279353

8 years ago[msan] Disable prlimit test on glibc < 2.13.
Evgeniy Stepanov [Sat, 20 Aug 2016 00:38:55 +0000 (00:38 +0000)]
[msan] Disable prlimit test on glibc < 2.13.

llvm-svn: 279352

8 years ago[NFC] Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.
Manman Ren [Sat, 20 Aug 2016 00:04:21 +0000 (00:04 +0000)]
[NFC] Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.

This is in preparation of adding a new type class ObjCTypeParamType that
can take protocol qualifiers. ObjCProtocolQualifiers will be shared between
ObjCObjectType and ObjCTypeParamType.

rdar://24619481
rdar://25060179

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

llvm-svn: 279351

8 years agoamdgcn: Fix get_local_size IR return type
Matt Arsenault [Sat, 20 Aug 2016 00:01:21 +0000 (00:01 +0000)]
amdgcn: Fix get_local_size IR return type

llvm-svn: 279350

8 years ago[LTO] Add the ability to test -thinlto-emit-imports-files through llvm-lto2
Mehdi Amini [Fri, 19 Aug 2016 23:54:40 +0000 (23:54 +0000)]
[LTO] Add the ability to test -thinlto-emit-imports-files through llvm-lto2

Summary:
Start bringing llvm-lto2 to a level where we can test the LTO API
a bit deeper.

Reviewers: tejohnson

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D23681

llvm-svn: 279349

8 years ago[Driver] Remove unused #include of llvm/Support/config.h
Vedant Kumar [Fri, 19 Aug 2016 23:15:35 +0000 (23:15 +0000)]
[Driver] Remove unused #include of llvm/Support/config.h

This is a follow-up to r279112 (which removed the need for the header)
and in the same spirit as r279035 (which attempted to un-break
out-of-tree builds).

llvm-svn: 279348

8 years agoMachineFunction: Add llvm_unreachable for missing properties
Matthias Braun [Fri, 19 Aug 2016 23:03:28 +0000 (23:03 +0000)]
MachineFunction: Add llvm_unreachable for missing properties

Most compilers should give you a warning anyway though.

llvm-svn: 279346

8 years agoRemove a test that depends on knowing all compiler's register allocation schemes.
Jim Ingham [Fri, 19 Aug 2016 22:58:26 +0000 (22:58 +0000)]
Remove a test that depends on knowing all compiler's register allocation schemes.

This test was using a condition that would compare a variable against the register that would hold
it.  It was failing with clang on arm64 because clang put the variable on the stack.

This is not a supportable way to write tests.

llvm-svn: 279345

8 years agoReset "undef" flag when coalescing subregister into whole register
Krzysztof Parzyszek [Fri, 19 Aug 2016 22:57:23 +0000 (22:57 +0000)]
Reset "undef" flag when coalescing subregister into whole register

llvm-svn: 279344

8 years agoamdgcn: Correct return types to be size_t
Matt Arsenault [Fri, 19 Aug 2016 22:49:39 +0000 (22:49 +0000)]
amdgcn: Correct return types to be size_t

llvm-svn: 279343

8 years agoGlobalISel: support legalization of G_FCONSTANTs
Tim Northover [Fri, 19 Aug 2016 22:40:08 +0000 (22:40 +0000)]
GlobalISel: support legalization of G_FCONSTANTs

llvm-svn: 279341

8 years agoGlobalISel: teach legalizer how to handle integer constants.
Tim Northover [Fri, 19 Aug 2016 22:40:00 +0000 (22:40 +0000)]
GlobalISel: teach legalizer how to handle integer constants.

llvm-svn: 279340