Commit Graph

244309 Commits

Author SHA1 Message Date
Matthias Braun 3d85ebe5b1 MIRParser: generic register operands with types
This should fix the fallout of r283848.

llvm-svn: 283850
2016-10-11 04:22:29 +00:00
Jason Molenda 086a78cf23 Add a second, more complicated, arm64 example program to
the arm64 assembly unwind tests.

llvm-svn: 283849
2016-10-11 03:44:48 +00:00
Matthias Braun 74ad41c7cd MIRParser: Rewrite register info initialization; mostly NFC
This changes MachineRegisterInfo to be initializes after parsing all
instructions. This is in preparation for upcoming commits that allow the
register class specification on the operand or deduce them from the
MCInstrDesc.

This commit removes the unused feature of having nonsequential register
numbers. This was confusing anyway as the vreg numbers would be
different after parsing when you had "holes" in your numbering.

This patch also introduces the concept of an incomplete virtual
register. An incomplete virtual register may be used during .mir parsing
to construct MachineOperands without knowing the exact register class
(or register bank) yet.

NFC except for some error messages.

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

llvm-svn: 283848
2016-10-11 03:13:01 +00:00
Jason Molenda 6853cca1c9 Add a first unit test for the arm64 instruction profiled unwind
plan generator.

Fix a small bug in EmulateInstructionARM64::GetFramePointerRegister
which was returning the stack pointer reg instead of fp, prevented
the unwinder from recognizing the switch to using the fp in a
function. (<rdar://problem/28663117>)

Add a new eContextRestoreStackPointer context hint so that the arm64
emulator can flag when the frame pointer value is copied back in to
the stack pointer and that should be used to compute the canonical
frame address again in an epilogue sequence.  (<rdar://problem/28704862>)

Small changes to UnwindAssemblyInstEmulation to have a method we can
call without a live process/thread/etc for unit tests.

<rdar://problem/28663117> 
<rdar://problem/28704862> 
<rdar://problem/28509178> 

llvm-svn: 283847
2016-10-11 02:24:00 +00:00
Jim Ingham 8e7fe2c741 Fixing the bug number for darwin on this failure.
llvm-svn: 283843
2016-10-11 01:53:43 +00:00
Kyle Butt ae068a320c Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well. Issue was worklist/scheduling/taildup issue in layout.

Issue from 2nd rollback fixed, with 2 additional tests. Issue was
tail merging/loop info/tail-duplication causing issue with loops that share
a header block.

Issue with early tail-duplication of blocks that branch to a fallthrough
predecessor fixed with test case: tail-dup-branch-to-fallthrough.ll

Differential revision: https://reviews.llvm.org/D18226

llvm-svn: 283842
2016-10-11 01:20:33 +00:00
Kostya Serebryany d19919a80e [libFuzzer] implement value profile for switch, increase the size of the PCs array, make sure we don't overflow it
llvm-svn: 283841
2016-10-11 01:14:41 +00:00
Kostya Serebryany 3e0e901a18 [libFuzzer] add switch tests
llvm-svn: 283840
2016-10-11 01:13:32 +00:00
Hal Finkel a898370c4d Fixup test/Driver/opt-record.c for nvptx pointer size
On some systems, it looks like nvptx is used instead of nvptx64.

llvm-svn: 283839
2016-10-11 01:05:45 +00:00
Dylan McKay c328fe5af4 [RegAllocGreedy] Attempt to split unspillable live intervals
Summary:
Previously, when allocating unspillable live ranges, we would never
attempt to split. We would always bail out and try last ditch graph
recoloring.

This patch changes this by attempting to split all live intervals before
performing recoloring.

This fixes LLVM bug PR14879.

I can't add test cases for any backends other than AVR because none of
them have small enough register classes to trigger the bug.

Reviewers: qcolombet

Subscribers: MatzeB

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

llvm-svn: 283838
2016-10-11 01:04:36 +00:00
Rui Ueyama 9aa4ab6f9b Revert "Add section header stream to PDB." because it depends on r283823.
The change this patch depends on was reverted.

llvm-svn: 283837
2016-10-11 01:01:40 +00:00
David Majnemer 80dca0c78f [InstCombine] Transform !range metadata to !nonnull when combining loads
When combining an integer load with !range metadata that does not include 0 to a pointer load, make sure emit !nonnull metadata on the newly-created pointer load. This prevents the !nonnull metadata from being dropped during a ptrtoint/inttoptr pair.

This fixes PR30597.

Patch by Ariel Ben-Yehuda!

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

llvm-svn: 283836
2016-10-11 01:00:45 +00:00
Jim Ingham bc3236ba20 This test was failing because /bin/ls is no longer debuggable on OS X.
Add an executable that we can debug.

llvm-svn: 283835
2016-10-11 00:35:41 +00:00
Hal Finkel 8f96e82cb8 Add an option to save the backend-produced YAML optimization record to a file
The backend now has the capability to save information from optimizations, the
same information that can be used to generate optimization diagnostics but in
machine-consumable form, into an output file. This can be enabled when using
opt (see r282539), and this change enables it when using clang. The idea is
that other tools will be able to consume these files, and perhaps in
combination with the original source code, produce various kinds of
optimization reports for users (and for compiler developers).

We now have at-least two tools that can consume these files:
  * tools/llvm-opt-report
  * utils/opt-viewer

Using the flag -fsave-optimization-record will cause the YAML file to be
generated; the file name will be based on the output file name (if we're using
-c or -S and have an output name), or the input file name. When we're using
CUDA, or some other offloading mechanism, separate files are generated for each
backend target. The output file name can be specified by the user using
-foptimization-record-file=filename.

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

llvm-svn: 283834
2016-10-11 00:26:09 +00:00
Justin Lebar 4043ca7394 [Sema] Add explicit move constructor for ExpressionEvaluationContextRecord.
This is needed to keep MSVC 2013 happy.

llvm-svn: 283833
2016-10-11 00:23:53 +00:00
Quentin Colombet d2623f8e38 [AArch64][InstructionSelector] Teach how to select FP load/store.
This patch allows to select 32 and 64-bit FP load and store.

llvm-svn: 283832
2016-10-11 00:21:14 +00:00
Quentin Colombet 0e5312787e [AArch64][InstructionSelector] Teach the selector how to handle vector OR.
This only adds the support for 64-bit vector OR. Adding more sizes is
not difficult, but it requires a bigger refactoring because ORs work on
any size, not necessarly the ones that match the width of the register
width. Right now, this is not expressed in the legalization, so don't
bother pushing the refactoring yet.

llvm-svn: 283831
2016-10-11 00:21:11 +00:00
Richard Smith f75dcbef20 Aligned allocation versus CUDA: make deallocation function preference order
match other CUDA preference orders, per discussion with jlebar. We now model
this in an attempt to match overload resolution as closely as possible:

- First, we throw out all non-callable (due to CUDA host/device mismatch)
  operator delete functions.
- Then we apply sizedness / alignedness preferences based on whether the type
  is overaligned and whether the deallocation function is a member.
- Finally, we use the CUDA callability preference as a tiebreaker.

llvm-svn: 283830
2016-10-11 00:21:10 +00:00
Quentin Colombet d3126d5fb4 [AArch64][MachineLegalizer] Mark v2s32 G_LOAD as legal.
Actually every 64-bit loads are legal, but right now the API does not
offer a simple way to express that.

llvm-svn: 283829
2016-10-11 00:21:08 +00:00
Rui Ueyama 8af4988f35 Revert r283824 and r283823: Define DbiStreamBuilder::addDbgStream to add stream.
This reverts commit r283824 and r283823 to fix buildbots.

llvm-svn: 283828
2016-10-11 00:15:50 +00:00
Bruno Cardoso Lopes 8838db8a9d [Driver][Diagnostics] Make 'show option names' default for driver warnings
Currently, driver level warnings do not show option names (e.g. warning:
complain about foo [-Woption-name]) in a diagnostic unless
-fdiagnostics-show-option is explictly specified. OTOH, the driver by
default turn this option on for CC1. Change the logic to show option
names by default in the driver as well.

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

rdar://problem/27300909

llvm-svn: 283827
2016-10-11 00:01:22 +00:00
Davide Italiano 4683f9d7dc [ThinLTO] Attempt to fix the test (and the bots).
llvm-svn: 283826
2016-10-10 23:56:13 +00:00
Rui Ueyama 55505954fe Add section header stream to PDB.
Differential Revision: https://reviews.llvm.org/D25357

llvm-svn: 283825
2016-10-10 23:44:10 +00:00
Rui Ueyama 914eef6a64 Fix a bug in DbiStreamBuilder::addDbgStream.
This feature will be tested in LLD unit tests.

llvm-svn: 283824
2016-10-10 23:44:04 +00:00
Rui Ueyama 70edd9e41d Define DbiStreamBuilder::addDbgStream to add stream.
Previously, there is no way to create a stream other than pre-defined
special stream such as DBI or IPI. This patch adds a new method,
addDbgStream, to add a debug stream to a PDB file.

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

llvm-svn: 283823
2016-10-10 23:35:36 +00:00
Jim Ingham dfaf9ccacf Adding radar number on our end for llvm.org/pr15824.
llvm-svn: 283821
2016-10-10 23:31:36 +00:00
Jim Ingham 43f5e983b3 Add the related radar on our end for llvm.org/pr15824.
llvm-svn: 283820
2016-10-10 23:29:01 +00:00
Mehdi Amini 7ba59edbfb Fix clang-tools-extra build after r283815 (Store FileEntry::Filename as a StringRef instead of raw pointer)
llvm-svn: 283819
2016-10-10 23:24:16 +00:00
Chris Matthews 47cbb566f4 Fix issue which cases lit installed with setup.py to not resolve main
llvm-svn: 283818
2016-10-10 23:22:11 +00:00
Davide Italiano b6e6e4a074 [LTO] Split the options for ThinLTO jobs and Regular LTO partitions
Differential Revision:   https://reviews.llvm.org/D25452

llvm-svn: 283817
2016-10-10 23:12:14 +00:00
NAKAMURA Takumi c6350bc697 Fix llvm-lit.in corresponding to r283710.
Traceback (most recent call last):
    File "bin/llvm-lit", line 44, in <module>
      lit.main(builtin_parameters)
  AttributeError: 'module' object has no attribute 'main'

Suggested by Artem Belevich.

llvm-svn: 283816
2016-10-10 23:02:42 +00:00
Mehdi Amini 004b9c7aae Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)
llvm-svn: 283815
2016-10-10 22:52:47 +00:00
Peter Collingbourne 0da86301ad Revert r283690, "MC: Remove unused entities."
llvm-svn: 283814
2016-10-10 22:49:37 +00:00
Jim Ingham 400892bd48 Add the radar number on our end.
llvm-svn: 283813
2016-10-10 22:21:47 +00:00
Sanjay Patel 3013a62dd8 [x86] auto-generate checks
llvm-svn: 283812
2016-10-10 22:04:12 +00:00
Sanjay Patel b493cdaabf [x86] auto-generate checks
llvm-svn: 283811
2016-10-10 22:01:42 +00:00
Adrian Prantl e941fc1964 [Driver] Let -gline-tables-only win when it comes after -gmodules.
The -gmodules option is all about putting debug type info into clang
modules and for line tables the type information is irrelevant, so
combining these two options makes no sense.
This commmit fixes the behavior to match the one  documented on the
clang man page: the last -g... option wins.

<rdar://problem/27059770>

llvm-svn: 283810
2016-10-10 21:56:20 +00:00
Tim Northover bdf1624367 GlobalISel: select G_GLOBAL_VALUE uses on AArch64.
llvm-svn: 283809
2016-10-10 21:50:00 +00:00
Tim Northover ad0acca544 GlobalISel: allow G_GLOBAL_VALUEs in AArch64 legalization.
llvm-svn: 283808
2016-10-10 21:49:53 +00:00
Tim Northover 2fda4b08ae GlobalISel: support selecting G_GEP instructions.
They're basically just an alias for G_ADD on AArch64.

llvm-svn: 283807
2016-10-10 21:49:49 +00:00
Tim Northover 4edc60d785 GlobalISel: support selecting constants on AArch64.
llvm-svn: 283806
2016-10-10 21:49:42 +00:00
Dehao Chen 84287abf43 Rename isHotFunction/isColdFunction to isFunctionEntryHot/isFunctionEntryCold. (NFC)
This is in preparation for https://reviews.llvm.org/D25048

llvm-svn: 283805
2016-10-10 21:47:28 +00:00
Marshall Clow 4bf466bd09 Mark 2777 as complete
llvm-svn: 283804
2016-10-10 21:37:16 +00:00
Zachary Turner 5f78a9723f Revert "Disallow ArrayRef assignment from temporaries."
This reverts commit r283798, as it causes static asserts on
MSVC 2015 with the following errors:

ArrayRefTest.cpp(38): error C2338: Assigning from single prvalue element
ArrayRefTest.cpp(41): error C2338: Assigning from single xvalue element
ArrayRefTest.cpp(47): error C2338: Assigning from an initializer list

llvm-svn: 283803
2016-10-10 21:36:23 +00:00
Mehdi Amini b1bdc47309 Change Builtins name to be stored as StringRef instead of raw pointers (NFC)
llvm-svn: 283802
2016-10-10 21:34:29 +00:00
Vitaly Buka a77ac1b214 Add -fno-sanitize-address-use-after-scope flag
Reviewers: eugenis

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

llvm-svn: 283801
2016-10-10 21:31:50 +00:00
Zachary Turner edce6e9126 Rename llvm::apply -> llvm::apply_tuple.
llvm::cl already has a function called llvm::apply() so this is
causing an ODR violation.  The STLExtras version should win the
vote on which one gets to be called apply() since it is named
after the equivalent STL function, but since renaiming the cl
version is more difficult, let's do this for now to get the
bots green.

llvm-svn: 283800
2016-10-10 21:24:34 +00:00
Marshall Clow e1736760c8 Update with the rest of the results from the 7-Oct Telecom
llvm-svn: 283799
2016-10-10 21:00:12 +00:00
Jordan Rose d77cee3f54 Disallow ArrayRef assignment from temporaries.
Without this, the following statements will create ArrayRefs that
refer to temporary storage that goes out of scope by the end of the
line:

  someArrayRef = getSingleElement();
  someArrayRef = {elem1, elem2};

Note that the constructor still has this problem:

  ArrayRef<Element> someArrayRef = getSingleElement();
  ArrayRef<Element> someArrayRef = {elem1, elem2};

but that's a little harder to get rid of because we want to be able to
use this in calls:

  takesArrayRef(getSingleElement());
  takesArrayRef({elem1, elem2});

Part of rdar://problem/16375365. Reviewed by Duncan Exon Smith.

llvm-svn: 283798
2016-10-10 20:57:33 +00:00
Hal Finkel fcd2421667 [SelectionDAGBuilder] Support llvm.flt.rounds on targets where i32 is not legal
Add integer expansion for FLT_ROUNDS_ for targets where i32 is not a legal
type.

Patch by Edward Jones, thanks!

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

llvm-svn: 283797
2016-10-10 20:45:15 +00:00