Simon Pilgrim [Thu, 1 Dec 2016 15:41:40 +0000 (15:41 +0000)]
[X86][SSE] Add support for combining AND bitmasks to shuffles.
llvm-svn: 288365
Pavel Labath [Thu, 1 Dec 2016 15:20:34 +0000 (15:20 +0000)]
Remove iostream include from WasmObjectFile
The file does not seems to use c++ iostreams (and is is llvm policy to avoid
that). Committing as obvious.
llvm-svn: 288364
Asaf Badouh [Thu, 1 Dec 2016 15:19:10 +0000 (15:19 +0000)]
[LMT] Restrict nop length to one
not all lakemont MCU support long nop.
we can't assume we can generate long nop by default for MCU.
Differential Revision: https://reviews.llvm.org/D26895
llvm-svn: 288363
Simon Pilgrim [Thu, 1 Dec 2016 14:56:48 +0000 (14:56 +0000)]
[X86][SSE] Tidied up filecheck prefixes for uitofp fast-math tests.
They should be in 'narrowing' order from common to more specific test prefixes.
llvm-svn: 288338
Daniel Jasper [Thu, 1 Dec 2016 14:33:50 +0000 (14:33 +0000)]
Silence GCC's -Wenum-compare after r288335 in the same way it is done
in X86FastISel.cpp.
llvm-svn: 288337
Nicolai Haehnle [Thu, 1 Dec 2016 14:04:13 +0000 (14:04 +0000)]
[SelectionDAG] Rename and clarify visitFMULForFMADCombine (NFC)
Summary: Suggested by @spatel in D26602.
Reviewers: spatel, hfinkel
Subscribers: spatel, llvm-commits
Differential Revision: https://reviews.llvm.org/D27260
llvm-svn: 288336
Simon Pilgrim [Thu, 1 Dec 2016 13:47:02 +0000 (13:47 +0000)]
[X86][SSE] Add support for combining target shuffles to AND bitmasks.
llvm-svn: 288335
Alex Lorenz [Thu, 1 Dec 2016 12:14:38 +0000 (12:14 +0000)]
[ObjC] Avoid a @try/@finally/@autoreleasepool fixit when parsing an expression
This patch ensures that the typo fixit for the @try/@finally/@autoreleasepool {}
directive is shown only when we're parsing an actual statement where such
directives can actually be present.
rdar://
19669565
Differential Revision: https://reviews.llvm.org/D26916
llvm-svn: 288334
Simon Pilgrim [Thu, 1 Dec 2016 11:52:37 +0000 (11:52 +0000)]
[X86][SSE] Add support for combining ISD::AND with shuffles.
Attempts to convert an AND with a vector of 255 or 0 values into a shuffle (blend) mask.
llvm-svn: 288333
Joey Gouly [Thu, 1 Dec 2016 11:30:49 +0000 (11:30 +0000)]
[OpenCL] Refactor read_only/write_only pipes.
This adds the access qualifier to the Pipe Type, rather than using a class
hierarchy.
It also fixes mergeTypes for Pipes, by disallowing merges. Only identical
pipe types can be merged. The test case in invalid-pipes-cl2.0.cl is added
to check that.
llvm-svn: 288332
Pavel Labath [Thu, 1 Dec 2016 11:30:08 +0000 (11:30 +0000)]
Remove a hack from the Android toolchain file
Summary:
The fix is to make sure llvm does not pull in dlopen() in configurations where it
is not available.
Reviewers: tberghammer, beanz
Subscribers: danalbert, srhines, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D26505
llvm-svn: 288331
Simon Pilgrim [Thu, 1 Dec 2016 11:26:07 +0000 (11:26 +0000)]
[X86][SSE] Added tests showing missed combines of shuffles with ANDs.
llvm-svn: 288330
Johannes Doerfert [Thu, 1 Dec 2016 11:12:14 +0000 (11:12 +0000)]
[NFC] Check for feasibility prior to the profitability check
Feasibility is checked late on its own but early it is hidden behind
the "PollyProcessUnprofitable" guard. This change will make sure we opt
out early if the runtime context is infeasible anyway.
llvm-svn: 288329
Johannes Doerfert [Thu, 1 Dec 2016 11:10:45 +0000 (11:10 +0000)]
[FIX] Do not try to hoist obviously overwritten loads
llvm-svn: 288328
Florian Hahn [Thu, 1 Dec 2016 11:02:59 +0000 (11:02 +0000)]
Fix crash with unsupported architectures in Linux/Gnu target triples.
Summary: This patch adds a check and an error message to gnutools::Linker::ConstructJob in case the architecture is not supported. For most other operating systems, the error message is created in lib/Basic/Targets.cpp:AllocateTarget, but when construction the linker arguments for the gnutools linker a supported architecture is required.
Reviewers: rafael, joerg, echristo
Subscribers: mehdi_amini, joerg, dschuff, cfe-commits
Differential Revision: https://reviews.llvm.org/D27066
llvm-svn: 288327
Pavel Labath [Thu, 1 Dec 2016 10:57:30 +0000 (10:57 +0000)]
Use Timeout<> in Process::RunThreadPlan
Summary:
Since the function is way too big already, I tried at least to factor out the
timeout computation stuff into a separate function. I've tried to make the new
code semantically equivalent, and it also makes sense when I look at it as a done
deal.
Reviewers: jingham
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D27258
llvm-svn: 288326
Davide Italiano [Thu, 1 Dec 2016 08:48:14 +0000 (08:48 +0000)]
[SCCP] Switch over to DEBUG() and drop an #ifdef.
llvm-svn: 288325
Davide Italiano [Thu, 1 Dec 2016 08:36:12 +0000 (08:36 +0000)]
[SCCP] Prefer `auto` when the type is obvious. NFCI.
llvm-svn: 288324
Tobias Grosser [Thu, 1 Dec 2016 08:08:47 +0000 (08:08 +0000)]
Add newline at end of debug print
In '[DBG] Allow to emit the RTC value at runtime' the diagnostics were printed
without a newline at the end of each diagnostic. We add such a newline to
improve readability.
llvm-svn: 288323
Eric Christopher [Thu, 1 Dec 2016 07:50:12 +0000 (07:50 +0000)]
Temporarily Revert "Move most EH from MachineModuleInfo to MachineFunction"
This apprears to have broken the global isel bot:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-globalisel_build/5174/console
This reverts commit r288293.
llvm-svn: 288322
Peter Collingbourne [Thu, 1 Dec 2016 07:00:35 +0000 (07:00 +0000)]
Object: Set SF_Indirect in ModuleSymbolTable.
This lets us remove the last use of IRObjectFile::getSymbolGV() in llvm-nm.
Differential Revision: https://reviews.llvm.org/D27076
llvm-svn: 288321
Peter Collingbourne [Thu, 1 Dec 2016 06:53:47 +0000 (06:53 +0000)]
Object: Add SF_Executable symbol flag.
This allows us to remove a few uses of IRObjectFile::getSymbolGV() in
llvm-nm.
While here change host-dependent logic in llvm-nm to target-dependent
logic.
Differential Revision: https://reviews.llvm.org/D27075
llvm-svn: 288320
Peter Collingbourne [Thu, 1 Dec 2016 06:51:47 +0000 (06:51 +0000)]
Object: Extract a ModuleSymbolTable class from IRObjectFile.
This class represents a symbol table built from in-memory IR. It provides
access to GlobalValues and should only be used if such access is required
(e.g. in the LTO implementation). We will eventually change IRObjectFile
to read from a bitcode symbol table rather than using ModuleSymbolTable,
so it would not be able to expose the module.
Differential Revision: https://reviews.llvm.org/D27073
llvm-svn: 288319
Peter Collingbourne [Thu, 1 Dec 2016 06:21:08 +0000 (06:21 +0000)]
Bitcode: The index used by ModuleSummaryIndexBitcodeReader is now required, so make it a reference. NFCI.
llvm-svn: 288318
Peter Collingbourne [Thu, 1 Dec 2016 06:00:53 +0000 (06:00 +0000)]
Bitcode: Introduce BitcodeModule::{has,get}Summary().
These are equivalent to hasGlobalValueSummary() and getModuleSummaryIndex().
Differential Revision: https://reviews.llvm.org/D27242
llvm-svn: 288317
Peter Collingbourne [Thu, 1 Dec 2016 05:52:32 +0000 (05:52 +0000)]
LTO: Remove ModuleLoader, make loadModuleFromBuffer static and move into its only client, ThinLTOCodeGenerator.
This is no longer the recommended way to load modules for importing, so it should not be public API.
Differential Revision: https://reviews.llvm.org/D27292
llvm-svn: 288316
Peter Collingbourne [Thu, 1 Dec 2016 05:47:58 +0000 (05:47 +0000)]
Bitcode: Correctly handle Fixed and VBR arrays in BitstreamCursor::skipRecord().
The assertions were wrong; we need to call getEncodingData() on the element,
not the array. While here, simplify the skipRecord() implementation for Fixed
and Char6 arrays. This is tested by the code I added to llvm-bcanalyzer
which makes sure that we can skip any record.
Differential Revision: https://reviews.llvm.org/D27241
llvm-svn: 288315
Sean Silva [Thu, 1 Dec 2016 05:43:48 +0000 (05:43 +0000)]
Add `isRelExprOneOf` helper
In various places in LLD's hot loops, we have expressions of the form
"E == R_FOO || E == R_BAR || ..." (E is a RelExpr).
Some of these expressions are quite long, and even though they usually go just
a very small number of ways and so should be well predicted, they can still
occupy branch predictor resources harming other parts of the code, or they
won't be predicted well if they overflow branch predictor resources or if the
branches are too dense and the branch predictor can't track them all (the
compiler can in theory avoid this, at a cost in text size). And some of these
expressions are so large and executed so frequently that even when
well-predicted they probably still have a nontrivial cost.
This speedup should be pretty portable. The cost of these simple bit tests is
independent of:
- the target we are linking for
- the distribution of RelExpr's for a given link (which can depend on how the
input files were compiled)
- what compiler was used to compile LLD (it is just a simple bit test;
hopefully the compiler gets it right!)
- adding new target-dependent relocations (e.g. needsPlt doesn't pay any extra
cost checking R_PPC_PLT_OPD on x86-64 builds)
I did some rough measurements on clang-fsds and this patch gives over about 4%
speedup for a regular -O1 link, about 2.5% for -O3 --gc-sections and over 5%
for -O0. Sorry, I don't have my current machine set up for doing really
accurate measurements right now.
This also is just a bit cleaner. Thanks for Joerg for suggesting for
this approach.
Differential Revision: https://reviews.llvm.org/D27156
llvm-svn: 288314
John McCall [Thu, 1 Dec 2016 05:33:30 +0000 (05:33 +0000)]
Teach ConstantBuilder how to emit a reference to the current position
that will be filled in when the initializer is set.
llvm-svn: 288313
Philip Reames [Thu, 1 Dec 2016 04:37:35 +0000 (04:37 +0000)]
Revert previous whitespace change
llvm-svn: 288312
Philip Reames [Thu, 1 Dec 2016 04:37:09 +0000 (04:37 +0000)]
Test commit of whitespace to check permissions.
llvm-svn: 288311
Rui Ueyama [Thu, 1 Dec 2016 04:36:54 +0000 (04:36 +0000)]
Simplify ScriptParser.
- Rename currentBuffer -> getCurrentMB to start it with verb.
- Simplify containsString.
- Add llvm_unreachable at end of getCurrentMB.
llvm-svn: 288310
Rui Ueyama [Thu, 1 Dec 2016 04:36:51 +0000 (04:36 +0000)]
Do not name a variable Ret which is not a return value.
llvm-svn: 288309
Rui Ueyama [Thu, 1 Dec 2016 04:36:49 +0000 (04:36 +0000)]
Make get{Line,Column}Number members of StringParser.
This patch also renames currentLocation getCurrentLocation.
llvm-svn: 288308
Adam Nemet [Thu, 1 Dec 2016 03:56:43 +0000 (03:56 +0000)]
[GVN] When merging blocks update LoopInfo if it's available
If LoopInfo is available during GVN, BasicAA will use it. However
MergeBlockIntoPredecessor does not update LI as it merges blocks.
This didn't use to cause problems because LI was freed before
GVN/BasicAA. Now with OptimizationRemarkEmitter, the lifetime of LI is
extended so LI needs to be kept up-to-date during GVN.
Differential Revision: https://reviews.llvm.org/D27288
llvm-svn: 288307
Rui Ueyama [Thu, 1 Dec 2016 03:56:27 +0000 (03:56 +0000)]
Split getPos into getLineNumber and getColumnNumber.
llvm-svn: 288306
Richard Smith [Thu, 1 Dec 2016 03:32:42 +0000 (03:32 +0000)]
P0012R1: add Itanium ABI support for throwing non-noexcept function pointers and catching as noexcept.
llvm-svn: 288305
Richard Smith [Thu, 1 Dec 2016 03:04:07 +0000 (03:04 +0000)]
Revert r285664, cxx-abi-dev chose to go in a different direction for the ABI here.
llvm-svn: 288304
Ivan Krasin [Thu, 1 Dec 2016 02:54:54 +0000 (02:54 +0000)]
Use trigrams to speed up SpecialCaseList.
Summary:
it's often the case when the rules in the SpecialCaseList
are of the form hel.o*bar. That gives us a chance to build
trigram index to quickly discard 99% of inputs without
running a full regex. A similar idea was used in Google Code Search
as described in the blog post:
https://swtch.com/~rsc/regexp/regexp4.html
The check is defeated, if there's at least one regex
more complicated than that. In this case, all inputs
will go through the regex. That said, the real-world
rules are often simple or can be simplied. That considerably
speeds up compiling Chromium with CFI and UBSan.
As measured on Chromium's content_message_generator.cc:
before, CFI: 44 s
after, CFI: 23 s
after, CFI, no blacklist: 23 s (~1% slower, but 3 runs were unable to show the difference)
after, regular compilation to bitcode: 23 s
Reviewers: pcc
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D27188
llvm-svn: 288303
Peter Collingbourne [Thu, 1 Dec 2016 02:51:12 +0000 (02:51 +0000)]
LTO: Remove Symbol::getIRName().
Its only use was in the LTO implementation. Also document
Symbol::getName().
llvm-svn: 288302
Richard Smith [Thu, 1 Dec 2016 02:11:49 +0000 (02:11 +0000)]
PR31081: ignore exception specifications when deducing function template
arguments from a declaration; despite what the standard says, this form of
deduction should not be considering exception specifications.
llvm-svn: 288301
Kostya Serebryany [Thu, 1 Dec 2016 02:06:56 +0000 (02:06 +0000)]
revert r288283 as it causes debug info (line numbers) to be lost in instrumented code. also revert r288299 which was a workaround for the problem.
llvm-svn: 288300
Kostya Serebryany [Thu, 1 Dec 2016 01:33:44 +0000 (01:33 +0000)]
[libFuzzer] temporary disable a part of the test broken by r288283
llvm-svn: 288299
Rui Ueyama [Thu, 1 Dec 2016 01:22:48 +0000 (01:22 +0000)]
Dump Codeview type information correctly.
llvm-svn: 288298
George Burgess IV [Thu, 1 Dec 2016 00:13:18 +0000 (00:13 +0000)]
[TableGen] Minor clean-ups. NFC.
Primarily: try to use DenseSet<StringRef> instead of
std::set<std::string>, and use pretty range algos where we can.
Small sizes were arbitrarily chosen.
llvm-svn: 288297
Derek Schuff [Thu, 1 Dec 2016 00:11:15 +0000 (00:11 +0000)]
[WebAssembly] Emit .import_global assembler directives
Support a new assembler directive, .import_global, to declare imported
global variables (i.e. those with external linkage and no
initializer). The linker turns these into wasm imports.
Patch by Jacob Gravelle
Differential Revision: https://reviews.llvm.org/D26875
llvm-svn: 288296
John McCall [Wed, 30 Nov 2016 23:54:50 +0000 (23:54 +0000)]
Clean up CGObjCMac's APIs for deriving class references. NFC.
llvm-svn: 288295
Kelvin Li [Wed, 30 Nov 2016 23:51:03 +0000 (23:51 +0000)]
[OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragma
This patch is to implement sema and parsing for 'teams distribute parallel for simd' pragma.
Differential Revision: https://reviews.llvm.org/D27084
llvm-svn: 288294
Matthias Braun [Wed, 30 Nov 2016 23:49:01 +0000 (23:49 +0000)]
Move most EH from MachineModuleInfo to MachineFunction
Most of the exception handling members in MachineModuleInfo is actually
per function data (talks about the "current function") so it is better
to keep it at the function instead of the module.
This is a necessary step to have machine module passes work properly.
Also:
- Rename TidyLandingPads() to tidyLandingPads()
- Use doxygen member groups instead of "//===- EH ---"... so it is clear
where a group ends.
- I had to add an ugly const_cast at two places in the AsmPrinter
because the available MachineFunction pointers are const, but the code
wants to call tidyLandingPads() in between
(markFunctionEnd()/endFunction()).
Differential Revision: https://reviews.llvm.org/D27227
llvm-svn: 288293
Matthias Braun [Wed, 30 Nov 2016 23:48:50 +0000 (23:48 +0000)]
Move VariableDbgInfo from MachineModuleInfo to MachineFunction
VariableDbgInfo is per function data, so it makes sense to have it with
the function instead of the module.
This is a necessary step to have machine module passes work properly.
Differential Revision: https://reviews.llvm.org/D27186
llvm-svn: 288292
Matthias Braun [Wed, 30 Nov 2016 23:48:42 +0000 (23:48 +0000)]
Move FrameInstructions from MachineModuleInfo to MachineFunction
This is per function data so it is better kept at the function instead
of the module.
This is a necessary step to have machine module passes work properly.
Differential Revision: https://reviews.llvm.org/D27185
llvm-svn: 288291
Matthias Braun [Wed, 30 Nov 2016 23:48:26 +0000 (23:48 +0000)]
MCStreamer: Use "cfi" for CFI related temp labels.
Choosing a "cfi" name makes the intend a bit clearer in an assembly dump
and more importantly the assembly dumps are slightly more stable as the
numbers don't move around anymore when unrelated code calls
createTempSymbol() more or less often.
As they are temp labels the name doesn't influence the generated object
code.
Differential Revision: https://reviews.llvm.org/D27244
llvm-svn: 288290
John McCall [Wed, 30 Nov 2016 23:25:13 +0000 (23:25 +0000)]
Introduce a type-safe enum for ForDefinition.
llvm-svn: 288289
Peter Collingbourne [Wed, 30 Nov 2016 23:19:05 +0000 (23:19 +0000)]
llvm-lto2: Simpler workaround for PR30396.
Maintain the command line resolutions as a map to a list of resolutions
rather than a single resolution, and apply the resolutions in the order
observed. This is not only simpler but allows us to test the scenario where
the two symbols have different resolutions.
Differential Revision: https://reviews.llvm.org/D27285
llvm-svn: 288288
John McCall [Wed, 30 Nov 2016 23:15:55 +0000 (23:15 +0000)]
Fix some layering violations where CGObjCMac's NSString emission was
performed at the CodeGenModule level.
Would be NFC except we now also use a different uniquing structure so
that we don't get spurious conflicts if you ask for both an NSString
and a CFString for the same content (which is possible with builtins).
llvm-svn: 288287
Paul Robinson [Wed, 30 Nov 2016 23:14:27 +0000 (23:14 +0000)]
[PS4] Tighten up a triple check.
llvm-svn: 288286
Eugene Zelenko [Wed, 30 Nov 2016 23:10:42 +0000 (23:10 +0000)]
Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 288285
Jason Molenda [Wed, 30 Nov 2016 23:00:52 +0000 (23:00 +0000)]
Add another address to look for the kernel load addr in
DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints
on 32-bit devices.
<rdar://problem/
29423290>
llvm-svn: 288284
Paul Robinson [Wed, 30 Nov 2016 22:49:55 +0000 (22:49 +0000)]
Recommit r288212: Emit 'no line' information for interesting 'orphan' instructions.
The LLDB tests are now ready for this patch.
DWARF specifies that "line 0" really means "no appropriate source
location" in the line table. Use this for branch targets and some
other cases that have no specified source location, to prevent
inheriting unfortunate line numbers from physically preceding
instructions (which might be from completely unrelated source).
Differential Revision: http://reviews.llvm.org/D24180
llvm-svn: 288283
Paul Robinson [Wed, 30 Nov 2016 22:47:25 +0000 (22:47 +0000)]
PR31214: Make a test tolerate "line 0" when stepping by instruction.
Differential Revision: http://reviews.llvm.org/D27282
llvm-svn: 288282
Kostya Serebryany [Wed, 30 Nov 2016 22:39:35 +0000 (22:39 +0000)]
[libFuzzer] extend -rss_limit_mb to crash instantly on a single malloc that exceeds the limit
llvm-svn: 288281
David Callahan [Wed, 30 Nov 2016 22:32:58 +0000 (22:32 +0000)]
Only computeRelativePath() on new members
Summary:
When using thin archives, and processing the same archive multiple times, we were mangling existing entries. The root cause is that we were calling computeRelativePath() more than once. Here, we only call it when adding new members to an archive.
Note that D27218 changes the way thin archives are printed, and will break the new unit test included here. Depending on which one lands first, the other will need to be slightly modified.
Reviewers: rafael, davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27217
llvm-svn: 288280
Joel Jones [Wed, 30 Nov 2016 22:25:24 +0000 (22:25 +0000)]
[AArch64] Refactor LSE support as feature separate from V8.1a support.
Summary:
This is preparation for ThunderX processors that have Large
System Extension (LSE) atomic instructions, but not the
other instructions introduced by V8.1a.
This will mimic changes to GCC as described here:
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00388.html
LSE instructions are: LD/ST<op>, CAS*, SWP
Reviewers: t.p.northover, echristo, jmolloy, rengolin
Subscribers: aemerson, mehdi_amini
Differential Revision: https://reviews.llvm.org/D26621
llvm-svn: 288279
Evgeny Stupachenko [Wed, 30 Nov 2016 22:23:51 +0000 (22:23 +0000)]
Fix LSR best register search algorithm.
Summary:
Fix a case when first register in a search has maximum
RegUses.getUsedByIndices(Reg).count()
Reviewers: qcolombet
Differential Revision: http://reviews.llvm.org/D26877
From: Evgeny Stupachenko <evstupac@gmail.com>
llvm-svn: 288278
Matthias Braun [Wed, 30 Nov 2016 22:17:10 +0000 (22:17 +0000)]
Clarify rules for reserved regs, fix aarch64 ones.
No test case necessary as the problematic condition is checked with the
newly introduced assertAllSuperRegsMarked() function.
Differential Revision: https://reviews.llvm.org/D26648
llvm-svn: 288277
Kostya Serebryany [Wed, 30 Nov 2016 21:53:32 +0000 (21:53 +0000)]
[libFuzzer] extend -print_coverage to print the comma-separated list of covered dirs. Note: the Windows stub for DirName is left unimplemented
llvm-svn: 288276
Zachary Turner [Wed, 30 Nov 2016 21:44:26 +0000 (21:44 +0000)]
[LibFuzzer] Add Windows implementations of some IO functions.
This patch moves some posix specific file i/o code into a new
file, FuzzerIOPosix.cpp, and provides implementations for these
functions on Windows in FuzzerIOWindows.cpp. This is another
incremental step towards getting libfuzzer working on Windows,
although it still should not be expected to be fully working.
Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27233
llvm-svn: 288275
Michael Kuperstein [Wed, 30 Nov 2016 21:13:57 +0000 (21:13 +0000)]
[LoopUnroll] Implement profile-based loop peeling
This implements PGO-driven loop peeling.
The basic idea is that when the average dynamic trip-count of a loop is known,
based on PGO, to be low, we can expect a performance win by peeling off the
first several iterations of that loop.
Unlike unrolling based on a known trip count, or a trip count multiple, this
doesn't save us the conditional check and branch on each iteration. However,
it does allow us to simplify the straight-line code we get (constant-folding,
etc.). This is important given that we know that we will usually only hit this
code, and not the actual loop.
This is currently disabled by default.
Differential Revision: https://reviews.llvm.org/D25963
llvm-svn: 288274
Sanjay Patel [Wed, 30 Nov 2016 20:48:54 +0000 (20:48 +0000)]
[InstCombine] allow more narrowing transforms for logic ops
We had a limited version of this for scalar 'and'; this expands
the transform to 'or' and 'xor' and allows vectors types too.
llvm-svn: 288273
John McCall [Wed, 30 Nov 2016 20:46:55 +0000 (20:46 +0000)]
Prospective MSVC workaround.
llvm-svn: 288272
Evgeniy Stepanov [Wed, 30 Nov 2016 20:41:59 +0000 (20:41 +0000)]
Release memory to OS only when the requested range covers the entire page
Summary:
The current code was sometimes attempting to release huge chunks of
memory due to undesired RoundUp/RoundDown interaction when the requested
range is fully contained within one memory page.
Reviewers: eugenis
Subscribers: kubabrecka, llvm-commits
Patch by Aleksey Shlyapnikov.
Differential Revision: https://reviews.llvm.org/D27228
llvm-svn: 288271
Sanjay Patel [Wed, 30 Nov 2016 20:20:49 +0000 (20:20 +0000)]
[InstCombine] add tests to show potentially missed logic+trunc transforms; NFC
llvm-svn: 288270
John McCall [Wed, 30 Nov 2016 20:19:46 +0000 (20:19 +0000)]
Finish adopting ConstantInitBuilder in CGObjCGNU. NFC.
llvm-svn: 288269
Quentin Colombet [Wed, 30 Nov 2016 19:55:49 +0000 (19:55 +0000)]
CODE_OWNERS: Take ownership of Loop Strenght Reduce.
llvm-svn: 288268
Akira Hatanaka [Wed, 30 Nov 2016 19:42:03 +0000 (19:42 +0000)]
[Sema] Teach -Wcast-align to look at the aligned attribute of the
declared variables.
Teach Sema to check the aligned attribute attached to variable
declarations so that it doesn't issue spurious warnings.
rdar://problem/
26517471
Differential revision: https://reviews.llvm.org/D21099
llvm-svn: 288267
Mehdi Amini [Wed, 30 Nov 2016 19:12:53 +0000 (19:12 +0000)]
[git-llvm] Use --force-interactive when commiting to enable SVN to prompt password
When svn does not know the password and it has to prompt, it needs to query.
However it won't when invoked from the Python script and instead fails with:
svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option
Differential Revision: https://reviews.llvm.org/D27274
llvm-svn: 288266
Mehdi Amini [Wed, 30 Nov 2016 19:08:41 +0000 (19:08 +0000)]
Fix macro check for ABI breacking check: should use #if instead of #ifndef
llvm-svn: 288265
Zachary Turner [Wed, 30 Nov 2016 19:06:14 +0000 (19:06 +0000)]
[LibFuzzer] Split up some functions among different headers.
In an effort to get libfuzzer working on Windows, we need to make
a distinction between what functions require platform specific
code (e.g. different code on Windows vs Linux) and what code
doesn't. IO functions, for example, tend to be platform
specific.
This patch separates out some of the functions which will need
to have platform specific implementations into different headers,
so that we can then provide different implementations for each
platform.
Aside from that, this patch contains no functional change. It
is purely a re-organization.
Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27230
llvm-svn: 288264
Artem Dergachev [Wed, 30 Nov 2016 19:02:44 +0000 (19:02 +0000)]
[analyzer] Construct temporary objects of correct types, destroy them properly.
When constructing a temporary object region, which represents the result of
MaterializeTemporaryExpr, track down the sub-expression for which the temporary
is necessary with a trick similar to the approach used in CodeGen, namely
by using Expr::skipRValueSubobjectAdjustments().
Then, create the temporary object region with type of that sub-expression.
That type would propagate further in a path-sensitive manner.
During destruction of lifetime-extened temporaries, consult the type of
the temporary object region, rather than the type of the lifetime-extending
variable, in order to call the correct destructor (fixes pr17001) and,
at least, not to crash by trying to call a destructor of a plain type
(fixes pr19539).
rdar://problem/
29131302
rdar://problem/
29131576
Differential Revision: https://reviews.llvm.org/D26839
llvm-svn: 288263
Matt Arsenault [Wed, 30 Nov 2016 18:50:26 +0000 (18:50 +0000)]
AMDGPU: Move mir tests into mir test directory
llvm-svn: 288262
Sanjay Patel [Wed, 30 Nov 2016 18:49:56 +0000 (18:49 +0000)]
[InstCombine] update test to use FileCheck and auto-generate checks; NFC
llvm-svn: 288261
Artem Dergachev [Wed, 30 Nov 2016 18:26:43 +0000 (18:26 +0000)]
[analyzer] SValExplainer: Support ObjC ivars and __block variables.
Additionally, explain the difference between normal and heap-based
symbolic regions.
llvm-svn: 288260
Simon Pilgrim [Wed, 30 Nov 2016 18:15:10 +0000 (18:15 +0000)]
[X86][SSE] Added tests showing missed combines of ANDs with shuffles.
llvm-svn: 288259
Jonas Devlieghere [Wed, 30 Nov 2016 18:06:42 +0000 (18:06 +0000)]
[clang-tidy] Make format style customizable
Summary: I came across an outstanding FIXME to make the format style customizable. Inspired by the include fixer, I added an new option `-style` to configure the fallback style in case no clang-format configuration file is found. The default remains "llvm".
Reviewers: Prazek, aaron.ballman, hokein, alexfh
Subscribers: cfe-commits, malcolm.parsons
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D27142
llvm-svn: 288258
Artem Dergachev [Wed, 30 Nov 2016 17:57:18 +0000 (17:57 +0000)]
[analyzer] Minor fixes and improvements to debug.ExprInspection
- Fix the bug with transition handling in ExprInspectionChecker's
checkDeadSymbols implementation.
- Test this bug by adding a new function clang_analyzer_numTimesReached() to
catch number of passes through the code, which should be handy for testing
against unintended state splits.
- Add two more functions should help debugging issues quickly without running
the debugger or dumping exploded graphs - clang_analyzer_dump() which dump()s
an SVal argument to a warning message, and clang_analyzer_printState(), which
dump()s the current program state to stderr.
Differential Revision: https://reviews.llvm.org/D26835
llvm-svn: 288257
Eugene Zelenko [Wed, 30 Nov 2016 17:48:10 +0000 (17:48 +0000)]
Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).
This preparation to remove SetVector.h dependency on SmallSet.h.
llvm-svn: 288256
Kostya Kortchinsky [Wed, 30 Nov 2016 17:32:20 +0000 (17:32 +0000)]
[scudo] 32-bit and hardware agnostic support
Summary:
This update introduces i386 support for the Scudo Hardened Allocator, and
offers software alternatives for functions that used to require hardware
specific instruction sets. This should make porting to new architectures
easier.
Among the changes:
- The chunk header has been changed to accomodate the size limitations
encountered on 32-bit architectures. We now fit everything in 64-bit. This
was achieved by storing the amount of unused bytes in an allocation rather
than the size itself, as one can be deduced from the other with the help
of the GetActuallyAllocatedSize function. As it turns out, this header can
be used for both 64 and 32 bit, and as such we dropped the requirement for
the 128-bit compare and exchange instruction support (cmpxchg16b).
- Add 32-bit support for the checksum and the PRNG functions: if the SSE 4.2
instruction set is supported, use the 32-bit CRC32 instruction, and in the
XorShift128, use a 32-bit based state instead of 64-bit.
- Add software support for CRC32: if SSE 4.2 is not supported, fallback on a
software implementation.
- Modify tests that were not 32-bit compliant, and expand them to cover more
allocation and alignment sizes. The random shuffle test has been deactivated
for linux-i386 & linux-i686 as the 32-bit sanitizer allocator doesn't
currently randomize chunks.
Reviewers: alekseyshl, kcc
Subscribers: filcab, llvm-commits, tberghammer, danalbert, srhines, mgorny, modocache
Differential Revision: https://reviews.llvm.org/D26358
llvm-svn: 288255
Sanjay Patel [Wed, 30 Nov 2016 17:07:21 +0000 (17:07 +0000)]
[InstCombine] auto-generate checks for select+bitwise logic tests; NFC
llvm-svn: 288254
Silviu Baranga [Wed, 30 Nov 2016 17:04:22 +0000 (17:04 +0000)]
[AArch64] Fix useful bits detection for BFM instructions
Summary:
When computing useful bits for a BFM instruction, we need
to take into consideration the case where both operands
of the BFM are equal and provide data that we need to track.
Not doing this can cause us to miss useful bits.
Fixes PR31138 (https://llvm.org/bugs/show_bug.cgi?id=31138)
Reviewers: t.p.northover, jmolloy
Subscribers: evandro, gberry, srhines, pirama, mcrosier, aemerson, llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D27130
llvm-svn: 288253
Derek Schuff [Wed, 30 Nov 2016 16:49:11 +0000 (16:49 +0000)]
[WebAssembly] Add llvm-objdump support for wasm file format
This is the first part of an effort to add wasm binary
support across all llvm tools.
Patch by Sam Clegg
Differential Revision: https://reviews.llvm.org/D26172
llvm-svn: 288251
Simon Pilgrim [Wed, 30 Nov 2016 16:33:46 +0000 (16:33 +0000)]
[X86][SSE] Add support for target shuffle constant folding
Initial support for target shuffle constant folding in cases where all shuffle inputs are constant. We may be able to relax this and merge shuffles with only some constant inputs in the future.
I've added the helper function getTargetConstantBitsFromNode (based off a similar function in X86ShuffleDecodeConstantPool.cpp) that could be reused for other cases requiring constant vector extraction.
Differential Revision: https://reviews.llvm.org/D27220
llvm-svn: 288250
Zachary Turner [Wed, 30 Nov 2016 16:32:54 +0000 (16:32 +0000)]
[LibFuzzer] Add macro flags for Posix and Windows.
This is the beginning of an effort to get libfuzzer working on
Windows. This is a NFC to just add some macros for platform
detection on Windows.
Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27229
llvm-svn: 288249
Nicolai Haehnle [Wed, 30 Nov 2016 16:26:33 +0000 (16:26 +0000)]
[SelectionDAG] Refactor TargetLowering::expandMUL (NFC)
Summary: Further preparation for the expansion of MUL_LOHI added in D24956.
Reviewers: efriedma, RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27064
llvm-svn: 288248
Pavel Labath [Wed, 30 Nov 2016 16:08:45 +0000 (16:08 +0000)]
Fix handling of consecutive slashes in FileSpec::GetNormalizedPath()
The core of the function was actually handling them correctly. However, the
early exit was being too optimistic and did not give the function a chance to
fire if the path did not contain dots as well.
Fix that and add a couple of unit tests.
llvm-svn: 288247
Pavel Labath [Wed, 30 Nov 2016 15:34:29 +0000 (15:34 +0000)]
[Support] Use HAVE_DLOPEN to guard dlopen(3) usage
Summary:
The usage was previously guarded by HAVE_DLFCN. This breaks on Android with
LLVM_BUILD_STATIC as the platform does not provide a static version of libdl.
Using HAVE_DLOPEN fixes it as the code will only get used if we are actually able
to link an executable using dlopen.
Reviewers: rafael, beanz
Subscribers: tberghammer, danalbert, llvm-commits
Differential Revision: https://reviews.llvm.org/D26504
llvm-svn: 288246
Sanjay Patel [Wed, 30 Nov 2016 15:00:43 +0000 (15:00 +0000)]
[AArch64] use exact checks; NFC
llvm-svn: 288245
Benjamin Kramer [Wed, 30 Nov 2016 14:37:40 +0000 (14:37 +0000)]
[include-fixer] Don't skip repeated lookups in plugin mode.
In this mode not all the errors are fixed so it doesn't make sense to
ignore later ones.
llvm-svn: 288244
Krzysztof Parzyszek [Wed, 30 Nov 2016 13:31:09 +0000 (13:31 +0000)]
[PowerPC] Preserve machine dominator tree in PPCVSXFMAMutate
It is needed by LiveIntervalAnalysis.
llvm-svn: 288243
Simon Pilgrim [Wed, 30 Nov 2016 13:21:12 +0000 (13:21 +0000)]
Updated test with -verify-machineinstrs to check for PR21931
llvm-svn: 288242
Pavel Labath [Wed, 30 Nov 2016 11:56:32 +0000 (11:56 +0000)]
Convert most of the Process class to Timeout<>
This changes most of the class to use the new Timeout class. The one function
left is RunThreadPlan, which I left for a separate change as the function is
massive. A couple of things to call out:
- I've renamed the affected functions to match the listener interface names. This
should also help catch any places I did not convert at compile time.
- I've deleted the WaitForState function as it was unused.
llvm-svn: 288241