oota-llvm.git
9 years agoEliminate O(n^2) worst-case behavior in SSA construction
Cameron Zwarich [Wed, 8 Apr 2015 18:26:20 +0000 (18:26 +0000)]
Eliminate O(n^2) worst-case behavior in SSA construction

The code uses a priority queue and a worklist, which share the same
visited set, but the visited set is only updated when inserting into
the priority queue. Instead, switch to using separate visited sets
for the priority queue and worklist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234425 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Allow analysis to complete in the presence of uniform stores
Adam Nemet [Wed, 8 Apr 2015 17:48:40 +0000 (17:48 +0000)]
[LoopAccesses] Allow analysis to complete in the presence of uniform stores

(Re-apply r234361 with a fix and a testcase for PR23157)

Both run-time pointer checking and the dependence analysis are capable
of dealing with uniform addresses. I.e. it's really just an orthogonal
property of the loop that the analysis computes.

Run-time pointer checking will only try to reason about SCEVAddRec
pointers or else gives up. If the uniform pointer turns out the be a
SCEVAddRec in an outer loop, the run-time checks generated will be
correct (start and end bounds would be equal).

In case of the dependence analysis, we work again with SCEVs. When
compared against a loop-dependent address of the same underlying object,
the difference of the two SCEVs won't be constant. This will result in
returning an Unknown dependence for the pair.

When compared against another uniform access, the difference would be
constant and we should return the right type of dependence
(forward/backward/etc).

The changes also adds support to query this property of the loop and
modify the vectorizer to use this.

Patch by Ashutosh Nema!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234424 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] make vminnm/vmaxnm work with ?le, ?ge and no-nans-fp-math
Scott Douglass [Wed, 8 Apr 2015 17:18:28 +0000 (17:18 +0000)]
[ARM] make vminnm/vmaxnm work with ?le, ?ge and no-nans-fp-math

Because -menable-no-nans causes fcmp conditions to be rewritten
without 'o' or 'u' the recognition code in needs to cope. Also
extended it to handle 'le' and 'ge.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234421 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agofixed to test features, not CPU models
Sanjay Patel [Wed, 8 Apr 2015 16:51:42 +0000 (16:51 +0000)]
fixed to test features, not CPU models

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234413 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't repeat names in comments.
Rafael Espindola [Wed, 8 Apr 2015 16:33:46 +0000 (16:33 +0000)]
Don't repeat names in comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234412 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Update MIPS relocations list
Simon Atanasyan [Wed, 8 Apr 2015 14:55:31 +0000 (14:55 +0000)]
[mips] Update MIPS relocations list

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234408 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] [IAS] Do not generate redundant move when expanding lw/sw with symbol.
Toma Tabacu [Wed, 8 Apr 2015 13:52:41 +0000 (13:52 +0000)]
[mips] [IAS] Do not generate redundant move when expanding lw/sw with symbol.

Summary:
Even though there is no 2nd register operand in the "lw/sw $8, symbol" case, we still try to find one,
and we end up with $0, which makes us generate an unnecessary "addu $8, $8, $0" (a.k.a. "move $8, $8").

We can avoid this by checking if the 2nd register operand is different from $0, before generating the addu.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234406 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't repeat names in comments. NFC.
Rafael Espindola [Wed, 8 Apr 2015 13:52:09 +0000 (13:52 +0000)]
Don't repeat names in comments. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234405 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[jitlistener] Remove unused code
Benjamin Kramer [Wed, 8 Apr 2015 13:17:48 +0000 (13:17 +0000)]
[jitlistener] Remove unused code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234404 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] [IAS] Add support for the BNEZL and BEQZL pseudo-instructions.
Toma Tabacu [Wed, 8 Apr 2015 12:15:05 +0000 (12:15 +0000)]
[mips] [IAS] Add support for the BNEZL and BEQZL pseudo-instructions.

Summary:
They are of the form "bnezl/beqzl $rs, offset" and expand to "bnel/beql $rs, $zero, offset".

These instructions are used in Linux inline assembly.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234401 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrite the section header in the end.
Rafael Espindola [Wed, 8 Apr 2015 11:41:24 +0000 (11:41 +0000)]
Write the section header in the end.

One could make the argument for writing it immediately after the ELF header,
but writing it in the middle of the sections like we were doing just makes
it harder for no reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234400 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM][Debug Info] Restore emitting of .cfi_def_cfa_offset for functions without stack...
Sergey Dmitrouk [Wed, 8 Apr 2015 10:10:12 +0000 (10:10 +0000)]
[ARM][Debug Info] Restore emitting of .cfi_def_cfa_offset for functions without stack frame

