134452 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
e4756450e1 CodeGen: Use MachineInstr& in IfConversion, NFC
Switch to a range-based for in IfConverter::PredicateBlock and take
MachineInstr& in MaySpeculate to avoid an implicit conversion from
MachineBasicBlock::iterator to MachineInstr*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 23:04:51 +00:00
Chandler Carruth
8b7ef5c3e7 Remove non-ASCII characters (silly smart quotes). Thanks to Hal for
noticing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274289 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 23:04:20 +00:00
Reid Kleckner
5f0f4b69f4 [TableGen] Use a SmallVector for Record::Values to avoid debug iterators
Debug iterators are valuable so we don't want to turn them off
completely. However, llvm-tblgen is critical to build speed, so we can
skip them here.

Regenerating X86GenSubtargetInfo.inc in a clang-cl self-host debug build
now takes 39s instead of 1m29s.

Helps PR28222

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 23:04:07 +00:00
Duncan P. N. Exon Smith
a204da23db CodeGen: Use MachineInstr& in TargetLowering, NFC
This is a mechanical change to make TargetLowering API take MachineInstr&
(instead of MachineInstr*), since the argument is expected to be a valid
MachineInstr.  In one case, changed a parameter from MachineInstr* to
MachineBasicBlock::iterator, since it was used as an insertion point.

As a side effect, this removes a bunch of MachineInstr* to
MachineBasicBlock::iterator implicit conversions, a necessary step
toward fixing PR26753.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 22:52:52 +00:00
David L Kreitzer
c909aafffe Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 21:43:11 +00:00
Matt Arsenault
d560010a2e Don't use unchecked dyn_cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 21:18:06 +00:00
Matt Arsenault
6bcca1a915 SLPVectorizer: Move propagateMetadata to VectorUtils
This will be re-used by the LoadStoreVectorizer.

Fix handling of range metadata and testcase by Justin Lebar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 21:17:59 +00:00
Matt Arsenault
7b7d4b781c AMDGPU: Add m0 vgpr load loop block as successor
This shows up as a verifier error when I move this
earlier, not sure why it didn't before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 20:49:28 +00:00
Mike Aizatsky
f6653a309e [libFuzzer] Let user specify extra stats file.
Summary: If AFL_DRIVER_EXTRA_STATS_FILENAME is set and valid, write to it peak_rss_mb and slowest_unit_time_sec. These are both stats that libFuzzer can print but afl cannot.

Reviewers: kcc, aizatsky, metzman

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 20:43:06 +00:00
Vassil Vassilev
410bcd4dce [CMake] Module builds depend on target intrinsics_gen to be built first.
When compiling with modules, header A and B can be in the same module M.
B depends on intrinsics_gen and A doesn't. Compiling a source file #include-ing
header A, we implicitly request module M to be built. It puts header A and B in
the same TU and tries to build them. Since B depends on intrinsics_gen (which
might not be built yet) we run into build failures.

This should fix our modules buildbot.

Patch reviewed by Chris Bieneman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 20:35:56 +00:00
Chandler Carruth
348a232e90 Introduce a *draft* of a code of conduct for the LLVM community and the
associated reporting guide.

I want to emphasize that at this point these are just drafts!

This is the result of very extended discussion on the mailing lists on
several different threads:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091218.html
http://lists.llvm.org/pipermail/llvm-dev/2016-May/099120.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151019/307070.html

The reporting guide in particular I anticipate will be shaped somewhat
by the advisory committee when they are selected. But hopefully this
serves as a good starting point and good guidance while the advisory
committee is being sorted out.

I'd like to thank all the folks who contributed to this. Many, *many*
people worked to help with drafting, wording, suggestions, and edits.
Also, this is based on widely used existing codes of coduct as mentioned
in the text, and the original authors of those deserve many thanks as
well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 20:27:54 +00:00
Yunzhong Gao
c530a20326 Add an artificial line-0 debug location when the compiler emits a call to
__stack_chk_fail(). This avoids a compiler crash.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 18:49:04 +00:00
Wei Mi
693c332887 Refine the set of UniformAfterVectorization instructions.
Except the seed uniform instructions (conditional branch and consecutive ptr
instructions), dependencies to be added into uniform set should only be used
by existing uniform instructions or intructions outside of current loop.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 18:42:56 +00:00
Justin Bogner
66b1dac2d4 CodeGen: Add the other BuildMI overload for MachineInstr&
The change in r274193 missed this variant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 18:32:12 +00:00
Rafael Espindola
9931d67967 Delete MCCodeGenInfo.
MC doesn't really care about CodeGen stuff, so this was just
complicating target initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 18:25:11 +00:00
Etienne Bergeron
c1715eec83 revert http://reviews.llvm.org/D21101
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:52:24 +00:00
Lang Hames
3df768796a [Support] Fix a bug in ErrorList::join / joinErrors.
When concatenating two error lists the ErrorList::join method (which is called
by joinErrors) was failing to set the checked bit on the second error, leading
to a 'failure to check error' assertion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:43:06 +00:00
Zachary Turner
91d41f9825 [pdb] Re-add code to write PDB files.
Somehow all the functionality to write PDB files got removed,
probably accidentally when uploading the patch perhaps the wrong
one got uploaded.  This re-adds all the code, as well as the
corresponding test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:43:00 +00:00
Zachary Turner
3a4681d580 Update llvm-pdbdump to use subcommands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:42:48 +00:00
Adrian Prantl
c49768f972 [CMake] Add an LLVM_ENABLE_MODULE_DEBUGGING flag for building with -gmodules.
This flag is only effective in builds with debug info and modules.
The default is On for Darwin only.

