Commit Graph

261175 Commits

Author SHA1 Message Date
Diana Picus 8abcbbb24b [ARM] GlobalISel: Use TableGen instruction selector
Emit and use the TableGen instruction selector for ARM. At the moment,
this allows us to remove the hand-written code for selecting G_SDIV and
G_UDIV.

Future commits will focus on increasing the code coverage for it and
removing more dead code from the current instruction selector.

llvm-svn: 301905
2017-05-02 09:40:49 +00:00
Pierre Gousseau b7101479a8 [asan] Add strndup/__strndup interceptors if targeting linux.
Differential Revision: https://reviews.llvm.org/D31457

llvm-svn: 301904
2017-05-02 09:01:02 +00:00
Pavel Labath a193a4c8b3 Remove unused code related to CPlusPlusLanguage::FindEquivalentNames
Summary: It is simply unused, and the header for it is private, so there should be no external dependencies.

Reviewers: #lldb, zturner

Reviewed By: zturner

Subscribers: zturner, tberghammer, jingham, lldb-commits

Differential Revision: https://reviews.llvm.org/D32503
Patch by Scott Smith <scott.smith@purestorage.com>.

llvm-svn: 301903
2017-05-02 09:00:52 +00:00
Emilio Cobos Alvarez c7ed9d9f1c [libclang] Revert rL301328 and add tests for the regressions introduced.
Differential Revision: https://reviews.llvm.org/D32566

llvm-svn: 301902
2017-05-02 08:32:15 +00:00
Craig Topper 9881bd9c1d [APInt] Move APInt::getSplat out of line.
I think this method is probably too complex to be inlined.

llvm-svn: 301901
2017-05-02 06:32:27 +00:00
Craig Topper 1e91919ac1 [APInt] Move the setBit and clearBit methods inline.
This makes setBit/clearBit more consistent with setBits which is already inlined.

llvm-svn: 301900
2017-05-02 05:49:40 +00:00
Xinliang David Li 351d9b01b9 Refactor callsite cost computation into a helper function /NFC
Makes code more readable. The function will also be used
by the partial inlining's cost analysis.

llvm-svn: 301899
2017-05-02 05:38:41 +00:00
NAKAMURA Takumi 9378752b67 clang/test/Modules/diag-flags.cpp: Appease targeting *-win32 with explicit triple. Fixes r301846.
MicrosoftRecordLayoutBuilder doesn't have ability of -Wpadded.

FIXME: Would other diag be available here?
llvm-svn: 301898
2017-05-02 05:12:55 +00:00
Peter Collingbourne 99c8fa3bef ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO.
If there is a bug in the LTO implementation that causes it to fail to provide
an expected symbol definition, the linker should report an undefined symbol
error. Unfortunately, we were failing to do so if the symbol definition
was weak, as the undefine() function was turning the definition into a weak
undefined symbol, which resolves to zero if the symbol remains undefined. This
patch causes us to set the binding to STB_GLOBAL when we undefine a symbol.

I can't see a good way to test this. The behaviour should only be observable
if there is a bug in the LTO implementation.

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

llvm-svn: 301897
2017-05-02 05:07:41 +00:00
Rui Ueyama dfb1e2a1a1 Update commetns.
llvm-svn: 301896
2017-05-02 02:58:04 +00:00
Rui Ueyama f13a6904b3 Make getArchiveMembers function a non-member function.
It didn't have to be a member function of Driver. This patch makes
that function a file-scoped non-member function.

llvm-svn: 301895
2017-05-02 02:57:45 +00:00
Xinliang David Li 6133846be1 [PartialInlining] Hook up inline cost analysis
Differential Revision: http://reviews.llvm.org/D32666

llvm-svn: 301894
2017-05-02 02:44:14 +00:00
Dylan McKay 28355efdad [AVR] Save/restore the frame pointer for all functions
A recent commit I made made it so that we only did this for signal or
interrupt handlers. This broke normal functions.