Summary: Looks like new code from [[ http://reviews.llvm.org/rL222057 | rL222057 ]] doesn't account for early `return` in `ARMFrameLowering::emitPrologue`, which leads to loosing `.cfi_def_cfa_offset` directive for functions without stack frame.

Reviewers: echristo, rengolin, asl, t.p.northover

Reviewed By: t.p.northover

Subscribers: llvm-commits, rengolin, aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234399 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] [IAS] Remove AssemblerPredicate's from RelocPIC and RelocStatic.
Toma Tabacu [Wed, 8 Apr 2015 10:06:45 +0000 (10:06 +0000)]
[mips] [IAS] Remove AssemblerPredicate's from RelocPIC and RelocStatic.

Summary:
These AssemblerPredicate's are unnecessary and actually make some instructions unusable when assembling pre-MIPS32 ISAs.
For example, this was causing the IAS to reject the 'j' instruction for MIPS I-V.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234398 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MachineLICM] Cleanup, remove unused parameters. NFC.
Daniel Jasper [Wed, 8 Apr 2015 07:10:30 +0000 (07:10 +0000)]
[MachineLICM] Cleanup, remove unused parameters. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234392 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[lib/Fuzzer] show how to find Heartbleed with LibFuzzer
Kostya Serebryany [Wed, 8 Apr 2015 06:16:11 +0000 (06:16 +0000)]
[lib/Fuzzer] show how to find Heartbleed with LibFuzzer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234391 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r234389. It really was needed but really should have been cstring instead...
Craig Topper [Wed, 8 Apr 2015 06:03:17 +0000 (06:03 +0000)]
Revert r234389. It really was needed but really should have been cstring instead of string.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234390 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unnecessary include. NFC
Craig Topper [Wed, 8 Apr 2015 05:56:30 +0000 (05:56 +0000)]
Remove unnecessary include. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234389 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[InstCombine] Refactor out OptimizeOverflowCheck. NFCI.
Sanjoy Das [Wed, 8 Apr 2015 04:27:22 +0000 (04:27 +0000)]
[InstCombine] Refactor out OptimizeOverflowCheck.  NFCI.

Summary:
This patch adds an enum `OverflowCheckFlavor` and a function
`OptimizeOverflowCheck`.  This will allow InstCombine to optimize
overflow checks without directly introducing an intermediate call to the
`llvm.$op.with.overflow` instrinsics.

This specific change is a refactoring and does not intend to change
behavior.

Reviewers: majnemer, atrick

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234388 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "[LoopAccesses] Allow analysis to complete in the presence of uniform stores"
Adam Nemet [Wed, 8 Apr 2015 04:16:55 +0000 (04:16 +0000)]
Revert "[LoopAccesses] Allow analysis to complete in the presence of uniform stores"

This reverts commit r234361.

It caused PR23157.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234387 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[bpf] support BPF backend as shared library
Alexei Starovoitov [Wed, 8 Apr 2015 03:46:51 +0000 (03:46 +0000)]
[bpf] support BPF backend as shared library

dependencies were not set correctly for shared library build.
static was ok

Patch by Brenden Blanco.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234386 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoOops, didn't mean to commit my debug fprintfs
Matthias Braun [Wed, 8 Apr 2015 02:10:01 +0000 (02:10 +0000)]
Oops, didn't mean to commit my debug fprintfs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234385 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Add some missing overrides
Tom Stellard [Wed, 8 Apr 2015 02:07:05 +0000 (02:07 +0000)]
R600/SI: Add some missing overrides

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234384 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLiveInterval: Fix computeFromMainRange() producing adjacent segments with same valno
Matthias Braun [Wed, 8 Apr 2015 01:41:10 +0000 (01:41 +0000)]
LiveInterval: Fix computeFromMainRange() producing adjacent segments with same valno

If two livesegments from different subranges happened to have the same
definition they could possibly end up as two adjacent segments in the
main liverange with the same value number which is not allowed. Detect
such cases and fix them in the 2nd pass of computeFromMainRange() if
necessary.

No testcase as there is only an out-of-tree target where I can sensibly
come up with one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234382 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Initial support for assembler and inline assembly
Tom Stellard [Wed, 8 Apr 2015 01:09:26 +0000 (01:09 +0000)]
R600/SI: Initial support for assembler and inline assembly

This is currently considered experimental, but most of the more
commonly used instructions should work.

So far only SI has been extensively tested, CI and VI probably work too,
but may be buggy.  The current set of tests cases do not give complete
coverage, but I think it is sufficient for an experimental assembler.

