David L. Jones [Thu, 8 Dec 2016 01:11:41 +0000 (01:11 +0000)]
Loosen checks for _MSC_FULL_VER under -fms-extensions.
Summary:
On actual Windows hosts :-) , this could report something other than the
fallback, with a non-zero minor/build number.
Reviewers: rnk, llvm-commits
Differential Revision: https://reviews.llvm.org/D27554
llvm-svn: 289011
Greg Clayton [Thu, 8 Dec 2016 01:03:48 +0000 (01:03 +0000)]
Make a DWARF generator so we can unit test DWARF APIs with gtest.
The only tests we have for the DWARF parser are the tests that use llvm-dwarfdump and expect output from textual dumps.
More DWARF parser modification are coming in the next few weeks and I wanted to add tests that can verify that we can encode and decode all form types, as well as test some other basic DWARF APIs where we ask DIE objects for their children and siblings.
DwarfGenerator.cpp was added in the lib/CodeGen directory. This file contains the code necessary to easily create DWARF for tests:
dwarfgen::Generator DG;
Triple Triple("x86_64--");
bool success = DG.init(Triple, Version);
if (!success)
return;
dwarfgen::CompileUnit &CU = DG.addCompileUnit();
dwarfgen::DIE CUDie = CU.getUnitDIE();
CUDie.addAttribute(DW_AT_name, DW_FORM_strp, "/tmp/main.c");
CUDie.addAttribute(DW_AT_language, DW_FORM_data2, DW_LANG_C);
dwarfgen::DIE SubprogramDie = CUDie.addChild(DW_TAG_subprogram);
SubprogramDie.addAttribute(DW_AT_name, DW_FORM_strp, "main");
SubprogramDie.addAttribute(DW_AT_low_pc, DW_FORM_addr, 0x1000U);
SubprogramDie.addAttribute(DW_AT_high_pc, DW_FORM_addr, 0x2000U);
dwarfgen::DIE IntDie = CUDie.addChild(DW_TAG_base_type);
IntDie.addAttribute(DW_AT_name, DW_FORM_strp, "int");
IntDie.addAttribute(DW_AT_encoding, DW_FORM_data1, DW_ATE_signed);
IntDie.addAttribute(DW_AT_byte_size, DW_FORM_data1, 4);
dwarfgen::DIE ArgcDie = SubprogramDie.addChild(DW_TAG_formal_parameter);
ArgcDie.addAttribute(DW_AT_name, DW_FORM_strp, "argc");
// ArgcDie.addAttribute(DW_AT_type, DW_FORM_ref4, IntDie);
ArgcDie.addAttribute(DW_AT_type, DW_FORM_ref_addr, IntDie);
StringRef FileBytes = DG.generate();
MemoryBufferRef FileBuffer(FileBytes, "dwarf");
auto Obj = object::ObjectFile::createObjectFile(FileBuffer);
EXPECT_TRUE((bool)Obj);
DWARFContextInMemory DwarfContext(*Obj.get());
This code is backed by the AsmPrinter code that emits DWARF for the actual compiler.
While adding unit tests it was discovered that DIEValue that used DIEEntry as their values had bugs where DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref8, and DW_FORM_ref_udata forms were not supported. These are all now supported. Added support for DW_FORM_string so we can emit inlined C strings.
Centralized the code to unique abbreviations into a new DIEAbbrevSet class and made both the dwarfgen::Generator and the llvm::DwarfFile classes use the new class.
Fixed comments in the llvm::DIE class so that the Offset is known to be the compile/type unit offset.
DIEInteger now supports more DW_FORM values.
There are also unit tests that cover:
Encoding and decoding all form types and values
Encoding and decoding all reference types (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata, DW_FORM_ref_addr) including cross compile unit references with that go forward one compile unit and backward on compile unit.
Differential Revision: https://reviews.llvm.org/D27326
llvm-svn: 289010
Zachary Turner [Thu, 8 Dec 2016 00:54:24 +0000 (00:54 +0000)]
Work around a bogus warning on MSVC.
llvm-svn: 289009
Evgeniy Stepanov [Thu, 8 Dec 2016 00:32:26 +0000 (00:32 +0000)]
CFI-icall on Thumb
Replace @progbits in the section directive with %progbits, because "@" starts a comment on arm/thumb.
Use b.w branch instruction.
Use .thumb_function and .thumb_set for proper arm/thumb interwork. This way jumptable entry addresses on thumb have bit 0 set (correctly). This does not affect CFI check math, because the address of the jumptable start also has that bit set.
This does not work on thumbv5, because it does not support b.w, and the linker would not insert a veneer (trampoline?) to extend the range of b.n. We may need to do full-range plt-style jumptables on thumbv54, which are 12 bytes per entry. Another option is "push lr; bl; pop pc" (4 bytes) but that needs unwinding instructions, etc.
Differential Revision: https://reviews.llvm.org/D27499
llvm-svn: 289008
Peter Collingbourne [Thu, 8 Dec 2016 00:27:37 +0000 (00:27 +0000)]
LTO: Remove the unused Config::Features field.
We are currently initializing Features via MAttrs.
llvm-svn: 289007
Greg Clayton [Thu, 8 Dec 2016 00:22:45 +0000 (00:22 +0000)]
Improve crashlog.py so it can handle more iOS crashlog files.
<rdar://problem/
29191857>
llvm-svn: 289006
Bruno Cardoso Lopes [Thu, 8 Dec 2016 00:22:06 +0000 (00:22 +0000)]
[Driver][Darwin] Disable default stack protector levels in freestanding mode.
Currently -fstack-protector is on by default when using -ffreestanding.
Change the default behavior to have it off when using -ffreestanding.
rdar://problem/
14089363
llvm-svn: 289005
Matthias Braun [Thu, 8 Dec 2016 00:16:42 +0000 (00:16 +0000)]
The few days mentioned in r267095 are over
llvm-svn: 289004
Matthias Braun [Thu, 8 Dec 2016 00:16:08 +0000 (00:16 +0000)]
TargetPassConfig: Rename DisablePostRA -> DisablePostRASched; NFC
llvm-svn: 289003
Matthias Braun [Thu, 8 Dec 2016 00:15:51 +0000 (00:15 +0000)]
LivePhysReg: Use reference instead of pointer in init(); NFC
llvm-svn: 289002
Quentin Colombet [Thu, 8 Dec 2016 00:06:51 +0000 (00:06 +0000)]
[InlineSpiller] Don't call TargetInstrInfo::foldMemoryOperand with an empty list.
Since r287792 if we try to do that we will hit an assert.
llvm-svn: 289001
Greg Clayton [Wed, 7 Dec 2016 23:52:27 +0000 (23:52 +0000)]
Fix an unannotated fallthrough that was causing a warning.
llvm-svn: 289000
Greg Clayton [Wed, 7 Dec 2016 23:51:49 +0000 (23:51 +0000)]
Fixed DoConnectRemote issues where ProcessKDP wasn't switched over to use the version that needed a StringRef as the URL, and also updated all virtual functions to say "override" to make sure this doesn't happen again.
llvm-svn: 288999
David L. Jones [Wed, 7 Dec 2016 23:41:58 +0000 (23:41 +0000)]
Refactor how the MSVC toolchain searches for a compatibility version.
Summary:
The MSVC toolchain and Clang driver combination currently uses a fairly complex
sequence of steps to determine the MS compatibility version to pass to cc1.
There is some oddness in this sequence currently, with some code which inspects
flags in the toolchain, and some code which inspects the triple and local
environment in the driver code.
This change is an attempt to consolidate most of this logic so that
Win32-specific code lives in MSVCToolChain.cpp. I'm not 100% happy with the
split, so any suggestions are welcome.
There are a few things you might want to watch for for specifically:
- On all platforms, if MSVC compatibility flags are provided (and valid), use
those.
- The fallback sequence should be the same as before, but is now consolidated
into MSVCToolChain::getMSVCVersion:
- Otherwise, try to use the Triple.
- Otherwise, on Windows, check the executable.
- Otherwise, on Windows or with --fms-extensions, default to 18.
- Otherwise, we can't determine the version.
- MSVCToolChain::ComputeEffectiveTriple no longer calls the base
ToolChain::ComputeEffectiveClangTriple. The only thing it would change for
Windows the architecture, which we don't care about for the compatibility
version.
- I'm not sure whether this is philosophically correct (but it should
be easy to add back to MSVCToolChain::getMSVCVersionFromTriple if not).
- Previously, Tools.cpp just called getTriple() anyhow, so it doesn't look
like the effective triple was always being used previously anyhow.
Reviewers: hans, compnerd, llvm-commits, rnk
Subscribers: amccarth
Differential Revision: https://reviews.llvm.org/D27477
llvm-svn: 288998
David L. Jones [Wed, 7 Dec 2016 23:39:44 +0000 (23:39 +0000)]
Add more tests for MSVC version handling.
Summary:
This change adds more test cases for the default MSVC compatibility version:
1. When -fms-extensions is supplied, but -fmsc-version and
-fms-compatibility-version are not.
2. With the target triple specifies an MSVC environment, but no other
-fms* flags.
Reviewers: rnk, llvm-commits
Subscribers: hans, compnerd, amccarth
Differential Revision: https://reviews.llvm.org/D27498
llvm-svn: 288997
Rui Ueyama [Wed, 7 Dec 2016 23:26:39 +0000 (23:26 +0000)]
Remove redundant call of std::unique_ptr::get.
Obj is an instance of std::unique_ptr, so *Obj.get() is the same as *Obj.
llvm-svn: 288996
Rui Ueyama [Wed, 7 Dec 2016 23:24:32 +0000 (23:24 +0000)]
Fix Windows buildbots.
clang-format-diff sorted these #include's in the asciibetical order,
but they need to be in this order.
llvm-svn: 288995
Bruno Cardoso Lopes [Wed, 7 Dec 2016 23:20:30 +0000 (23:20 +0000)]
[Driver] Add tests for default stack protector values on Darwin
llvm-svn: 288994
Rui Ueyama [Wed, 7 Dec 2016 23:17:05 +0000 (23:17 +0000)]
Make demangle() return None instead of "" if a given string is not a mangled symbol.
llvm-svn: 288993
Rui Ueyama [Wed, 7 Dec 2016 23:17:02 +0000 (23:17 +0000)]
COFF: Define overloaded toString functions.
Previously, we had different way to stringize SymbolBody and InputFile
to construct error messages. This patch defines overloaded function
toString() so that we don't need to memorize all these different
function names.
With that change, it is now easy to include demangled names in error
messages. Now, if there is a symbol name conflict, we'll print out
both mangled and demangled names.
llvm-svn: 288992
Filipe Cabecinhas [Wed, 7 Dec 2016 22:37:11 +0000 (22:37 +0000)]
[asan] Split load and store checks in test. NFCI
llvm-svn: 288991
Chris Bieneman [Wed, 7 Dec 2016 22:30:15 +0000 (22:30 +0000)]
[yaml2obj] Refactor and abstract yaml2dwarf functions
This abstracts the code for emitting DWARF binary from the DWARFYAML types into reusable interfaces that could be used by ELF and COFF.
llvm-svn: 288990
Eugene Zelenko [Wed, 7 Dec 2016 22:06:02 +0000 (22:06 +0000)]
[ADT, IR] Fix some Clang-tidy modernize-use-equals-delete and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 288989
Serge Rogatch [Wed, 7 Dec 2016 22:00:02 +0000 (22:00 +0000)]
[XRay][AArch64] Disable the unstable test XRay-aarch64-linux::patching-unpatching.cc
Summary:
The test `XRay-aarch64-linux::patching-unpatching.cc` sometimes passes, sometimes fails on buildbots.
This patch disables test `patching-unpatching.cc` for AArch64 targets.
Reviewers: rengolin, dberris
Subscribers: llvm-commits, iid_iunknown, aemerson
Differential Revision: https://reviews.llvm.org/D27528
llvm-svn: 288988
Davide Italiano [Wed, 7 Dec 2016 21:47:32 +0000 (21:47 +0000)]
[BDCE] Skip metadata while replacing uses.
The fix committed in r288851 doesn't cover all the cases.
In particular, if we have an instruction with side effects
which has a no non-dbg use not depending on the bits, we still
perform RAUW destroying the dbg.value's first argument.
Prevent metadata from being replaced here to avoid the issue.
Differential Revision: https://reviews.llvm.org/D27534
llvm-svn: 288987
Chris Bieneman [Wed, 7 Dec 2016 21:47:28 +0000 (21:47 +0000)]
[obj2yaml] Refactor and abstract dwarf2yaml
This makes the dwarf2yaml code separated and reusable allowing ELF and COFF to share implementations with MachO.
llvm-svn: 288986
Tim Northover [Wed, 7 Dec 2016 21:29:15 +0000 (21:29 +0000)]
GlobalISel: use correct builder for ConstantExprs.
ConstantExpr instances were emitting code into the current block rather than
the entry block. This meant they didn't necessarily dominate all uses, which is
clearly wrong.
llvm-svn: 288985
Chris Bieneman [Wed, 7 Dec 2016 21:26:32 +0000 (21:26 +0000)]
[ObjectYAML] Pull DWARF support into DWARFYAML namespace
Since DWARF formatting is agnostic to the object file it is stored in, it doesn't make sense for this to be in the MachOYAML implementation. Pulling it into its own namespace means we could modify the ELF and COFF YAML tools to emit DWARF as well.
In a follow-up patch I will better abstract this in obj2yaml and yaml2obj so that the DWARF bits in the tools can be re-used too.
llvm-svn: 288984
Tim Northover [Wed, 7 Dec 2016 21:17:47 +0000 (21:17 +0000)]
GlobalISel: store the current MachineFunction as direct state. NFC.
Having to ask the MIRBuilder for the current function is a little awkward, and
I'm intending to improve how that's threaded through anyway.
llvm-svn: 288983
Rafael Espindola [Wed, 7 Dec 2016 21:13:27 +0000 (21:13 +0000)]
Rename MaxPageSize to DefaultMaxPageSize to avoid confusion.
Thanks to Rui for the suggestion.
llvm-svn: 288982
Chris Bieneman [Wed, 7 Dec 2016 21:09:37 +0000 (21:09 +0000)]
[ObjectYAML] Rename DWARF entries to match section names
This change makes the yaml tags for the members of the DWARF data match the names of the DWARF sections.
llvm-svn: 288981
Tim Northover [Wed, 7 Dec 2016 21:05:38 +0000 (21:05 +0000)]
GlobalISel: simplify MachineIRBuilder interface.
MachineIRBuilder had weird before/after and beginning/end flags for the insert
point. Unfortunately the non-default means that instructions will be inserted
in reverse order which is almost never what anyone wants.
Really, I think we just want (like IRBuilder has) the ability to insert at any
C++ iterator-style point (i.e. before any instruction or before MBB.end()). So
this fixes MIRBuilders to behave like IRBuilders in this respect.
llvm-svn: 288980
Kostya Serebryany [Wed, 7 Dec 2016 21:02:48 +0000 (21:02 +0000)]
[libFuzzer] include FuzzerIO.h and hopefully fix the Mac build. reported by Dejan Mircevski
llvm-svn: 288979
Matt Arsenault [Wed, 7 Dec 2016 20:56:11 +0000 (20:56 +0000)]
InstCombine: Fold bitcast of vector to FP scalar
llvm-svn: 288978
Chris Bieneman [Wed, 7 Dec 2016 20:55:38 +0000 (20:55 +0000)]
[CMake] Add check for HAVE_CRASHREPORTER_INFO
This was also explicitly undef in CMake for some unknown reason.
Hopefully this one won't kill all the bots.
llvm-svn: 288977
Malcolm Parsons [Wed, 7 Dec 2016 20:38:20 +0000 (20:38 +0000)]
[RecursiveASTVisitor] Improve post-order traversal unit test
llvm-svn: 288976
Rui Ueyama [Wed, 7 Dec 2016 20:31:46 +0000 (20:31 +0000)]
Fix Windows buildbots.
llvm-svn: 288975
Rafael Espindola [Wed, 7 Dec 2016 20:29:46 +0000 (20:29 +0000)]
Use the correct MaxPageSize.
Now Target->MaxPageSize is only used as the default value of
Config->MaxPageSize.
llvm-svn: 288974
Rui Ueyama [Wed, 7 Dec 2016 20:25:45 +0000 (20:25 +0000)]
Do not pass line number to convertToUnixPathSeparator.
Line number can never contain '/' or '\', so the previous code
was pointless at that point.
llvm-svn: 288973
Rui Ueyama [Wed, 7 Dec 2016 20:22:27 +0000 (20:22 +0000)]
Make convertToUnixPathSeparator return a new string instead of mutating argument.
llvm-svn: 288972
Rafael Espindola [Wed, 7 Dec 2016 20:20:39 +0000 (20:20 +0000)]
Simplify. NFC.
llvm-svn: 288971
Rafael Espindola [Wed, 7 Dec 2016 20:10:43 +0000 (20:10 +0000)]
Use the correct MaxPageSize.
Found by inspection.
llvm-svn: 288970
Eric Liu [Wed, 7 Dec 2016 20:08:02 +0000 (20:08 +0000)]
[change-namespace] always add a '::' prefix when a symbol reference needs to be fully-qualified.
llvm-svn: 288969
Eli Friedman [Wed, 7 Dec 2016 19:55:59 +0000 (19:55 +0000)]
[GVNHoist] Invalidate MemDep when an instruction is moved.
See also r279907.
Fixes https://llvm.org/bugs/show_bug.cgi?id=30991 .
Differential Revision: https://reviews.llvm.org/D27493
llvm-svn: 288968
George Rimar [Wed, 7 Dec 2016 19:44:27 +0000 (19:44 +0000)]
Format. NFC.
llvm-svn: 288967
George Rimar [Wed, 7 Dec 2016 19:42:25 +0000 (19:42 +0000)]
[ELF] - Print absolute file name in errors when possible.
Currently LLD prints basename of source file name in error messages,
for example:
$ mkdir foo
$ echo 'void _start(void) { foobar(); }' > foo/bar.c
$ gcc -g -c foo/bar.c
$ bin/ld.lld -o out bar.o
bin/ld.lld: error: bar.c:1: undefined symbol 'foobar'
$
This should say:
bin/ld.lld: error: foo/bar.c:1: undefined symbol 'foobar'
This is PR31299
Differential revision: https://reviews.llvm.org/D27506
llvm-svn: 288966
Michael Kuperstein [Wed, 7 Dec 2016 19:31:08 +0000 (19:31 +0000)]
[X86] Skip over DEBUG_VALUE while looking for start of call sequence
If we don't skip over DEBUG_VALUEs, we get differences between -g and non-g
code.
This fixes PR31242.
Differential Revision: https://reviews.llvm.org/D27485
llvm-svn: 288965
Michael Kuperstein [Wed, 7 Dec 2016 19:29:18 +0000 (19:29 +0000)]
[X86] Do not assume "ri" instructions always have an immediate operand
The second operand of an "ri" instruction may be an immediate, but it may
also be a globalvariable, so we should make any assumptions.
This fixes PR31271.
Differential Revision: https://reviews.llvm.org/D27481
llvm-svn: 288964
Chris Bieneman [Wed, 7 Dec 2016 19:28:22 +0000 (19:28 +0000)]
Fix the apple build issue caused by r288956
Should be checking if HAVE_CRASHREPORTERCLIENT_H is defined not relying on it having a value.
llvm-svn: 288963
Artem Belevich [Wed, 7 Dec 2016 19:27:16 +0000 (19:27 +0000)]
[CUDA] Improve target attribute checking for function templates.
* __host__ __device__ functions are no longer considered to be
redeclarations of __host__ or __device__ functions. This prevents
unintentional merging of target attributes across them.
* Function target attributes are not considered (and must match) during
explicit instantiation and specialization of function templates.
Differential Revision: https://reviews.llvm.org/D25809
llvm-svn: 288962
Chris Bieneman [Wed, 7 Dec 2016 19:25:38 +0000 (19:25 +0000)]
Revert "[CMake] Use cmakedefine01 instead of cmakedefine"
This reverts commit r288959.
Apparently using cmakedefine01 explodes.
llvm-svn: 288961
Weiming Zhao [Wed, 7 Dec 2016 19:14:29 +0000 (19:14 +0000)]
[builtin] Add Thumb1 implementation for idivsi3 and aeabi_idivmod
Summary:
For idivsi3, convert the Thumb2 only instruction to thumb1.
For aeabi_idivmod, using __divsi3.
Reviewers: rengolin, compnerd
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27472
llvm-svn: 288960
Chris Bieneman [Wed, 7 Dec 2016 19:13:32 +0000 (19:13 +0000)]
[CMake] Use cmakedefine01 instead of cmakedefine
Looks like we need a 01 value for HAVE_CRASHREPORTERCLIENT_H.
llvm-svn: 288959
Sanjay Patel [Wed, 7 Dec 2016 18:56:55 +0000 (18:56 +0000)]
[InstCombine] add tests for smin+icmp; NFC
The tests that already work are folded in InstSimplify, so those
tests should be redundant and we can remove them if they don't
seem worthwhile for completeness.
llvm-svn: 288957
Chris Bieneman [Wed, 7 Dec 2016 18:53:04 +0000 (18:53 +0000)]
[CMake] Add a check for HAVE_CRASHREPORTERCLIENT_H
The CMake build has been hardcoding this to undef forever, we shouldn't have been doing that.
llvm-svn: 288956
Chris Bieneman [Wed, 7 Dec 2016 18:52:59 +0000 (18:52 +0000)]
[ObjectYAML] Support for DWARF __debug_abbrev section
This patch adds support for round-tripping DWARF debug abbreviations through the obj<->yaml tools.
llvm-svn: 288955
Weiming Zhao [Wed, 7 Dec 2016 18:41:07 +0000 (18:41 +0000)]
[builtin] for the condition for check __ARM_FEATURE_CLZ
Summary: Since CLZ is not available for Thumb1, we use __ARM_ARCH_ISA_THUMB != 1 as one of the conditions.
Reviewers: rnk, compnerd, rengolin
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D27530
llvm-svn: 288954
Renato Golin [Wed, 7 Dec 2016 18:37:49 +0000 (18:37 +0000)]
[asan] Disable yet another unstable test under AArch64
llvm-svn: 288953
Simon Pilgrim [Wed, 7 Dec 2016 17:54:00 +0000 (17:54 +0000)]
[SelectionDAG] Add knownbits support for vector demandedelts in SMAX/SMIN/UMAX/UMIN opcodes
llvm-svn: 288926
Michael Kruse [Wed, 7 Dec 2016 17:48:02 +0000 (17:48 +0000)]
Add unittests for foreach(Elt|Piece). NFC.
llvm-svn: 288925
Michael Kruse [Wed, 7 Dec 2016 17:47:57 +0000 (17:47 +0000)]
Add more ISL foreachElt functions. NFC.
Add and implement foreachElt for isl_map, isl_set and isl_union_set. These are
used by an out-of-tree patch which is in process of being upstreamed.
llvm-svn: 288924
Malcolm Parsons [Wed, 7 Dec 2016 17:39:04 +0000 (17:39 +0000)]
[RecursiveASTVisitor] Fix post-order traversal of UnaryOperator
Reviewers: aaron.ballman, klimek, doug.gregor, teemperor, rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26742
llvm-svn: 288923
Devin Coughlin [Wed, 7 Dec 2016 17:36:27 +0000 (17:36 +0000)]
[analyzer] Fix typo in nullability checker diagnostic
'infered' --> 'inferred'
llvm-svn: 288922
Adhemerval Zanella [Wed, 7 Dec 2016 17:31:48 +0000 (17:31 +0000)]
ELF/AArch64: Refactor R_AARCH64_LDST{8,15,32,64,128}_ABS_LO12_NC Relocations
This patch refactor how to apply the R_AARCH64_LDST{8,16,32,64,128}_ABS_NC
relocations by adding a new function to correct extract the bits expected
by each relocation. This make is explicit which are the bits range expected
and simplify the code to mask and shift the deriable values.
It also fixes the R_AARCH64_LDST128_ABS_LO12_NC mask, although in pratice
the mask/shift always returns a 16 bytes aligned value.
Checked on AArch64 and with test-suite.
llvm-svn: 288921
Simon Pilgrim [Wed, 7 Dec 2016 17:21:13 +0000 (17:21 +0000)]
[X86] Add knownbits vector UMAX test
In preparation for demandedelts support
llvm-svn: 288920
Eric Liu [Wed, 7 Dec 2016 17:04:07 +0000 (17:04 +0000)]
[change-namespace] don't fix using shadow decls in classes.
Summary:
Using shadow declarations in classes always refers to base class, which does not
need to be fixed/qualified since it can be inferred from inheritance.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27523
llvm-svn: 288919
Simon Pilgrim [Wed, 7 Dec 2016 17:02:41 +0000 (17:02 +0000)]
[X86][SSE] Remove AND -> VZEXT combine
This is now performed more generally by the target shuffle combine code.
Already covered by tests that were originally added in D7666/rL229480 to support combineVectorZext (or VectorZextCombine as it was known then....).
Differential Revision: https://reviews.llvm.org/D27510
llvm-svn: 288918
Artem Dergachev [Wed, 7 Dec 2016 16:51:54 +0000 (16:51 +0000)]
[analyzer] Remove an unused enum value in RetainCountChecker.
No functional change intended.
Differential Revision: https://reviews.llvm.org/D27408
llvm-svn: 288917
Simon Pilgrim [Wed, 7 Dec 2016 16:28:21 +0000 (16:28 +0000)]
[SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes
llvm-svn: 288916
Michael Kruse [Wed, 7 Dec 2016 16:17:59 +0000 (16:17 +0000)]
Add IslPtr type traits. NFC.
Add traits for isl_id and isl_multi_aff, required by out-of-tree patches
currently in progress of upstreaming.
isl_union_pw_aff_dump has been added to ISL during one of the last ISL
updates, such that we can also enable its dump() trait.
llvm-svn: 288915
Artem Dergachev [Wed, 7 Dec 2016 16:12:26 +0000 (16:12 +0000)]
[analyzer] pr31226: Disable CastSizeChecker in C++ because it's not quite ready.
Avoids a crash and a related false positive.
Investigation by Daniel Krupp!
llvm-svn: 288914
Simon Pilgrim [Wed, 7 Dec 2016 15:31:12 +0000 (15:31 +0000)]
[SelectionDAG] Removed old knownbits TODO comment. NFCI.
EXTRACT_VECTOR_ELT does support demanded elts if the element index is known and in range.
llvm-svn: 288913
Simon Pilgrim [Wed, 7 Dec 2016 15:27:18 +0000 (15:27 +0000)]
[X86] Add test to show missed opportunities to calculate knownbits in INSERT_VECTOR_ELT
llvm-svn: 288912
Simon Pilgrim [Wed, 7 Dec 2016 15:10:05 +0000 (15:10 +0000)]
[X86][SSE] Fix vpextrd/vpextrq checks
They were testing for the pre-vex versions
llvm-svn: 288911
Simon Pilgrim [Wed, 7 Dec 2016 15:06:14 +0000 (15:06 +0000)]
[X86][SSE] Force execution domain of 32-bit extractps/pextrd in the stack folding tests
llvm-svn: 288910
Matthew Simpson [Wed, 7 Dec 2016 15:03:32 +0000 (15:03 +0000)]
[LV] Scalarize operands of predicated instructions
This patch attempts to scalarize the operand expressions of predicated
instructions if they were conditionally executed in the original loop. After
scalarization, the expressions will be sunk inside the blocks created for the
predicated instructions. The transformation essentially performs
un-if-conversion on the operands.
The cost model has been updated to determine if scalarization is profitable. It
compares the cost of a vectorized instruction, assuming it will be
if-converted, to the cost of the scalarized instruction, assuming that the
instructions corresponding to each vector lane will be sunk inside a predicated
block, possibly avoiding execution. If it's more profitable to scalarize the
entire expression tree feeding the predicated instruction, the expression will
be scalarized; otherwise, it will be vectorized. We only consider the cost of
the entire expression to accurately estimate the cost of the required
insertelement and extractelement instructions.
Differential Revision: https://reviews.llvm.org/D26083
llvm-svn: 288909
Eric Liu [Wed, 7 Dec 2016 14:20:52 +0000 (14:20 +0000)]
[change-namespace] move template class forward-declarations and don't move fwd-decls in classes.
Summary:
Forward declarations in moved namespaces should be moved back to the old
namespaces. We should also move template class forward declarations.
Also fix a bug that moves forward declarations of nested classes.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27515
llvm-svn: 288908
Benjamin Kramer [Wed, 7 Dec 2016 13:35:11 +0000 (13:35 +0000)]
Try unbreaking the MSVC build.
llvm-svn: 288907
Simon Pilgrim [Wed, 7 Dec 2016 13:05:04 +0000 (13:05 +0000)]
[X86][SSE] Regenerate test.
llvm-svn: 288906
Dylan McKay [Wed, 7 Dec 2016 12:34:47 +0000 (12:34 +0000)]
[AVR] Expand 'SELECT_CC' nodes whereever possible
llvm-svn: 288905
Benjamin Kramer [Wed, 7 Dec 2016 12:31:45 +0000 (12:31 +0000)]
[LowerTypeTests] Use the TrailingObjects infrastructure for trailing objects.
Also avoid allocating ~3x as much memory as needed.
llvm-svn: 288904
Andrea Di Biagio [Wed, 7 Dec 2016 12:31:36 +0000 (12:31 +0000)]
When GVN removes a redundant load, it should not modify the debug location of the dominating load.
In the case of a fully redundant load LI dominated by an equivalent load V, GVN
should always preserve the original debug location of V. Otherwise, we risk to
introduce an incorrect stepping.
If V has debug info, then clearly it should not be modified. If V has a null
debugloc, then it is still potentially incorrect to propagate LI's debugloc
because LI may not post-dominate V.
Differential Revision: https://reviews.llvm.org/D27468
llvm-svn: 288903
Simon Pilgrim [Wed, 7 Dec 2016 12:10:49 +0000 (12:10 +0000)]
[X86][SSE] Consistently set MOVD/MOVQ load/store/move instructions to integer domain
We are being inconsistent with these instructions (and all their variants.....) with a random mix of them using the default float domain.
Differential Revision: https://reviews.llvm.org/D27419
llvm-svn: 288902
Andrea Di Biagio [Wed, 7 Dec 2016 12:01:45 +0000 (12:01 +0000)]
[InlineFunction] Refactor code in function `fixupLineNumbers' as suggested by David in D27462. NFC
llvm-svn: 288901
Simon Dardis [Wed, 7 Dec 2016 11:41:23 +0000 (11:41 +0000)]
[mips][rtdyld] Merge code to write relocated values to the section. NFC
Preparation work for implementing N32 support.
Patch By: Daniel Sanders
Reviewers: vkalintiris, atanasyan
Differential Revision: https://reviews.llvm.org/D27460
llvm-svn: 288900
Dylan McKay [Wed, 7 Dec 2016 11:21:45 +0000 (11:21 +0000)]
[AVR] Move a pseudo expansion test into a folder
llvm-svn: 288899
Simon Pilgrim [Wed, 7 Dec 2016 11:19:00 +0000 (11:19 +0000)]
[X86][XOP] Fix VPERMIL2 non-constant pool shuffle decoding (PR31296)
The non-constant pool version of DecodeVPERMIL2PMask was not offsetting correctly for the second input. I've updated the code to match the implementation in the constant-pool version.
Annoyingly this bug was hidden for so long as it's tricky to combine to useful variable shuffle masks that don't become constant-pool entries.
llvm-svn: 288898
Dylan McKay [Wed, 7 Dec 2016 11:08:56 +0000 (11:08 +0000)]
[AVR] Allow loading from stack slots where src and dest registers are identical
Fixes PR 31256
llvm-svn: 288897
Alex Lorenz [Wed, 7 Dec 2016 10:52:18 +0000 (10:52 +0000)]
Implement the -Wstrict-prototypes warning
This commit fixes PR20796. It implements the C only -Wstrict-prototypes warning.
Clang now emits a warning for function declarations which have no parameters
specified and for K&R function definitions with more than 0 parameters that are
not preceded by a previous prototype declaration.
The patch was originally submitted by Paul Titei!
rdar://
15060615
Differential Revision: https://reviews.llvm.org/D16533
llvm-svn: 288896
Andrea Di Biagio [Wed, 7 Dec 2016 10:37:26 +0000 (10:37 +0000)]
[InlineFunction] Do not propagate the callsite debug location to instructions inlined from functions with debug info.
When a function F is inlined, InlineFunction extends the debug location of every
instruction inlined from F by adding an InlinedAt.
However, if an instruction has a 'null' debug location, InlineFunction would
propagate the callsite debug location to it. This behavior existed since
revision 210459.
Revision 210459 was originally committed specifically to workaround the lack of
debug information for instructions inlined from intrinsic functions (which are
usually declared with attributes `__always_inline__, __nodebug__`).
The problem with revision 210459 is that it doesn't make any sort of distinction
between instructions inlined from a 'nodebug' function and instructions which
are inlined from a function built with debug info. This issue may lead to
incorrect stepping in the debugger.
This patch works under the assumption that a nodebug function does not have a
DISubprogram. When a function F is inlined into another function G,
InlineFunction checks if F has debug info associated with it.
For nodebug functions, the InlineFunction logic is unchanged (i.e. it would
still propagate the callsite debugloc to the inlined instructions). Otherwise,
InlineFunction no longer propagates the callsite debug location.
Differential Revision: https://reviews.llvm.org/D27462
llvm-svn: 288895
Chandler Carruth [Wed, 7 Dec 2016 10:33:15 +0000 (10:33 +0000)]
[PM] Add some more logging to make it more clear when the CGSCC
infrastrucutre is skipping SCCs and RefSCCs.
llvm-svn: 288894
Alex Lorenz [Wed, 7 Dec 2016 10:24:44 +0000 (10:24 +0000)]
[ObjC++] Don't enter a C++ declarator scope when the current context is
an Objective-C declaration
This commit ensures that Sema won't enter a C++ declarator scope when the
current context is an Objective-C declaration. This prevents an assertion
failure in EnterDeclaratorContext that's used to ensure that current context
will be restored correctly after exiting the declarator context.
rdar://
20560175
Differential Revision: https://reviews.llvm.org/D26922
llvm-svn: 288893
Sam McCall [Wed, 7 Dec 2016 09:19:07 +0000 (09:19 +0000)]
Compilation database test: don't try to output to CWD
Summary:
Write output from compilation database test to %T rather than the working dir.
Sometimes CWD isn't writable!
Also specify no-canonical-prefixes so that clang has 'clang' in the name.
Reviewers: bkramer
Subscribers: joerg, cfe-commits
Differential Revision: https://reviews.llvm.org/D27504
llvm-svn: 288892
Alexey Bader [Wed, 7 Dec 2016 08:43:49 +0000 (08:43 +0000)]
[OpenCL] Added a LIT test for ensuring address space mangling is done the same both in OpenCL1.2 and OpenCL2.0.
Patch by Egor Churaev (echuraev).
Reviewers: Anastasia
Subscribers: yaxunl, cfe-commits, bader
Differential Revision: https://reviews.llvm.org/D27403
llvm-svn: 288891
Alexey Bader [Wed, 7 Dec 2016 08:38:24 +0000 (08:38 +0000)]
[OpenCL] Fix SPIR version generation.
Patch by Egor Churaev (echuraev).
Reviewers: Anastasia
Subscribers: bader, yaxunl, cfe-commits
Differential Revision: https://reviews.llvm.org/D27300
llvm-svn: 288890
Philip Reames [Wed, 7 Dec 2016 04:48:50 +0000 (04:48 +0000)]
Reintroduce a check accidentally removed in 288873 to fix clang bots
I believe this is the cause of the failure, but have not been able to confirm. Note that this is a speculative fix; I'm still waiting for a full build to finish as I synced and ended up doing a clean build which takes 20+ minutes on my machine.
llvm-svn: 288886
Rui Ueyama [Wed, 7 Dec 2016 04:45:34 +0000 (04:45 +0000)]
Add comments and reorder code a bit to clarify the intention. NFC.
llvm-svn: 288885
Philip Reames [Wed, 7 Dec 2016 04:11:22 +0000 (04:11 +0000)]
Fix a warning introduced in r288874
llvm-svn: 288884
Rui Ueyama [Wed, 7 Dec 2016 04:06:21 +0000 (04:06 +0000)]
Make a decision about whether we should warn on missing entry or not early.
Config->WarnMissingEntry is a single-purpose boolean variable, and
I think it's easier to understand than Config->HasEntry.
llvm-svn: 288883
Rui Ueyama [Wed, 7 Dec 2016 03:23:06 +0000 (03:23 +0000)]
Simplify -e <number> option handling.
This patch is to parse the entry symbol name lazily.
llvm-svn: 288882