llvm-svn: 301893
2017-05-02 01:57:48 +00:00
Nemanja Ivanovic b89c27f515 [PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LE
Fixes PR30730.
This is a re-commit of a pulled commit. The commit was pulled because some
software projects contained uses of Altivec vectors that violated alignment
requirements. Known issues have now been fixed.

Committing on behalf of Lei Huang.

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

llvm-svn: 301892
2017-05-02 01:47:34 +00:00
Nick Lewycky c190f96b7d Revert r301785 (and r301787) because they caused PR32864.
The fix is that ExprEvaluatorBase::VisitInitListExpr should handle transparent exprs instead of exprs with one element. Fixing that uncovers one testcase failure because the AST for "constexpr _Complex float test2 = {1};" is wrong (the _Complex prvalue should not be const-qualified), and a number of test failures in test/OpenMP where the captured stmt contains an InitListExpr that is in syntactic form.

llvm-svn: 301891
2017-05-02 01:06:16 +00:00
Ahmed Bougacha 899a75cefe [AArch64] armv8-A doesn't have LSE.
r288279 mistakenly added it to all arches, but it's only available
from v8.1 onwards.

The testcase is awkward, because (I suspect) of PR32873.

Spotted by inspection.

llvm-svn: 301890
2017-05-02 00:45:01 +00:00
Kostya Serebryany 5508ffaef2 [sanitizer-coverage] add a deprecation note for the old sanitizer-coverage; remove a TODO printf
llvm-svn: 301889
2017-05-02 00:44:24 +00:00
Kostya Serebryany 2a451c504f [sanitizer-coverage] update the SanitizerCoverage docs to reflect the current state
llvm-svn: 301888
2017-05-02 00:32:57 +00:00
Dylan McKay 634339ab40 [AVR] Fix a bug where the frame pointer is clobbered
Because it was a callee-saved register, we automatically generated code
to spill and unspill its original value so that it is restored after the
function returns.

The problem is that this code was being generated before the epilogue.
The epilogue itself uses the Y register, which could be prematurely
restored by the CSR restoration process.

This removes R29R28 from the CSR list and changes the prologue/epilogue
code to handle it explicitly.

llvm-svn: 301887
2017-05-02 00:11:34 +00:00
George Burgess IV 7bc507a2e8 Revert r301880
This change caused buildbot failures, apparently because we're not
passing around types that InstSimplify is used to seeing. I'm not overly
familiar with InstSimplify, so I'm reverting this until I can figure out
what exactly is wrong.

llvm-svn: 301885
2017-05-01 23:54:41 +00:00
Paul Robinson 9d4eb6922e Stylistic makeover of DWARFDebugLine before working on it. NFC
Rename parameters and locals to CamelCase, doxygenize the header, and
run clang-format on the whole thing.

llvm-svn: 301883
2017-05-01 23:27:55 +00:00
Zachary Turner 8a2ebfb1cd [CodeView] Write CodeView line information.
Differential Revision: https://reviews.llvm.org/D32716

llvm-svn: 301882
2017-05-01 23:27:42 +00:00
Dylan McKay 3bb6eb238e [AVR] Enable the frame pointer for all functions
This is a temporary measure while we figure out a way to get the frame
pointer working correctly.

llvm-svn: 301881
2017-05-01 23:16:59 +00:00
George Burgess IV 6935aefdf0 [InstSimplify] Handle selects of GEPs with 0 offset
In particular (since it wouldn't fit nicely in the summary):
(select (icmp eq V 0) P (getelementptr P V)) -> (getelementptr P V)

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

llvm-svn: 301880
2017-05-01 23:12:08 +00:00
Simon Pilgrim 8d196c88a6 [X86] Reduce code for setting operations actions by merging into loops across multiple types/ops. NFCI.
llvm-svn: 301879
2017-05-01 23:09:01 +00:00
Xin Tong a41bf70bea Empty Space. NFC
llvm-svn: 301878
2017-05-01 23:08:19 +00:00
Davide Italiano b32d512f02 [IR] Garbage collect unused variants. NFCI.
llvm-svn: 301877
2017-05-01 23:04:33 +00:00
Peter Collingbourne 440e204c7b Fix a pessimising move warning.
llvm-svn: 301852
2017-05-01 22:48:10 +00:00
Matthias Braun ab9438cb03 MachineFrameInfo: Track whether MaxCallFrameSize is computed yet; NFC
This tracks whether MaxCallFrameSize is computed yet. Ideally we would
assert and fail when the value is queried before it is computed, however
this fails various targets that need to be fixed first.

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

llvm-svn: 301851
2017-05-01 22:32:25 +00:00
NAKAMURA Takumi 30cac2d256 llvm-link: Add BitReader to deps corresponding to r301832.
llvm-svn: 301850
2017-05-01 22:31:43 +00:00
Davide Italiano 2dfd46bf08 [NewGVN] Don't derive incorrect implications.
In the testcase attached,  we believe %tmp1 implies %tmp4.
where:
  br i1 %tmp1, label %bb2, label %bb7
  br i1 %tmp4, label %bb5, label %bb7

because Wwhile looking at PredicateInfo stuffs we end up calling
isImpliedTrueByMatchingCmp() with the arguments backwards.

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

llvm-svn: 301849
2017-05-01 22:26:28 +00:00
Sanjay Patel 59d0aeaafe [InstCombine] check one-use before applying DeMorgan nor/nand folds
If we have ~(~X & Y), it only makes sense to transform it to (X | ~Y) when we do not need 
the intermediate (~X & Y) value. In that case, we would need an extra instruction to 
generate ~Y + 'or' (as shown in the test changes).

It's ok if we have multiple uses of ~X or Y, however. In those cases, we may not reduce the
instruction count or critical path, but we might improve throughput because we can generate 
~X and ~Y in parallel. Whether that actually makes perf sense or not for a target is something 
we can't answer in IR.

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

llvm-svn: 301848
2017-05-01 22:25:42 +00:00
Richard Smith 941a205119 New file missed from r301846.
llvm-svn: 301847
2017-05-01 22:11:08 +00:00
Richard Smith ea74148f9f Fix initial diagnostic state setup for an explicit module with no diagnostic pragmas.
If a file has no diagnostic pragmas, we build its diagnostic state lazily, but
in this case we never set up the root state to be the diagnostic state in which
the module was originally built, so the diagnostic flags for files in the
module with no diagnostic pragmas were incorrectly based on the user of the
module rather than the diagnostic state when the module was built.

llvm-svn: 301846
2017-05-01 22:10:47 +00:00
Kostya Serebryany 60cff50b27 [sanitizer-coverage] remove more stale code
llvm-svn: 301845
2017-05-01 22:07:12 +00:00
Greg Clayton 48432cfbeb Adds initial llvm-dwarfdump --verify support with unit tests.
lldb-dwarfdump gets a new "--verify" option that will verify a single file's DWARF debug info and will print out any errors that it finds. It will return an non-zero exit status if verification fails, and a zero exit status if verification succeeds. Adding the --quiet option will suppress any output the STDOUT or STDERR.

The first part of the verify does the following:

- verifies that all CU relative references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata) have valid CU offsets
- verifies that all DW_FORM_ref_addr references have valid .debug_info offsets
- verifies that all DW_AT_ranges attributes have valid .debug_ranges offsets
- verifies that all DW_AT_stmt_list attributes have valid .debug_line offsets
- verifies that all DW_FORM_strp attributes have valid .debug_str offsets

Unit tests were added for each of the above cases.

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

llvm-svn: 301844
2017-05-01 22:07:02 +00:00
Peter Collingbourne 74d22dd7dc Bitcode: Make the summary reader responsible for merging. NFCI.
This is to prepare for an upcoming change which uses pointers instead of
GUIDs to represent references.

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

llvm-svn: 301843
2017-05-01 22:04:36 +00:00
Craig Topper 864a363e8f [APInt] In operator!, handle single word case by comparing VAL to 0 directly and handle multiword case by comparing countLeadingZerosSlowCase() to BitWidth.
We were using operator=(0) which implicitly calls countLeadingZeros but only to compare with 64 to determine if we can compare VAL or pVal[0] to uint64_t. By handling the multiword case with countLeadingZerosSlowCase==BitWidth we can prevent a load of pVal[0] from being inserted inline at each call site. This saves a little bit of code size.

llvm-svn: 301842
2017-05-01 21:56:05 +00:00
Quentin Colombet cdf8c81127 [AArch64] Move GISel accessor initialization from TargetMachine to Subtarget.
NFC

llvm-svn: 301841
2017-05-01 21:53:19 +00:00
Richard Smith b35fc3df5d Put back REQUIRES: system-darwin to fix asan bot.
These tests do not appear to be Darwin-specific, and this REQUIRES: appears to
be hiding a real bug; this change is just restoring the prior state to get the
buildbots happy again while we investigate. (The system-darwin requirement is
covered by PR32851.)

llvm-svn: 301840
2017-05-01 21:49:54 +00:00
Vedant Kumar b33cc94142 [ubsan] Fall back to the fast unwinder when print_stacktrace=1
This makes it possible to get stacktrace info when print_stacktrace=1 on
Darwin (where the slow unwinder is not currently supported [1]). This
should not regress any other platforms.

[1] The thread about r300295 has a relatively recent discusion about
this. We should be able to enable the existing slow unwind functionality
for Darwin, but this needs more testing.

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

llvm-svn: 301839
2017-05-01 21:41:01 +00:00
Craig Topper e3dd644326 [APInt] Fix copy/paste mistake in comment for isNullValue. NFC
llvm-svn: 301838
2017-05-01 21:16:44 +00:00
Kostya Serebryany e5ca68cfcd [asan] speed up small memcpy (> 32 but <= 64 bytes)
llvm-svn: 301837
2017-05-01 21:05:29 +00:00
Gabor Horvath 8b8c5a0e5a Reorder release notes, fix missing link and a grammar issue.
Patch by Réka Nikolett Kovács!

llvm-svn: 301836
2017-05-01 21:02:38 +00:00
Peter Collingbourne a992f53099 IPO: Add missing build dep.
llvm-svn: 301835
2017-05-01 20:57:20 +00:00
Simon Pilgrim ab1a82764f [X86][AVX] Rename LowerVectorBroadcast to lowerBuildVectorAsBroadcast. NFCI.
Since the shuffle refactor, this is only used during BUILD_VECTOR lowering.

llvm-svn: 301834
2017-05-01 20:56:35 +00:00
Rui Ueyama 92a8d798b8 Add comments about how we handle mergeable sections with relocations.
Also factored out code.

llvm-svn: 301833
2017-05-01 20:49:09 +00:00
Peter Collingbourne c15d60b772 Object: Remove ModuleSummaryIndexObjectFile class.
Differential Revision: https://reviews.llvm.org/D32195

llvm-svn: 301832
2017-05-01 20:42:32 +00:00
Sterling Augustine ba6c9cb5e8 Add powerpc64 and powerpc64le to build infrastructure.
From Phab D32031.

llvm-svn: 301831
2017-05-01 20:35:02 +00:00
Rafael Espindola 4aa2ef5b0e Fix pr32816.
When using linkerscripts we were trying to sort SHF_LINK_ORDER
sections too early. Instead of always doing two runs of
assignAddresses, record the section order in processCommands.

llvm-svn: 301830
2017-05-01 20:32:39 +00:00