See the documentation in R600Usage for more information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234381 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Add missing SOPK instructions
Tom Stellard [Wed, 8 Apr 2015 01:09:22 +0000 (01:09 +0000)]
R600/SI: Add missing SOPK instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234380 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Don't print offset0/offset1 DS operands when they are 0
Tom Stellard [Wed, 8 Apr 2015 01:09:19 +0000 (01:09 +0000)]
R600/SI: Don't print offset0/offset1 DS operands when they are 0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234379 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoELFObjectWriter.cpp: Prune obsolete \param since r234342. [-Wdocumentation]
NAKAMURA Takumi [Wed, 8 Apr 2015 00:38:50 +0000 (00:38 +0000)]
ELFObjectWriter.cpp: Prune obsolete \param since r234342. [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234377 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAArch64: disallow "fmov sD, #-0.0" during assembly.
Tim Northover [Tue, 7 Apr 2015 22:49:47 +0000 (22:49 +0000)]
AArch64: disallow "fmov sD, #-0.0" during assembly.

We weren't checking the sign of the floating point immediate before translating
it to "fmov sD, wzr". Similarly for D-regs.

Technically "movi vD.2s, #0x80, lsl #24" would work most of the time, but it's
not a blessed alias (and I don't think it should be since people expect writing
sD to zero out the high lanes, and there's no dD equivalent). So an error it is.

rdar://20455398

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234372 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDelete commented code. Don't repeat name in comment.
Rafael Espindola [Tue, 7 Apr 2015 22:35:40 +0000 (22:35 +0000)]
Delete commented code. Don't repeat name in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234370 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't subtract the header size just to add it back.
Rafael Espindola [Tue, 7 Apr 2015 21:51:41 +0000 (21:51 +0000)]
Don't subtract the header size just to add it back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234362 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Allow analysis to complete in the presence of uniform stores
Adam Nemet [Tue, 7 Apr 2015 21:46:16 +0000 (21:46 +0000)]
[LoopAccesses] Allow analysis to complete in the presence of uniform stores

Both run-time pointer checking and the dependence analysis are capable
of dealing with uniform addresses. I.e. it's really just an orthogonal
property of the loop that the analysis computes.

Run-time pointer checking will only try to reason about SCEVAddRec
pointers or else gives up. If the uniform pointer turns out the be a
SCEVAddRec in an outer loop, the run-time checks generated will be
correct (start and end bounds would be equal).

In case of the dependence analysis, we work again with SCEVs. When
compared against a loop-dependent address of the same underlying object,
the difference of the two SCEVs won't be constant. This will result in
returning an Unknown dependence for the pair.

When compared against another uniform access, the difference would be
constant and we should return the right type of dependence
(forward/backward/etc).

The changes also adds support to query this property of the loop and
modify the vectorizer to use this.

Patch by Ashutosh Nema!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234361 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WinEH] Add invoke of llvm.donothing to outlined catch and cleanup handlers to identi...
Andrew Kaylor [Tue, 7 Apr 2015 21:30:23 +0000 (21:30 +0000)]
[WinEH] Add invoke of llvm.donothing to outlined catch and cleanup handlers to identify their personality.

Differential Review: http://reviews.llvm.org/D8835

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234360 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse support::endian. NFC.
Rafael Espindola [Tue, 7 Apr 2015 21:22:05 +0000 (21:22 +0000)]
Use support::endian. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234359 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd boolean to PrintStackTraceOnErrorSignal to disable crash reporting.
Pete Cooper [Tue, 7 Apr 2015 20:43:23 +0000 (20:43 +0000)]
Add boolean to PrintStackTraceOnErrorSignal to disable crash reporting.

The current crash reporting on Mac OS is only disabled via an environment variable.
This adds a boolean (default false) which can also disable crash reporting.

The only client right now is the unittests which don't ever want crash reporting, but do want to detect killed programs.

Reduces the time to run the APFloat unittests on my machine from

[----------] 47 tests from APFloatTest (51250 ms total)

to

[----------] 47 tests from APFloatTest (765 ms total)

Reviewed by Reid Kleckner and Justin Bogner

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234353 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove dead code. NFC.
Rafael Espindola [Tue, 7 Apr 2015 20:38:45 +0000 (20:38 +0000)]
Remove dead code. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234352 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] Mark a bunch of .td Operands with type _MEMORY.
Ahmed Bougacha [Tue, 7 Apr 2015 20:31:16 +0000 (20:31 +0000)]
[ARM] Mark a bunch of .td Operands with type _MEMORY.

This shouldn't affect anything in-tree, as the OperandType users are
mostly smart disassemblers and such; more information is helpful there.
However, on the flip side, that + the fact that this is just hinting at
the meaning of operands makes this not really test-worthy or testable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234350 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[bpf] fix build
Alexei Starovoitov [Tue, 7 Apr 2015 20:25:34 +0000 (20:25 +0000)]
[bpf] fix build

fix the build and remove unused variable warnings in Release mode.

Patch by Brenden Blanco.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234349 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WinEH] Fix xdata generation when no catch object is present
Reid Kleckner [Tue, 7 Apr 2015 19:46:38 +0000 (19:46 +0000)]
[WinEH] Fix xdata generation when no catch object is present