rdar://problem/27019000

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:15:44 +00:00
Adrian Prantl
39952bd72b Revert "[CMake] Move the -Xclang option before -fmodules-cache-path"
This reverts commit 3db82f646a0890eb7664d0351b5a3c79622e8bef.

Vassil already fixed this and I mechanically undid his fix without looking
too close at what I'm actually doing. Need more coffee.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 15:58:36 +00:00
Adrian Prantl
640d4fdf46 [CMake] Move the -Xclang option before -fmodules-cache-path
This fixes a typo introduced in r274196.
Thanks to Vassil Vassilev for noticing!

http://reviews.llvm.org/D21827
rdar://problem/27019000

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 15:44:35 +00:00
Etienne Bergeron
6e9bd6a34d [exceptions] Upgrade exception handlers when stack protector is used
Summary:
MSVC provide exception handlers with enhanced information to deal with security buffer feature (/GS).

To be more secure, the security cookies (GS and SEH) are validated when unwinding the stack.

The following code:
```
void f() {}

void foo() {
  __try {
    f();
  } __except(1) {
    f();
  }
}
```

Reviewers: majnemer, rnk

Subscribers: thakis, llvm-commits, chrisha

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 15:36:59 +00:00
Sanjay Patel
858a9e5ce3 fix formatting, add TODO; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 15:32:45 +00:00
Jun Bum Lim
fe4360eba5 [DSE] Fix bug in partial overwrite tracking
Summary:
Found cases where DSE incorrectly add partially-overwritten intervals.
Please see the test case for details.

Reviewers: mcrosier, eeckstein, hfinkel

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 15:32:20 +00:00
Sanjay Patel
86ef16a761 [InstCombine] shrink switch conditions better (PR24766)
https://llvm.org/bugs/show_bug.cgi?id=24766#c2

This removes a hack that was added for the benefit of x86 codegen. 
It prevented shrinking the switch condition even to smaller legal (DataLayout) types.
We have a safety mechanism in CGP after:
http://reviews.llvm.org/rL251857
...so we're free to use the optimal (smallest) IR type now.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 14:51:21 +00:00
Elliot Colp
aac735c45f Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 14:42:47 +00:00
Sanjay Patel
2f457b8690 [InstCombine] use ConstantExpr::getBitCast() instead of creating useless instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274229 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 14:27:41 +00:00
Sanjay Patel
30bf9cacd9 [InstCombine] extend matchSelectFromAndOr() to work with i1 scalar types
If the incoming types are i1, then we don't have to pattern match any sext ops.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 14:18:18 +00:00
Vassil Vassilev
4112128cf7 [CMake] -fmodules-local-submodule-visibility is a cc1-only option.
This should fix modules builds on platforms other than Darwin after r274196.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274227 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 14:17:42 +00:00
Rafael Espindola
1e7d61d581 Don't repeat names in comments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274226 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 12:44:52 +00:00
Rafael Espindola
809018e56e Delete unused includes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 12:19:16 +00:00
Jonas Paulsson
1f07eb983a [SystemZ] Let z13 also support FeatureMiscellaneousExtensions.
This processor feature had been left out by mistake from the z13
ProcessorModel.

This time with updated test case. Thanks, Hans.

Reviewed by Ulrich Weigand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 07:13:56 +00:00
Pankaj Gode
a822c61ca7 [AArch64] Add Broadcom Vulcan scheduling model.
Adding scheduling model for new Broadcom Vulcan core (ARMv8.1A).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 06:42:31 +00:00
Craig Topper
8c91459fa9 Use ShuffleVectorSDNode::isSplat member method instead of static method isSplatMask where the mask came directly from getMask() on a shuffle node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274208 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:38:51 +00:00
David Majnemer
18b9b9a1f4 [CodeView] Implement support for bitfields in LLVM
CodeView need to know the offset of the storage allocation for a
bitfield.  Encode this via the "extraData" field in DIDerivedType and
introduced a new flag, DIFlagBitField, to indicate whether or not a
member is a bitfield.

This fixes PR28162.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 03:00:20 +00:00
Sanjoy Das
b4b9bfafe7 [SCEV] Compute max be count from shift operator only if all else fails
In particular, check to see if we can compute a precise trip count by
exhaustively simulating the loop first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 02:47:28 +00:00
Chandler Carruth
5c54a093a2 [ADT] Add a new data structure for managing a priority worklist where
re-insertion of entries into the worklist moves them to the end.

This is fairly similar to a SetVector, but helps in the case where in
addition to not inserting duplicates you want to adjust the sequence of
a pop-off-the-back worklist.

