Haicheng Wu [Wed, 6 Apr 2016 20:38:20 +0000 (20:38 +0000)]
[MBP] Remove an unused function parameter
NFC.
llvm-svn: 265596
Sean Silva [Wed, 6 Apr 2016 20:19:31 +0000 (20:19 +0000)]
Use `CMAKE_HOST_UNIX` to check the host.
`UNIX` is for the target.
llvm-svn: 265595
Richard Smith [Wed, 6 Apr 2016 20:12:34 +0000 (20:12 +0000)]
Minor simplifications.
llvm-svn: 265594
Ehsan Amiri [Wed, 6 Apr 2016 20:12:29 +0000 (20:12 +0000)]
[PPC] Use VSX/FP Facility integer load when an integer load's only users are conversion to FP
http://reviews.llvm.org/D18405
When the integer value loaded is never used directly as integer we should use VSX
or Floating Point Facility integer loads and avoid extra direct move
llvm-svn: 265593
Tim Northover [Wed, 6 Apr 2016 19:58:07 +0000 (19:58 +0000)]
Restore slightly less dodgy diagnostic handler for inline asm
Turns out it was there mostly to prevent Clang asking people to report a bug.
This time we report something to Clang's real diagnostics handler so that it
exits with something approximating a real error and tidies up after itself.
llvm-svn: 265592
Sanjay Patel [Wed, 6 Apr 2016 19:58:06 +0000 (19:58 +0000)]
regenerate checks
llvm-svn: 265591
James Y Knight [Wed, 6 Apr 2016 19:52:32 +0000 (19:52 +0000)]
Put quotes around #error string.
GCC reports "missing terminating ' character", even when it's being
skipped by preprocessing.
llvm-svn: 265590
Nicolai Haehnle [Wed, 6 Apr 2016 19:40:20 +0000 (19:40 +0000)]
AMDGPU: Add a shader calling convention
This makes it possible to distinguish between mesa shaders
and other kernels even in the presence of compute shaders.
Patch By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Differential Revision: http://reviews.llvm.org/D18559
llvm-svn: 265589
Rafael Espindola [Wed, 6 Apr 2016 19:38:26 +0000 (19:38 +0000)]
Make this test a bit stronger.
Show that in addition to handling empty .eh_frame, it is merged with any
regular .eh_frame.
llvm-svn: 265588
Quentin Colombet [Wed, 6 Apr 2016 19:04:58 +0000 (19:04 +0000)]
Revert "[RegisterBankInfo] Add methods to get the possible mapping of an
instruction on a register bank. This will be used by the register bank select
pass to assign register banks for generic virtual registers." and the follow-on
commits while I find out a way to fix the win7 bot:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/19882
This reverts commit r265578, r265581, r265584, and r265585.
llvm-svn: 265587
Davide Italiano [Wed, 6 Apr 2016 18:46:39 +0000 (18:46 +0000)]
[IRVerifier] Don't crash on invalid DIFile inside DISubprogram.
r265515, this time with the correct fix. file inside DISubprogram is not
mandatory.
llvm-svn: 265586
Quentin Colombet [Wed, 6 Apr 2016 18:43:46 +0000 (18:43 +0000)]
[RegisterBankInfo] Get rid of the assert in the constructor of InstructionMapping.
The default constructor now uses the regular constructor and the assert
is not valid anymore.
llvm-svn: 265585
Quentin Colombet [Wed, 6 Apr 2016 18:37:44 +0000 (18:37 +0000)]
[RegisterBankInfo] Call the other constructor of InstructionMapping from the
default constructor, instead of relying on the default constructor of
unique_ptr.
Second attempt at fixing the windows bot.
llvm-svn: 265584
Evgeniy Stepanov [Wed, 6 Apr 2016 18:32:13 +0000 (18:32 +0000)]
[gold] Save bitcode for module partitions (save-temps + split codegen).
llvm-svn: 265583
Quentin Colombet [Wed, 6 Apr 2016 18:24:34 +0000 (18:24 +0000)]
[RegisterBankInfo] Provide a default constructor for InstructionMapping
helper class.
The default constructor creates invalid (isValid() == false) instances
and may be used to communicate that a mapping was not found.
llvm-svn: 265581
Ed Schouten [Wed, 6 Apr 2016 18:21:07 +0000 (18:21 +0000)]
Sort relocations by name and size.
Approved by: ruiu
Differential Revision: http://reviews.llvm.org/D18835
llvm-svn: 265580
Davide Italiano [Wed, 6 Apr 2016 18:13:44 +0000 (18:13 +0000)]
[IRVerifier] Prefer dyn_cast<> over isa<> + cast<>.
Thanks to Rafael for the suggestion!
llvm-svn: 265579
Quentin Colombet [Wed, 6 Apr 2016 18:04:35 +0000 (18:04 +0000)]
[RegisterBankInfo] Add an helper function to get the size of a register.
The previous method to get the size was too simple and could fail for
physical registers.
llvm-svn: 265578
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 17:56:08 +0000 (17:56 +0000)]
IR: Use DenseSet instead of DenseMap for ConstantUniqueMap; NFC
Use a DenseSet instead of a DenseMap for constants in LLVMContextImpl.
Last time I looked at this was some time before r223588, when
DenseSet<V> had no advantage over DenseMap<V,char>. After r223588,
there's a 50% memory savings.
This is all mechanical. There were little bits of missing API from
DenseSet so I added the trivial implementations:
- iterator::operator++(int)
- template <class LookupKeyT> insert_as(ValueTy, LookupKeyT)
There should be no functionality change, just reduced memory consumption
(this wasn't on a profile or anything; just a cleanup I stumbled on).
llvm-svn: 265577
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 17:56:05 +0000 (17:56 +0000)]
IR: Stop explicitly clearing the MDStringCache
The MDStringCache doesn't need to be explicitly cleared before
destruction. The destructor handles it at least as efficiently.
llvm-svn: 265576
Ed Schouten [Wed, 6 Apr 2016 17:53:31 +0000 (17:53 +0000)]
Make TLS work for PIE executables on aarch64.
Similar to r265462, TLS related relocations aren't marked as relative,
meaning that we end up generating R_AARCH64_RELATIVE relocations for
them. This change adds TLS relocations that I've seen on my system. With
this patch applied CloudABI's unit testing binary now passes on aarch64.
Approved by: ruiu
Differential Revision: http://reviews.llvm.org/D18816
llvm-svn: 265575
Quentin Colombet [Wed, 6 Apr 2016 17:51:41 +0000 (17:51 +0000)]
[RegisterBankInfo] Add a method to get the mapping RegClass -> RegBank.
This should be TableGen'ed at some point.
llvm-svn: 265574
Quentin Colombet [Wed, 6 Apr 2016 17:45:40 +0000 (17:45 +0000)]
[RegisterBankInfo] Add methods to get the possible mapping of an instruction on a register bank.
This will be used by the register bank select pass to assign register banks
for generic virtual registers.
llvm-svn: 265573
Saleem Abdulrasool [Wed, 6 Apr 2016 17:42:16 +0000 (17:42 +0000)]
vim: add missing keyword
`source_filename` was introduced as a keyword in SVN r264884, but the syntax
file was not updated.
llvm-svn: 265572
Richard Smith [Wed, 6 Apr 2016 17:38:58 +0000 (17:38 +0000)]
Diagnose template alias declarations in local classes.
Patch by Erik Pilkington!
llvm-svn: 265571
Quentin Colombet [Wed, 6 Apr 2016 17:38:12 +0000 (17:38 +0000)]
[AArch64] Change the CMake to avoid to build GlobalISel related APIs
when GISel is not built.
The positive side effects are:
- We do not have to define dummy implementation
- We do not have to do weird gymnastic to avoid like issues (like
missing constructor or vtable for the base classes)
llvm-svn: 265570
JF Bastien [Wed, 6 Apr 2016 17:26:42 +0000 (17:26 +0000)]
NFC: make AtomicOrdering an enum class
Summary: See LLVM change D18775 for details, this change depends on it.
Reviewers: jyknight, reames
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18776
llvm-svn: 265569
Quentin Colombet [Wed, 6 Apr 2016 17:26:03 +0000 (17:26 +0000)]
[AArch64] Teach the subtarget how to get to the RegisterBankInfo.
Rework the access to GlobalISel APIs to contain how much of
the APIs we need to access for the final executable to build when
GlobalISel is not built.
This prevents massive usage of ifdefs in various places. Now, all the
GlobalISel ifdefs will be happing only in AArch64TargetMachine.cpp.
llvm-svn: 265567
Lang Hames [Wed, 6 Apr 2016 17:18:55 +0000 (17:18 +0000)]
[lld][MachO] Clean up some unnecessarily verbose code. NFC.
Suggested by Dave Blaikie in review of r265447. Thanks Dave!
llvm-svn: 265566
Quentin Colombet [Wed, 6 Apr 2016 17:09:34 +0000 (17:09 +0000)]
[RegisterBankInfo] Make the destructor public... that may be useful!
llvm-svn: 265565
Richard Smith [Wed, 6 Apr 2016 17:06:00 +0000 (17:06 +0000)]
Re-commit r265518 ("[modules] Continue factoring encoding of AST records out of
ASTWriter."), reverted in r265526, with a fix for an iterator invalidation bug
(thanks, MSan!).
llvm-svn: 265564
Quentin Colombet [Wed, 6 Apr 2016 17:01:43 +0000 (17:01 +0000)]
[RegisterBankInfo] Implement the verify method of the InstructionMapping helper class.
This checks that all the register operands get a proper mapping.
llvm-svn: 265563
Fiona Glaser [Wed, 6 Apr 2016 16:57:25 +0000 (16:57 +0000)]
Loop Unroll: add options and tweak to make Partial unrolling more useful
1. Add FullUnrollMaxCount option that works like MaxCount, but also limits
the unroll count for fully unrolled loops. So if a loop has an iteration
count over this, it won't fully unroll.
2. Add CLI options for MaxCount and the new option, so they can be tested
(plus a test).
3. Make partial unrolling obey MaxCount.
An example use-case (the out of tree one this is originally designed for) is
a target’s TTI can analyze a loop and decide on a max unroll count separate
from the size threshold, e.g. based on register pressure, then constrain
LoopUnroll to not exceed that, regardless of the size of the unrolled loop.
llvm-svn: 265562
Quentin Colombet [Wed, 6 Apr 2016 16:51:04 +0000 (16:51 +0000)]
[MachineRegisterInfo] Document what is the expected metric for the size of generic registers
llvm-svn: 265561
Pavel Labath [Wed, 6 Apr 2016 16:49:13 +0000 (16:49 +0000)]
Reduce code duplication in ProcessGDBRemote
Summary:
SetThreadStopInfo was checking for a breakpoint at the current PC several times. This merges the
identical code into a separate function. I've left one breakpoint check alone, as it was doing
more complicated stuff, and it did not see a way to merge that without making the interface
complicated. NFC.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D18819
llvm-svn: 265560
Hans Wennborg [Wed, 6 Apr 2016 16:44:38 +0000 (16:44 +0000)]
Revert r265450 "[X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC."
It caused ASan 32-bit tests to hang (PR27245).
llvm-svn: 265559
Fiona Glaser [Wed, 6 Apr 2016 16:43:45 +0000 (16:43 +0000)]
LoopUnroll: only allow non-modulo Partial unrolling when Runtime=true
Patch by Evgeny Stupachenko <evstupac@gmail.com>.
llvm-svn: 265558
Daniel Jasper [Wed, 6 Apr 2016 16:41:39 +0000 (16:41 +0000)]
clang-format: Fix label-in-if statement in macros where it is actually used.
Before:
#define A \
if (a) \
label: \
f()
After:
#define A \
if (a) \
label: \
f()
llvm-svn: 265557
Quentin Colombet [Wed, 6 Apr 2016 16:40:23 +0000 (16:40 +0000)]
[RegisterBankInfo] Implement the verify method for the ValueMapping helper class.
The method checks that the value is fully defined accross the different partial
mappings and that the partial mappings are compatible between each other.
llvm-svn: 265556
Quentin Colombet [Wed, 6 Apr 2016 16:33:26 +0000 (16:33 +0000)]
[RegisterBankInfo] Add a verify method for the PartialMapping helper class.
This verifies that the PartialMapping can be accomadated into the related
register bank.
llvm-svn: 265555
Valery Pykhtin [Wed, 6 Apr 2016 16:30:21 +0000 (16:30 +0000)]
Revert "[AMDGPU] llvm-objdump: Minimal HSA Code Object disassembler support."
This reverts commit r265550. There're problems with endianness on dumping instruction bytes. Need to find out how to use support::ulittle32_t type properly.
llvm-svn: 265554
Quentin Colombet [Wed, 6 Apr 2016 16:27:01 +0000 (16:27 +0000)]
[RegisterBankInfo] Add a couple of helper classes for the future cost model.
llvm-svn: 265553
Hans Wennborg [Wed, 6 Apr 2016 16:10:20 +0000 (16:10 +0000)]
Revert "Re-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)""
It seems to be causing ASan tests to crash, probably due to
miscompiling the run-time somehow.
llvm-svn: 265551
Valery Pykhtin [Wed, 6 Apr 2016 15:55:10 +0000 (15:55 +0000)]
[AMDGPU] llvm-objdump: Minimal HSA Code Object disassembler support.
Differential revision: http://reviews.llvm.org/D16998
llvm-svn: 265550
Quentin Colombet [Wed, 6 Apr 2016 15:53:13 +0000 (15:53 +0000)]
[AArch64] Use the default constructor of RegisterBankInfo when GlobalISel is not built.
This will avoid link-time error as the defautl constructor of RegisterBankInfo is
the only one available when GlobalISel is not built.
llvm-svn: 265549
Quentin Colombet [Wed, 6 Apr 2016 15:47:17 +0000 (15:47 +0000)]
[RegisterBankInfo] Inline the destructor to avoid link-time error when GlobalISel is not built.
llvm-svn: 265548
Wei Mi [Wed, 6 Apr 2016 15:41:07 +0000 (15:41 +0000)]
Recommit r265309 after fixed an invalid memory reference bug happened
when DenseMap growed and moved memory. I verified it fixed the bootstrap
problem on x86_64-linux-gnu but I cannot verify whether it fixes
the bootstrap error on clang-ppc64be-linux. I will watch the build-bot
result closely.
Replace analyzeSiblingValues with new algorithm to fix its compile
time issue. The patch is to solve PR17409 and its duplicates.
analyzeSiblingValues is a N x N complexity algorithm where N is
the number of siblings generated by reg splitting. Although it
causes siginificant compile time issue when N is large, it is also
important for performance since it removes redundent spills and
enables rematerialization.
To solve the compile time issue, the patch removes analyzeSiblingValues
and replaces it with lower cost alternatives containing two parts. The
first part creates a new spill hoisting method in postOptimization of
register allocation. It does spill hoisting at once after all the spills
are generated instead of inside every instance of selectOrSplit. The
second part queries the define expr of the original register for
rematerializaiton and keep it always available during register allocation
even if it is already dead. It deletes those dead instructions only in
postOptimization. With the two parts in the patch, it can remove
analyzeSiblingValues without sacrificing performance.
Differential Revision: http://reviews.llvm.org/D15302
llvm-svn: 265547
Ed Schouten [Wed, 6 Apr 2016 15:37:06 +0000 (15:37 +0000)]
Enable PIE for CloudABI.
As we're currently working on making CloudABI executables easier to
emulate in userspace (e.g., on OS X and Windows), it makes a whole lot
of sense to build these using PIE. By using PIE, they can simply be
loaded into the existing process address space without clashes.
PIE support got added to CloudABI's C library and seems to work pretty
well. CloudABI does not make use of an ld.so, so the binary's _start()
has all the logic in it to do the relocations.
Now that all but one bug in LLD relating to PIE support have been
squashed (and a patch for that is already in code review), I'd like to
go ahead and force the use of PIE for Clang 3.9. When released, we'll
also switch over to using LLD exclusively.
llvm-svn: 265546
Daniel Jasper [Wed, 6 Apr 2016 15:02:46 +0000 (15:02 +0000)]
clang-format: Support labels in brace-less ifs.
While I am not personally convinced about the usefulness of this
construct, we should break it.
Before:
if (a) label:
f();
After:
if (a)
label:
f();
llvm-svn: 265545
Gabor Horvath [Wed, 6 Apr 2016 14:49:15 +0000 (14:49 +0000)]
[clang-tidy] Assertion fix in misc-misplaced-widening-cast check.
llvm-svn: 265544
Rafael Espindola [Wed, 6 Apr 2016 14:31:03 +0000 (14:31 +0000)]
Use a bit in SymbolBody to store CanKeepUndefined.
UndefinedElf for 64 bits goes from 72 to 64 bytes.
llvm-svn: 265543
Etienne Bergeron [Wed, 6 Apr 2016 14:07:51 +0000 (14:07 +0000)]
[clang-tidy] filter plugins and plugin arguments of the command-line
Summary:
This patch remove the plugin argument from the command-line.
Loading plugins was making clang-tidy to fail when running over chromium (linux).
Example of a command-line executed when running clang-tidy over chromium (from the compilation database).
```
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/WebKit/Source/core/fetch/webcore_shared.Resource.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=264915-1 -DCOMPONENT_BUILD -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DENABLE_TOPCHROME_MD=1 -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBLINK_CORE_IMPLEMENTATION=1 -DBLINK_IMPLEMENTATION=1 -DINSIDE_BLINK -DGL_GLEXT_PROTOTYPES -DMOJO_USE_SYSTEM_IMPL -DCHROME_PNG_WRITE_SUPPORT -DPNG_USER_CONFIG -DENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0 -DENABLE_OILPAN=1 -DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1 -DENABLE_INPUT_MULTIPLE_FIELDS_UI=1 -DWTF_USE_ICCJPEG=1 -DWTF_USE_QCMSLIB=1 -DWTF_USE_WEBAUDIO_FFMPEG=1 -DWTF_USE_DEFAULT_RENDER_THEME=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_NOEXCEPT= -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_SUPPORT_GPU=1 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DLIBXML_STATIC -DLIBXSLT_STATIC -DV8_SHARED -DUSING_V8_SHARED -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_NSS_VERIFIER=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -D_GLIBCXX_DEBUG=1 -Igen -I../../third_party/WebKit/Source -Igen/blink -I../../third_party/WebKit -I../../third_party/WebKit/Source/core/testing -I../../third_party/WebKit/Source/core/testing/v8 -I../.. -I../../skia/config -I../../third_party/khronos -I../../gpu -Igen/angle -I../../third_party/angle/include -I../../third_party/ffmpeg -Igen/third_party/WebKit -I../../third_party/iccjpeg -I../../third_party/libpng -I../../third_party/libwebp -I../../third_party/ots/include -I../../third_party/zlib -I../../third_party/libjpeg_turbo -I../../third_party/icu/source/i18n -I../../third_party/icu/source/common -I../../skia/ext -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/pdf -I../../third_party/skia/include/gpu -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/libxml/linux/include -I../../third_party/libxml/src/include -I../../third_party/libxslt -I../../third_party/npapi -I../../third_party/npapi/bindings -I../../third_party/qcms/src -I../../third_party/snappy/linux -I../../third_party/snappy/src -I../../v8/include -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Xclang -load -Xclang /home/etienneb/chromium/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -fcolor-diagnostics -B/home/etienneb/chromium/src/third_party/binutils/Linux_x64/Release/bin -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wglobal-constructors -Wexit-time-destructors -fno-strict-aliasing -Xclang -load -Xclang /home/etienneb/chromium/src/third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.so -Xclang -add-plugin -Xclang blink-gc-plugin -Xclang -plugin-arg-blink-gc-plugin -Xclang enable-oilpan -Xclang -plugin-arg-blink-gc-plugin -Xclang warn-raw-ptr -pthread -I/home/etienneb/chromium/src/build/linux/debian_wheezy_amd64-sysroot/usr/include/glib-2.0 -I/home/etienneb/chromium/src/build/linux/debian_wheezy_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -m64 -march=x86-64 --sysroot=/home/etienneb/chromium/src/build/linux/debian_wheezy_amd64-sysroot -O0 -g -funwind-tables -gsplit-dwarf -g0 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -c ../../third_party/WebKit/Source/core/fetch/Resource.cpp -o obj/third_party/WebKit/Source/core/fetch/webcore_shared.Resource.o
```
The plugins are added with the following arguments:
```
-Xclang -load -Xclang /home/etienneb/chromium/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion
```
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18806
llvm-svn: 265542
Silviu Baranga [Wed, 6 Apr 2016 14:06:32 +0000 (14:06 +0000)]
Revert r265535 until we know how we can fix the bots
llvm-svn: 265541
Daniel Jasper [Wed, 6 Apr 2016 13:58:09 +0000 (13:58 +0000)]
clang-format: Fix incorrect function annotation detection.
Before:
MACRO(
abc).function() // wrap
<< abc;
After:
MACRO(abc).function() // wrap
<< abc;
llvm-svn: 265540
Etienne Bergeron [Wed, 6 Apr 2016 13:57:22 +0000 (13:57 +0000)]
[clang-tidy] fix building clang-tidy documentation.
Summary:
The clang-tidy documentation can't be generated because of broken links.
```
Warning, treated as error:
/home/etienneb/llvm/llvm/tools/clang/tools/extra/docs/clang-tidy/checks/google-readability-function-size.rst:: WARNING: document isn't included in any toctree
```
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18803
llvm-svn: 265539
Sam Kolton [Wed, 6 Apr 2016 13:29:59 +0000 (13:29 +0000)]
[AMDGPU] AsmParser: disable DPP for unsupported instructions. New dpp tests. Fix v_nop_dpp.
Summary:
1. Disable DPP encoding for instructions that do not support it:
- VOP1:
- v_readfirstlane_b32
- v_clrexcp
- v_movreld_b32
- v_movrels_b32
- v_movrelsd_b32
- VOP2:
- v_madmk_f16/32
- v_madak_f16/32
- VOPC, VINTRP, VOP3
2. Fix DPP for v_nop
3. New DPP tests for VOP1 and VOP2 instructions
Reviewers: nhaustov, tstellarAMD, vpykhtin
Subscribers: tstellarAMD, arsenm
Differential Revision: http://reviews.llvm.org/D18552
llvm-svn: 265538
Chad Rosier [Wed, 6 Apr 2016 13:27:13 +0000 (13:27 +0000)]
Simplify logic. NFC.
llvm-svn: 265537
Rafael Espindola [Wed, 6 Apr 2016 13:22:41 +0000 (13:22 +0000)]
Change the type hierarchy for undefined symbols.
We have to differentiate undefined symbols from bitcode and undefined
symbols from other sources.
Undefined symbols from bitcode should not inhibit the symbol being
internalized. Undefined symbols from other sources should.
llvm-svn: 265536
Silviu Baranga [Wed, 6 Apr 2016 13:18:26 +0000 (13:18 +0000)]
[SCEV] Introduce a guarded backedge taken count and use it in LAA and LV
Summary:
When the backedge taken codition is computed from an icmp, SCEV can
deduce the backedge taken count only if one of the sides of the icmp
is an AddRecExpr. However, due to sign/zero extensions, we sometimes
end up with something that is not an AddRecExpr.
However, we can use SCEV predicates to produce a 'guarded' expression.
This change adds a method to SCEV to get this expression, and the
SCEV predicate associated with it.
In HowManyGreaterThans and HowManyLessThans we will now add a SCEV
predicate associated with the guarded backedge taken count when the
analyzed SCEV expression is not an AddRecExpr. Note that we only do
this as an alternative to returning a 'CouldNotCompute'.
We use new feature in Loop Access Analysis and LoopVectorize to analyze
and transform more loops.
Reviewers: anemet, mzolotukhin, hfinkel, sanjoy
Subscribers: flyingforyou, mcrosier, atrick, mssimpso, sanjoy, mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D17201
llvm-svn: 265535
Rafael Espindola [Wed, 6 Apr 2016 12:19:25 +0000 (12:19 +0000)]
Fix use of uninitialized.
The names of undefined locals are not used, so I don't think it is
possible to actually test this.
llvm-svn: 265534
Rafael Espindola [Wed, 6 Apr 2016 12:14:31 +0000 (12:14 +0000)]
Rename a few Visibility arguments to StOther.
llvm-svn: 265533
Gabor Horvath [Wed, 6 Apr 2016 12:04:51 +0000 (12:04 +0000)]
[clang-tidy] Extension of checker misc-misplaced-widening-cast
Summary:
Existing checker misc-misplaced-widening-cast was extended:
- New use cases: casted expression as lhs or rhs of a logical comparison or function argument
- New types: beside int, long and long long various char types, short and int128 added
- New option to check implicit casts: forgetting a cast is at least as common and as dangerous as misplacing it. This option can be disabled.
This patch depends on AST Matcher patches D17986 and D18243 and also contains fix for checker misc-bool-pointer-implicit-conversion needed because of the fix in the AST Matcher patch.
Reviewers: hokein, alexfh
Subscribers: o.gyorgy, xazax.hun, cfe-commits
Differential Revision: http://reviews.llvm.org/D17987
llvm-svn: 265532
Evgeny Astigeevich [Wed, 6 Apr 2016 11:39:00 +0000 (11:39 +0000)]
[AArch64][CodeGen] NFC refactor AArch64InstrInfo::optimizeCompareInstr to prepare it for fixing a bug in it
AArch64InstrInfo::optimizeCompareInstr has a bug which causes generation of incorrect code (PR#27158).
The patch refactors the function to simplify reviewing the fix of the bug.
1. Function name ‘modifiesConditionCode’ is changed to ‘areCFlagsAccessedBetweenInstrs’
to reflect that the function can check modifying accesses, reading accesses or both.
2. Function ‘AArch64InstrInfo::optimizeCompareInstr’
- Documented the function
- Cmp_NZCV is DeadNZCVIdx to reflect that it is an operand index of dead NZCV
- The code for the case of substituting CmpInstr is put into separate
functions the main of them is ‘substituteCmpInstr’.
Differential Revision: http://reviews.llvm.org/D18609
llvm-svn: 265531
Dmitry Polukhin [Wed, 6 Apr 2016 11:38:59 +0000 (11:38 +0000)]
[OPENMP] Parsing and Sema support for 'omp declare target' directive
Add parsing, sema analysis for 'declare target' construct for OpenMP 4.0
(4.5 support will be added in separate patch).
The declare target directive specifies that variables, functions (C, C++
and Fortran), and subroutines (Fortran) are mapped to a device. The declare
target directive is a declarative directive. In Clang declare target is
implemented as implicit attribute for the declaration.
The syntax of the declare target directive is as follows:
#pragma omp declare target
declarations-definition-seq
#pragma omp end declare target
Based on patch from Michael Wong http://reviews.llvm.org/D15321
llvm-svn: 265530
Pavel Labath [Wed, 6 Apr 2016 11:05:30 +0000 (11:05 +0000)]
Fixup TestLinuxCore on windows
test_same_pid_running couldn't delete the temporary files, while we had them open. Deleting the
target should make things work.
llvm-svn: 265529
Chuang-Yu Cheng [Wed, 6 Apr 2016 10:48:36 +0000 (10:48 +0000)]
[ppc64] Temporary disable sibling call optimization on ppc64 due to breaking test case
r265506 breaks print-stack-trace.cc test case of compiler-rt in bootstrap
test.
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/1708
llvm-svn: 265528
Tamas Berghammer [Wed, 6 Apr 2016 10:34:29 +0000 (10:34 +0000)]
Fix and xfail TestRegisterVariables after rL265498
llvm-svn: 265527
Dmitry Polukhin [Wed, 6 Apr 2016 10:01:46 +0000 (10:01 +0000)]
Revert "[modules] Continue factoring encoding of AST records out of ASTWriter."
This reverts commit r265518.
llvm-svn: 265526
Pavel Labath [Wed, 6 Apr 2016 09:10:29 +0000 (09:10 +0000)]
Fix a cornercase in breakpoint reporting
Summary:
This resolves a similar problem as D16720 (which handled the case when we single-step onto a
breakpoint), but this one deals with involutary stops: when we stop a thread (e.g. because
another thread has hit a breakpont and we are doing a full stop), we can end up stopping it right
before it executes a breakpoint instruction. In this case, the stop reason will be empty, but we
will still step over the breakpoint when do the next resume, thereby missing a breakpoint hit.
I have observed this happening in TestConcurrentEvents, but I have no idea how to reproduce this
behavior more reliably.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D18692
llvm-svn: 265525
Pavel Labath [Wed, 6 Apr 2016 08:55:31 +0000 (08:55 +0000)]
Fixup r265398
llvm-svn: 265524
George Rimar [Wed, 6 Apr 2016 08:08:40 +0000 (08:08 +0000)]
[ELF] - Teach linkerscript error handler to show full script line and column marker on error.
When error, this adds the text line of script to the output
and a marks exact incorrect token under it:
line 1: <error text here>
UNKNOWN_TAG {
^
Differential revision: http://reviews.llvm.org/D18699
llvm-svn: 265523
George Rimar [Wed, 6 Apr 2016 07:20:45 +0000 (07:20 +0000)]
[ELF] - Do not handle ELF and program header as dummy sections.
ELF and program header are not part of OutputSections list anymore.
That helps to avoid having and working with functions like dummySectionsNum().
Still keeping them as sections helps to simplify the code.
Differential revision: http://reviews.llvm.org/D18743
llvm-svn: 265522
David Majnemer [Wed, 6 Apr 2016 07:04:53 +0000 (07:04 +0000)]
[SLPVectorizer] Vectorizing the libm sqrt to llvm's sqrt intrinsic requires nnan
To quote the langref "Unlike sqrt in libm, however, llvm.sqrt has
undefined behavior for negative numbers other than -0.0 (which allows
for better optimization, because there is no need to worry about errno
being set). llvm.sqrt(-0.0) is defined to return -0.0 like IEEE sqrt."
This means that it's unsafe to replace sqrt with llvm.sqrt unless the
call is annotated with nnan.
Thanks to Hal Finkel for pointing this out!
llvm-svn: 265521
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 06:41:54 +0000 (06:41 +0000)]
IR: Move MDStrings to a BumpPtrAllocator
We never delete any MDString until the context is destroyed. Might as
well throw them onto a BumpPtrAllocator.
llvm-svn: 265520
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 06:38:15 +0000 (06:38 +0000)]
IRMover: Steal arguments when moving functions, NFC
Instead of copying arguments from the source function to the
destination, steal them. This has a few advantages.
- The ValueMap doesn't need to be seeded with (or cleared of)
Arguments.
- Often the destination function won't have created any arguments yet,
so this avoids malloc traffic.
- Argument names don't need to be copied.
Because argument lists are lazy, this required a new
Function::stealArgumentListFrom helper.
llvm-svn: 265519
Richard Smith [Wed, 6 Apr 2016 06:26:08 +0000 (06:26 +0000)]
[modules] Continue factoring encoding of AST records out of ASTWriter.
llvm-svn: 265518
Davide Italiano [Wed, 6 Apr 2016 04:34:38 +0000 (04:34 +0000)]
Revert "[IRVerifier] Don't crash on invalid DIFile inside DISubprogram."
This reverts commit r265515 as lots of tests need to be fixed before
this actually can go in.
llvm-svn: 265517
Richard Trieu [Wed, 6 Apr 2016 04:22:00 +0000 (04:22 +0000)]
Add parentheses to silence warning.
llvm-svn: 265516
Davide Italiano [Wed, 6 Apr 2016 03:57:47 +0000 (03:57 +0000)]
[IRVerifier] Don't crash on invalid DIFile inside DISubprogram.
llvm-svn: 265515
Davide Italiano [Wed, 6 Apr 2016 03:07:58 +0000 (03:07 +0000)]
[IRVerifier] Avoid crashing on an invalid compile unit.
llvm-svn: 265514
Matthias Braun [Wed, 6 Apr 2016 02:59:44 +0000 (02:59 +0000)]
AArch64: Fix compile error
Fixed to adapt a use of enterBasicBlock() in my last commit (because I
had follow on patches in my repository that change the code).
llvm-svn: 265513
Rui Ueyama [Wed, 6 Apr 2016 02:52:47 +0000 (02:52 +0000)]
Do not allocate MipsReginfo using BumpPtrAllocator.
So that MipsReginfo's destructor will be called.
llvm-svn: 265512
Matthias Braun [Wed, 6 Apr 2016 02:47:09 +0000 (02:47 +0000)]
RegisterScavenger: Take a reference as enterBasicBlock() argument.
Make it obvious that the argument cannot be nullptr.
Remove an unnecessary nullptr check in initRegState.
llvm-svn: 265511
Matthias Braun [Wed, 6 Apr 2016 02:46:35 +0000 (02:46 +0000)]
LivePhysRegs: removeReg() must remove aliased registers
We must remove all aliased registers which may be more than the all sub
and super registers combined.
Bug found while reading the code. The bug does not affect any existing
target as the only use of register aliases I could found were control
registers on ARM and Hexagon which are all reserved.
llvm-svn: 265510
Matthias Braun [Wed, 6 Apr 2016 02:46:04 +0000 (02:46 +0000)]
LivePhysRegs: Remove redundant check
llvm-svn: 265509
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 02:25:12 +0000 (02:25 +0000)]
ValueMapper: Fix delayed blockaddress handling after r265273
r265273 added Mapper::mapBlockAddress, which delays mapping a
blockaddress value until the function has a body. The condition was
backwards, and should be checking Function::empty instead of
GlobalValue::isDeclaration.
llvm-svn: 265508
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 02:06:40 +0000 (02:06 +0000)]
AsmParser: Don't crash on unresolved !tbaa
Instead of crashing, give a nice error. As a drive-by, fix the location
associated with the errors for unresolved metadata (the location was off
by one token).
llvm-svn: 265507
Chuang-Yu Cheng [Wed, 6 Apr 2016 02:04:38 +0000 (02:04 +0000)]
[ppc64] Enable sibling call optimization on ppc64 ELFv1/ELFv2 abi
This patch enable sibling call optimization on ppc64 ELFv1/ELFv2 abi, and
add a couple of test cases. This patch also passed llvm/clang bootstrap
test, and spec2006 build/run/result validation.
Original issue: https://llvm.org/bugs/show_bug.cgi?id=25617
Great thanks to Tom's (tjablin) help, he contributed a lot to this patch.
Thanks Hal and Kit's invaluable opinions!
Reviewers: hfinkel kbarton
http://reviews.llvm.org/D16315
llvm-svn: 265506
Chuang-Yu Cheng [Wed, 6 Apr 2016 01:47:02 +0000 (01:47 +0000)]
[Power9] Implement add-pc, multiply-add, modulo, extend-sign-shift, random number, set bool, and dfp test significance
This patch implement the following instructions:
- addpcis subpcis
- maddhd maddhdu maddld
- modsw moduw modsd modud
- darn
- extswsli extswsli.
- setb
- dtstsfi dtstsfiq
Total 15 instructions
Reviewers: nemanjai hfinkel tjablin amehsan kbarton
http://reviews.llvm.org/D17885
llvm-svn: 265505
Chuang-Yu Cheng [Wed, 6 Apr 2016 01:46:45 +0000 (01:46 +0000)]
[Power9] Implement copy-paste, msgsync, slb, and stop instructions
This patch implements the following BookII and Book III instructions:
- copy copy_first cp_abort paste paste. paste_last
- msgsync
- slbieg slbsync
- stop
Total 10 instructions
Reviewers: nemanjai hfinkel tjablin amehsan kbarton
llvm-svn: 265504
Sanjoy Das [Wed, 6 Apr 2016 01:33:54 +0000 (01:33 +0000)]
[RS4GC] Add a comment
llvm-svn: 265503
Sanjoy Das [Wed, 6 Apr 2016 01:33:49 +0000 (01:33 +0000)]
Lower @llvm.experimental.deoptimize as a noreturn call
While preserving the return value for @llvm.experimental.deoptimize at
the IR level is useful during mid-level optimization, doing so at the
machine instruction level requires generating some extra code and a
return that is non-ideal. This change has LLVM lower
```
%val = call @llvm.experimental.deoptimize
ret %val
```
to effectively
```
call @__llvm_deoptimize()
unreachable
```
instead.
llvm-svn: 265502
Rafael Espindola [Wed, 6 Apr 2016 01:30:49 +0000 (01:30 +0000)]
Make helper function static. NFC.
llvm-svn: 265501
Tom Stellard [Wed, 6 Apr 2016 01:29:19 +0000 (01:29 +0000)]
AMDGPU: Document address space mapping
Summary:
Address space mapping is described in lib/Target/AMDGPU/AMDGPU.h in
Doxygen comments. This patch adds the description to user guide for
AMDGPU back-end.
Patch By: Vedran Miletić
Reviewers: tstellarAMD, arsenm
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17046
llvm-svn: 265500
NAKAMURA Takumi [Wed, 6 Apr 2016 01:18:08 +0000 (01:18 +0000)]
AArch64CodeGen: Make AArch64RegisterBankInfo.cpp optional along LLVM_BUILD_GLOBAL_ISEL.
llvm-svn: 265499
Todd Fiala [Wed, 6 Apr 2016 01:14:37 +0000 (01:14 +0000)]
make TestRegisterVariables slightly more resilient
This test sets the compiler optimization level to -O1 and
makes some assumptions about how local frame vars will be
stored (i.e. in registers). These assumptions are not always
true.
I did a first-pass set of improvements that:
(1) no longer assumes that every one of the target locations has
every variable in a register. Sometimes the compiler
is even smarter and skips the register entirely.
(2) simply expects one of the 5 or so variables it checks
to be in a register.
This test probably passes on a whole lot more systems than it
used to now. This is certainly true on OS X.
llvm-svn: 265498
Ivan Krasin [Wed, 6 Apr 2016 01:11:10 +0000 (01:11 +0000)]
Fix a memory leak found by check-lld asan tests.
Summary:
This bug was introduced by http://reviews.llvm.org/rL265059,
where InputSectionBase got Thunks field, which can do memory allocations.
Since InputSectionBase destructors were never called (I count it as another bug),
that caused a memory leak when 2 or more thunks are added to a section.
The fix to is properly call InputSectionBase destructors from ~ObjectFile.
Reviewers: atanasyan, ruiu, rafael
Subscribers: rafael, krasin, pcc
Differential Revision: http://reviews.llvm.org/D18809
llvm-svn: 265497
Jim Ingham [Wed, 6 Apr 2016 00:25:44 +0000 (00:25 +0000)]
The FixItList typedef should have been inside "class ClangDiagnostic".
llvm-svn: 265496
Jim Ingham [Wed, 6 Apr 2016 00:25:04 +0000 (00:25 +0000)]
If the fixed expression doesn't parse, don't tell the user about it.
llvm-svn: 265495
Jim Ingham [Wed, 6 Apr 2016 00:24:17 +0000 (00:24 +0000)]
Don't write "using $_lldb_local_vars" statements for variables with
no name. These were showing up with a recent clang, I haven't tracked
down why yet, but adding them is clearly wrong.
llvm-svn: 265494