The lack of a catch object is indicated by a frame escape index of -1.

Fixes PR23137.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234346 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove intermediate variables.
Rafael Espindola [Tue, 7 Apr 2015 19:17:47 +0000 (19:17 +0000)]
Remove intermediate variables.

The name of these variables was completely out of date with the information
stored in them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234345 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agomove helper function closer to use; NFC
Sanjay Patel [Tue, 7 Apr 2015 19:13:06 +0000 (19:13 +0000)]
move helper function closer to use; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234344 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEnable W4 warnings by default for MSVC builds
Andrew Kaylor [Tue, 7 Apr 2015 19:01:01 +0000 (19:01 +0000)]
Enable W4 warnings by default for MSVC builds

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234343 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unused argument.
Rafael Espindola [Tue, 7 Apr 2015 19:00:17 +0000 (19:00 +0000)]
Remove unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234342 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Remove constructors for DIRef<>
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 18:41:54 +0000 (18:41 +0000)]
DebugInfo: Remove constructors for DIRef<>

Remove all constructors for `DIRef<>` *except* the ones forwarding from
`TypedDebugNodeRef`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234340 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoadd some const to FastMathFlags getters; NFC
Sanjay Patel [Tue, 7 Apr 2015 18:38:35 +0000 (18:38 +0000)]
add some const to FastMathFlags getters; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234337 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[lit] Allow disabling an entire gtest suite, as is done in tsan
Reid Kleckner [Tue, 7 Apr 2015 18:14:10 +0000 (18:14 +0000)]
[lit] Allow disabling an entire gtest suite, as is done in tsan

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234336 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Try a third time to fix MSVC build after r234290"
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 18:07:41 +0000 (18:07 +0000)]
Revert "Try a third time to fix MSVC build after r234290"

This reverts commit r234295 (and r234294 and r234292 before it).  I
removed the implicit conversion to `MDTuple*` r234326, so there's no
longer an ambiguity in `operator[]()`.

I think MSVC should accept the original code now...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234335 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAArch64: Don't lower ISD::SELECT to ISD::SELECT_CC
Matthias Braun [Tue, 7 Apr 2015 17:33:05 +0000 (17:33 +0000)]
AArch64: Don't lower ISD::SELECT to ISD::SELECT_CC

Instead of lowering SELECT to SELECT_CC which is further lowered later
immediately call the SELECT_CC lowering code. This is preferable
because:
- Avoids an unnecessary roundtrip through the legalization queues with
  an intermediate node.
- More importantly: Lowered operations get visited last leading to SELECT_CC
  getting visited with legalized operands and unlegalized ones for preexisting
  SELECT_CC nodes. This does not hurt the current code (hence no testcase) but
  is required for another patch I am working on.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234334 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Workaround bot failure with explicit conversion to MDTuple*"
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 17:30:52 +0000 (17:30 +0000)]
Revert "Workaround bot failure with explicit conversion to MDTuple*"

This reverts commit r234329, which insufficiently appeased older
`clang`s (apparently that wasn't the only call site).  r234331 was a
more complete fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234333 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWorkaround continued bot failures with MDTupleTypedArrayWrapper
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 17:07:01 +0000 (17:07 +0000)]
Workaround continued bot failures with MDTupleTypedArrayWrapper

Change the explicit constructor to be more specific.  I think this will
get us past the continued bot failures [1] with older clangs.

[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/8203

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234331 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWorkaround bot failure with explicit conversion to MDTuple*
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 17:00:12 +0000 (17:00 +0000)]
Workaround bot failure with explicit conversion to MDTuple*

A bot is failing [1] after r234326, apparently because this code doesn't
do what I think it should:

    template <class U>
    explicit MDTupleTypedArrayWrapper(
        const U &Tuple,
        typename std::enable_if<
            std::is_constructible<const MDTuple *, U>::value>::type * = nullptr)
        : N(Tuple) {}

Just be explicit for now.

[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/8201/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234329 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Remove MDTupleTypedArrayWrapper::operator MDTuple*()
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 16:50:39 +0000 (16:50 +0000)]
IR: Remove MDTupleTypedArrayWrapper::operator MDTuple*()

Remove `MDTupleTypedArrayWrapper::operator MDTuple*()`, since it causes
ambiguity (at least in some [1] compilers [2]) when using indexes to
`MDTupleTypedArrayWrapper::operator[](unsigned)` that are convertible to
(but not the same as) `unsigned`.

[1]: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2308
[2]: http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/4442

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234326 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCleanup register pressure calculation in MachineLICM.
Daniel Jasper [Tue, 7 Apr 2015 16:42:35 +0000 (16:42 +0000)]
Cleanup register pressure calculation in MachineLICM.

There were four almost identical implementations of calculating/updating
the register pressure for a certain MachineInstr. Cleanup to have a
single implementation (well, controlled with two bool flags until this
is cleaned up more).