I'm not at all attached to the name of this data structure if others
have better suggestions, but this is one that David Majnemer brought up
in IRC discussions that seems plausible.

I've trimmed the interface down somewhat from SetVector's interface
because several things make less sense here IMO: iteration primarily.
I'd prefer to add these back as we have users that need them. My use
case doesn't even need all of what is provided here. =]

I've also included a basic unittest to make sure this functions
reasonably.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 02:32:20 +00:00
George Burgess IV
2e8079ddd8 [CFLAA] Add support for ModRef queries.
This patch makes CFLAA answer some ModRef queries. Because we don't
distinguish between reading/writing when making StratifiedSets, we're
unable to offer any of the readonly-related answers.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274197 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 02:11:26 +00:00
Adrian Prantl
03503146ee [CMake] Introduce a LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY flag.
On Darwin it is currently impossible to build LLVM with modules
because the Darwin system module map is not compatible with
-fmodules-local-submodule-visibility at this point in time.  This
patch makes the flag optional and off by default on Darwin so it
becomes possible to build LLVM with modules again.

http://reviews.llvm.org/D21827
rdar://problem/27019000

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 01:46:49 +00:00
Matthias Braun
6b50e125f3 RegisterScavenging: Code cleanup; NFC
- Use range based for loops
- No need for some !Reg checks: isPhysicalRegister() reports false for
  NoRegister anyway
- Do not repeat function name in documentation comment.
- Do not repeat documentation comment in implementation when we already
  have one at the declaration.
- Factor some common subexpressions out.
- Change file comments to use doxygen syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 00:23:54 +00:00
Duncan P. N. Exon Smith
e1a95d05f2 CodeGen: Add an explicit BuildMI overload for MachineInstr&
Add an explicit overload to BuildMI for MachineInstr& to deal with
insertions inside of instruction bundles.

- Use it to re-implement MachineInstr* to give it coverage.

- Document how the overload for MachineBasicBlock::instr_iterator
  differs from that for MachineBasicBlock::iterator (the previous
  (implicit) overload for MachineInstr&).

- Add a comment explaining why the MachineInstr& and MachineInstr*
  overloads don't universally forward to the
  MachineBasicBlock::instr_iterator overload.

Thanks to Justin for noticing the API quirk.  While this doesn't fix any
known bugs -- all uses of BuildMI with a MachineInstr& were previously
using MachineBasicBlock::iterator -- it protects against future bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 00:10:17 +00:00
Sanjay Patel
aa5c099817 add vector tests to show missing transform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 00:09:13 +00:00
Marcin Koscielnicki
63e0af7cc9 [SystemZ] Split up PerformDAGCombine. [NFC]
This function is already a bit too long, and I'm about to make it worse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 00:08:54 +00:00
Duncan P. N. Exon Smith
567409db69 CodeGen: Use MachineInstr& in TargetInstrInfo, NFC
This is mostly a mechanical change to make TargetInstrInfo API take
MachineInstr& (instead of MachineInstr* or MachineBasicBlock::iterator)
when the argument is expected to be a valid MachineInstr.  This is a
general API improvement.

Although it would be possible to do this one function at a time, that
would demand a quadratic amount of churn since many of these functions
call each other.  Instead I've done everything as a block and just
updated what was necessary.

This is mostly mechanical fixes: adding and removing `*` and `&`
operators.  The only non-mechanical change is to split
ARMBaseInstrInfo::getOperandLatencyImpl out from
ARMBaseInstrInfo::getOperandLatency.  Previously, the latter took a
`MachineInstr*` which it updated to the instruction bundle leader; now,
the latter calls the former either with the same `MachineInstr&` or the
bundle leader.

As a side effect, this removes a bunch of MachineInstr* to
MachineBasicBlock::iterator implicit conversions, a necessary step
toward fixing PR26753.

Note: I updated WebAssembly, Lanai, and AVR (despite being
off-by-default) since it turned out to be easy.  I couldn't run tests
for AVR since llc doesn't link with it turned on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 00:01:54 +00:00
Sanjay Patel
cd92e27aaf regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 23:58:39 +00:00
Matthias Braun
b8a533db1f PrologEpilogInserter: Some code cleanup; NFC
- Use range based for
- Use the more common variable names MBB and MF for
  MachineBasicBlock/MachineFunction variables.
- Add a few const modifiers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 23:54:42 +00:00
Peter Collingbourne
5ba0a2e7fb Add move constructor and move assignment to fix MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 23:54:10 +00:00
Peter Collingbourne
d9613da65c Object: Replace NewArchiveIterator with a simpler NewArchiveMember class. NFCI.
The NewArchiveIterator class has a problem: it requires too much context. Any
memory buffers added to the archive must be stored within an Archive::Member,
which must have an associated Archive. This makes it harder than necessary
to create new archive members (or new archives entirely) from scratch using
memory buffers.

This patch replaces NewArchiveIterator with a NewArchiveMember class that
stores just the memory buffer and the information that goes into the archive
member header.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 22:27:42 +00:00
Adam Nemet
0ae40122a3 [LV] Improve accuracy and formatting of function comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 22:04:10 +00:00