No functional changes intended.

Tested by verify that there are no binary changes in the entire llvm
test-suite. A new test was added separately in r234309 as it revealed a
pre-existing error in the register pressure calculation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234325 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] [IAS] Allow .set assignments for already defined symbols.
Toma Tabacu [Tue, 7 Apr 2015 13:59:39 +0000 (13:59 +0000)]
[mips] [IAS] Allow .set assignments for already defined symbols.

Summary:
This is not possible when using the IAS for MIPS, but it is possible when using the IAS for other architectures and when using GAS for MIPS.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234316 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRefactor a lot of duplicated code for stub output.
Rafael Espindola [Tue, 7 Apr 2015 13:42:44 +0000 (13:42 +0000)]
Refactor a lot of duplicated code for stub output.

This also moves it earlier so that it they are produced before we print
an end symbol for the data section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234315 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSilencing several "enumeral and non-enumeral type in conditional expression" warnings...
Aaron Ballman [Tue, 7 Apr 2015 13:28:37 +0000 (13:28 +0000)]
Silencing several "enumeral and non-enumeral type in conditional expression" warnings; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234314 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoClear the stub map in getSortedStubs.
Rafael Espindola [Tue, 7 Apr 2015 12:59:28 +0000 (12:59 +0000)]
Clear the stub map in getSortedStubs.

This makes sure they are only output once (and frees a bit of memory).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234313 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[TableGen] Prevent invalid code generation when emitting AssemblerPredicate conditions.
Toma Tabacu [Tue, 7 Apr 2015 12:10:11 +0000 (12:10 +0000)]
[TableGen] Prevent invalid code generation when emitting AssemblerPredicate conditions.

Summary:
The loop which emits AssemblerPredicate conditions also links them together by emitting a '&&'.
If the 1st predicate is not an AssemblerPredicate, while the 2nd one is, nothing gets emitted for the 1st one, but we still emit the '&&' because of the 2nd predicate.
This generated code looks like "( && Cond2)" and is invalid.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234312 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MachineLICM] Remove obsolete comment about not considering reg pressure.
Daniel Jasper [Tue, 7 Apr 2015 11:43:32 +0000 (11:43 +0000)]
[MachineLICM] Remove obsolete comment about not considering reg pressure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234310 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd test showing that MachineLICM is calculating register pressure wrong
Daniel Jasper [Tue, 7 Apr 2015 11:41:40 +0000 (11:41 +0000)]
Add test showing that MachineLICM is calculating register pressure wrong

More details: http://llvm.org/PR23143

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234309 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[RuntimeDyld] Always allocate at least 1 byte for object sections in the JIT to
Lang Hames [Tue, 7 Apr 2015 06:27:56 +0000 (06:27 +0000)]
[RuntimeDyld] Always allocate at least 1 byte for object sections in the JIT to
ensure that section addresses are distinct.

mapSectionAddress will fail if two sections are allocated the same address,
which can happen if any section has zero size (since malloc(0) is implementation
defined). Unfortunately I've been unable to repro this with a simple test case.

Fixes <rdar://problem/20314015>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234299 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc] Save all the x86-64 GPRs before re-entering the JIT.
Lang Hames [Tue, 7 Apr 2015 06:12:21 +0000 (06:12 +0000)]
[Orc] Save all the x86-64 GPRs before re-entering the JIT.

The re-entry code should work for all calling conventions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234298 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry a third time to fix MSVC build after r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 05:03:47 +0000 (05:03 +0000)]
Try a third time to fix MSVC build after r234290

I have no idea what MSVC means with its error text here :(.

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2310

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234295 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry again to fix MSVC build after r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:49:13 +0000 (04:49 +0000)]
Try again to fix MSVC build after r234290

Still failing:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2309

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234294 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry to fix MSVC build after r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:33:42 +0000 (04:33 +0000)]
Try to fix MSVC build after r234290

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2308

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234292 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Remove DITypedArray<>, replace with typedefs
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:14:33 +0000 (04:14 +0000)]
DebugInfo: Remove DITypedArray<>, replace with typedefs

Replace all uses of `DITypedArray<>` with `MDTupleTypedArrayWrapper<>`
and `MDTypeRefArray`.  The APIs are completely different, but the
provided functionality is the same: treat an `MDTuple` as if it's an
array of a particular element type.

To simplify this patch a bit, I've temporarily typedef'ed
`DebugNodeArray` to `DIArray` and `MDTypeRefArray` to `DITypeArray`.
I've also temporarily conditionalized the accessors to check for null --
eventually these should be changed to asserts and the callers should
check for null themselves.

There's a tiny accompanying patch to clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234290 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Remove DICompositeType mutation API
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:12:02 +0000 (04:12 +0000)]
DebugInfo: Remove DICompositeType mutation API

Change `DIBuilder` to mutate `MDCompositeTypeBase` directly, and remove
the wrapping API in `DICompositeType`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234289 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity()
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:07:31 +0000 (04:07 +0000)]
DebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity()

A quick cleanup to sue `DebugNodeRef` instead of `Metadata*` for
`MDImportedEntity::getEntity()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234288 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Move DIFlag accessors from DIVariable to MDLocalVariable
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:55:30 +0000 (03:55 +0000)]
DebugInfo: Move DIFlag accessors from DIVariable to MDLocalVariable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234287 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Move DIExpression bit-piece API to MDExpression
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:49:59 +0000 (03:49 +0000)]
DebugInfo: Move DIExpression bit-piece API to MDExpression

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234286 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Remove special iterators from DIExpression
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:45:57 +0000 (03:45 +0000)]
DebugInfo: Remove special iterators from DIExpression

Remove special iterators from `DIExpression` in favour of same in
`MDExpression`.  There should be no functionality change here.

Note that the APIs are slightly different: `getArg(unsigned)` counts
from 0, not 1, in the `MDExpression` version of the iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234285 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] New API to query if memchecks are necessary after partitioning
Adam Nemet [Tue, 7 Apr 2015 03:35:26 +0000 (03:35 +0000)]
[LoopAccesses] New API to query if memchecks are necessary after partitioning

This is used by Loop Distribution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234283 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Move DISubprogram::is*() queries to MDSubprogram
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:33:57 +0000 (03:33 +0000)]
DebugInfo: Move DISubprogram::is*() queries to MDSubprogram

Move body of `DISubprogram::isPrivate()` (etc.) to `MDSubprogram`, and
change the versions in `DISubprogram` to forward there.

This is just like r234275, but for subprograms instead of types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234282 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Move DIType::is*() queries to MDType
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 01:24:30 +0000 (01:24 +0000)]
DebugInfo: Move DIType::is*() queries to MDType

Move body of `DIType::isObjectPointer()` (etc.) to `MDType`, and change
the versions in `DIType` to forward there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234275 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Move DIFlag-related API from DIDescriptor to DebugNode
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 01:21:40 +0000 (01:21 +0000)]
DebugInfo: Move DIFlag-related API from DIDescriptor to DebugNode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234274 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Rename MDSubrange::getLo() to getLowerBound()
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:39:59 +0000 (00:39 +0000)]
IR: Rename MDSubrange::getLo() to getLowerBound()

During initial review, the `lo:` field was renamed to `lowerBound:`.
Make the same change to the C++ API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234267 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix some minor abuse of C++ terminology in comments.
Richard Smith [Tue, 7 Apr 2015 00:14:27 +0000 (00:14 +0000)]
Fix some minor abuse of C++ terminology in comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234265 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Drop dead code for loose DIDescriptor construction API
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:09:47 +0000 (00:09 +0000)]
DebugInfo: Drop dead code for loose DIDescriptor construction API

Delete `DIDescriptor::is*()` and the various constructors from `MDNode*`
in `DIDescriptor` subclasses.

If this just broke your out-of-tree code, you need to make updates along
the lines of r234255, r234256, r234257 and r234258:

  - Generally, `DIX().isX()` => `isa<MDX>()`.  So, `D.isCompileUnit()`
    should just be `isa<MDCompileUnit>(D)`, modulo checks for null.
      - Exception: `DILexicalBlock` => `MDLexicalBlockBase`.
      - Exception: `DIDerivedType` => `MDDerivedTypeBase`.
      - Exception: `DICompositeType` => `MDCompositeTypeBase`.
      - Exception: `DIVariable` => `MDLocalVariable`.
  - Note that (e.g.) `DICompileUnit` has an implicit constructor from
    `MDCompileUnit*`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234263 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agobindings/go: Stop using DIDescriptor::is*() and auto-casting
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:08:31 +0000 (00:08 +0000)]
bindings/go: Stop using DIDescriptor::is*() and auto-casting

Go bindings edition of r234255.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234262 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Fix -Werror noasserts build after r234255
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:34:41 +0000 (23:34 +0000)]
IR: Fix -Werror noasserts build after r234255

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234259 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCodeGen: Stop using DIDescriptor::is*() and auto-casting
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:27:40 +0000 (23:27 +0000)]
CodeGen: Stop using DIDescriptor::is*() and auto-casting

Same as r234255, but for lib/CodeGen and lib/Target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234258 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTransforms: Stop using DIDescriptor::is*() and auto-casting
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:27:00 +0000 (23:27 +0000)]
Transforms: Stop using DIDescriptor::is*() and auto-casting

Same as r234255, but for lib/Analysis and lib/Transforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234257 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Stop using DIDescriptor::is*() and auto-casting
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:18:49 +0000 (23:18 +0000)]
IR: Stop using DIDescriptor::is*() and auto-casting

`DIDescriptor`'s subclasses allow construction from incompatible
pointers, and `DIDescriptor` defines a series of `isa<>`-like functions
(e.g., `isCompileUnit()` instead of `isa<MDCompileUnit>()`) that clients
tend to use like this:

    if (DICompileUnit(N).isCompileUnit())
      foo(DICompileUnit(N));

These construction patterns work together to make `DIDescriptor` behave
differently from normal pointers.

Instead, use built-in `isa<>`, `dyn_cast<>`, etc., and only build
`DIDescriptor`s from pointers that are valid for their type.

I've split this into a few commits for different parts of LLVM and clang
(to decrease the patch size and increase the chance of review).
Generally the changes I made were NFC, but in a few places I made things
stricter if it made sense from the surrounded code.

Eventually a follow-up commit will remove the API for the "old" way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234255 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix failure on builder clang-cmake-mips where it was printing a 32-bit address
Kevin Enderby [Mon, 6 Apr 2015 22:33:43 +0000 (22:33 +0000)]
Fix failure on builder clang-cmake-mips where it was printing a 32-bit address
incorrectly because it came from an expression using S.getAddress() which always
returns a 64-bit value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234251 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Allow isa<> on DIDescriptor and subclasses
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 22:32:20 +0000 (22:32 +0000)]
DebugInfo: Allow isa<> on DIDescriptor and subclasses

Allow LLVM-style casting on `DIDescriptor` and its subclasses so they
can behave more like raw pointers.  I haven't bothered with tests since
I have a follow-up commit coming shortly that uses them extensively in
tree, and I'm hoping to kill `DIDescriptor` entirely before too long (so
they won't have time to bitrot).

Usage examples:

    DIDescriptor D = foo();
    if (DICompileUnit CU = dyn_cast<MDCompileUnit>(D))
      return bar(CU);
    else if (auto *SP = dyn_cast<MDSubprogram>(D))
      return baz(SP);
    return other(D);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234250 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse sext in fast isel.
Rafael Espindola [Mon, 6 Apr 2015 22:29:07 +0000 (22:29 +0000)]
Use sext in fast isel.

Fast isel used to zero extends immediates to 64 bits. This normally goes
unnoticed because the value is truncated to 32 bits for output.

Two cases were it is noticed:

* We fail to use smaller encodings.
* If the original constant was smaller than i32.

In the tests using i1 constants, codegen would change to use -1, which is fine
(and matches what regular isel does) since only the lowest bit is then used.

Instead, this patch then changes the ir to use i8 constants, which looks more
like what clang produces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234249 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Reimplement DIRef<>::resolve() using TypedDebugNodeRef<>
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 22:27:37 +0000 (22:27 +0000)]
DebugInfo: Reimplement DIRef<>::resolve() using TypedDebugNodeRef<>

Gut `DIRef<>::resolve()`, reimplementing it using
`TypedDebugNodeRef<>::resolve()`.  Use three separate functions rather
than some sort of type traits, since the latter (i.e., mapping `DIScope`
=> `MDScope`) seems heavy-handed.  I don't expect `DIRef<>` to last much
longer in tree anyway.

As a drive-by fix, make `TypedDebugNodeRef<>::resolve()` do the right
thing with `nullptr`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234248 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[lit] Skip gtest names starting with DISABLED_
Reid Kleckner [Mon, 6 Apr 2015 22:16:58 +0000 (22:16 +0000)]
[lit] Skip gtest names starting with DISABLED_

The sanitizer test suite uses this idiom to disable a test.  Now that we
actually check if a test ran after invoking it, we see that zero tests
ran, and complain.

Instead, ignore tests starting with DISABLED_ completely. Fixes the
sanitizer test suite failures on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234247 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Drop confusing forwarding API from DILexicalBlockFile
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 22:07:46 +0000 (22:07 +0000)]
DebugInfo: Drop confusing forwarding API from DILexicalBlockFile

Remove `DILexicalBlockFile::getScope()` (whose last use was removed from
clang in r234245), which illegally returned a `DILexicalBlock` despite
its scope sometimes being an `MDSubprogram`.  Also remove the
`getLineNumber()` and `getColumnNumber()` methods that just forwarded to
`DILexicalBlock`'s versions, since there don't seem to be any callers.

Note that the block of code removed from `DebugInfo.cpp` was actually
dead code, since `isLexicalBlock()` (the previous branch) always returns
true when `isLexicalBlockFile()` returns true.

An earlier (broken and untested) version of this was squashed into
r234222 and reverted in r234225.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234246 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[lit] Fix running gtest type-parameterized tests on Windows
Reid Kleckner [Mon, 6 Apr 2015 21:49:55 +0000 (21:49 +0000)]
[lit] Fix running gtest type-parameterized tests on Windows

The '/' character in the test name of a type-parameterized test is not a
path separator, and should not be '\' on Windows. We were passing a test
name to --gtest_filter which found no tests, so the exit code was zero,
indicating a passed test.

This bug has been here since r84387 in 2009, when Jeff Yasskin added the
original lit support for type-paratermized tests. Somewhere along the
line some of the ValueMapTests started failing, but we can fix those
separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234242 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReapply "DebugInfo: Loosen DILexicalBlock constructor"
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:46:46 +0000 (21:46 +0000)]
Reapply "DebugInfo: Loosen DILexicalBlock constructor"

This reverts commit r234225, reapplying r234222 in spirit.

This time, just include what the commit message actually describes:
loosen the `DILexicalBlock` constructor to require a
`MDLexicalBlockBase`, since that's what `DILexicalBlock` is wrapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234241 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "DebugInfo: Loosen DILexicalBlock constructor"
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:30:23 +0000 (21:30 +0000)]
Revert "DebugInfo: Loosen DILexicalBlock constructor"

This reverts commit r234222, while I look into bot failures [1].  I'll
recommit soon.

[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/7117/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234225 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoArgPromo: Bail out earlier for varargs functions
David Blaikie [Mon, 6 Apr 2015 21:27:31 +0000 (21:27 +0000)]
ArgPromo: Bail out earlier for varargs functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234224 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Loosen DILexicalBlock constructor
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:16:11 +0000 (21:16 +0000)]
DebugInfo: Loosen DILexicalBlock constructor

This class wraps `MDLexicalBlockBase`, so allow construction from it!
Currently doesn't cause any problems because of the explicit `MNode*`
constructor, but I'll be removing that soon enough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234222 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove `checkInterfaceFunction` to ModuleUtils
Ismail Pazarbasi [Mon, 6 Apr 2015 21:09:08 +0000 (21:09 +0000)]
Move `checkInterfaceFunction` to ModuleUtils

Summary:
Instead of making a local copy of `checkInterfaceFunction` for each
sanitizer, move the function in a common place.

Reviewers: kcc, samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234220 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Avoid using PointerType::getElementType when parsing IR
David Blaikie [Mon, 6 Apr 2015 20:59:48 +0000 (20:59 +0000)]
[opaque pointer type] Avoid using PointerType::getElementType when parsing IR

A few calls are left in for error checking - but I'm commenting those
out & trying to build some IR tests (aiming for Argument Promotion to
start with). When I get any of these tests passing I may add flag to
disable the checking so I can add tests that pass with the assertion in
place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234206 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Remove DIDescriptor::Verify()
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:49:39 +0000 (19:49 +0000)]
DebugInfo: Remove DIDescriptor::Verify()

Remove `DIDescriptor::Verify()` and the `Verify()`s from subclasses.
They had already been gutted, and just did an `isa<>` check.

In a couple of cases I've temporarily dropped the check entirely, but
subsequent commits are going to disallow conversions to the
`DIDescriptor`s directly from `MDNode`, so the checks will come back in
another form soon enough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234201 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Add MDTypeRefArray, to replace DITypeArray
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:48:50 +0000 (19:48 +0000)]
DebugInfo: Add MDTypeRefArray, to replace DITypeArray

This array-like wrapper adapts `MDTuple` to have elements of `MDTypeRef`
(whereas `MDTypeArray` has elements of `MDType`).  This is necessary to
migrate code using `DITypeArray`.  The only use of this is
`MDSubroutineType`'s `getTypeArray()` accessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234200 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Remove dead DIType::operator DITypeRef(), NFC
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:23:22 +0000 (19:23 +0000)]
DebugInfo: Remove dead DIType::operator DITypeRef(), NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234198 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Use MDTypeRef throughout the hierarchy
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:03:45 +0000 (19:03 +0000)]
DebugInfo: Use MDTypeRef throughout the hierarchy

Use `MDTypeRef` (etc.) in the new debug info hierarchy rather than raw
`Metadata *` pointers.

I rolled in a change to `DIBuilder` that looks unrelated: take `DIType`
instead of `DITypeRef` as type arguments when creating variables.
However, this was the simplest way to use `MDTypeRef` within the
functions, and didn't require any cleanups from callers in clang (since
they were all passing in `DIType`s anyway, relying on their implicit
conversions to `DITypeRef`).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234197 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WinEH] Don't sink allocas into child handlers
Reid Kleckner [Mon, 6 Apr 2015 18:50:38 +0000 (18:50 +0000)]
[WinEH] Don't sink allocas into child handlers

The uselist isn't enough to infer anything about the lifetime of such
allocas. If we want to re-add this optimization, we will need to
leverage lifetime markers to do it.

Fixes PR23122.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234196 91177308-0d34-0410-b5e6-96231b3b80d8