platform/upstream/llvm.git
10 years ago[Mips] Do not hard-code the paired relocation type
Simon Atanasyan [Fri, 7 Nov 2014 19:32:08 +0000 (19:32 +0000)]
[Mips] Do not hard-code the paired relocation type

Request `getPairRelocation()` function to get paired relocation type.
That allows us to look up another pairs like R_MICROMIPS_HI16/LO16
in the future.

llvm-svn: 221539

10 years agoDon't redeclare a pure virtual method.
Rafael Espindola [Fri, 7 Nov 2014 18:07:04 +0000 (18:07 +0000)]
Don't redeclare a pure virtual method.

I.E., there is no value is having

void foo() override = 0;

If it is override it is already present in a base class. Since it is pure,
some other class will have to implement it.

llvm-svn: 221537

10 years agoUse StringRefMemoryObject in llvm-mc. NFC.
Rafael Espindola [Fri, 7 Nov 2014 17:59:05 +0000 (17:59 +0000)]
Use StringRefMemoryObject in llvm-mc. NFC.

llvm-svn: 221536

10 years agoFix clash of gcc toolchains in hexagon driver regression tests.
Samuel Antao [Fri, 7 Nov 2014 17:48:03 +0000 (17:48 +0000)]
Fix clash of gcc toolchains in hexagon driver regression tests.

If clang was configured with a custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the equivalent configure command), the path to the custom gcc toolchain path takes precedence to the one specified by -ccc-install-dir. This causes several regression tests to fail as they will be using an unexpected path. Adding the switch --gcc-toolchain="" in each test command is not enough as the hexagon toolchain implementation in the driver is not evaluating this argument. This commit modifies the hexagon toolchain to take the --gcc-toolchain="" argument into account when deciding the toolchain path, similarly to what is already done for other targets toolchains. Additionally, the faulty regression tests are modified in order to --gcc-toolchain="" be passed to the commands.

llvm-svn: 221535

10 years ago[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...
Daniel Sanders [Fri, 7 Nov 2014 16:54:21 +0000 (16:54 +0000)]
[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...

Summary:
... and after all that refactoring, it's possible to distinguish softfloat
floating point values from integers so this patch no longer breaks softfloat to
do it.

Remove direct handling of i32's in the N32/N64 ABI by promoting them to
i64. This more closely reflects the ABI documentation and also fixes
problems with stack arguments on big-endian targets.

We now rely on signext/zeroext annotations (already generated by clang) and
the Assert[SZ]ext nodes to avoid the introduction of unnecessary sign/zero
extends.

It was not possible to convert three tests to use signext/zeroext. These tests
are bswap.ll, ctlz-v.ll, ctlz-v.ll. It's not possible to put signext on a
vector type so we just accept the sign extends here for now. These tests don't
pass the vectors the same way clang does (clang puts multiple elements in the
same argument, these map 1 element to 1 argument) so we don't need to worry too
much about it.

With this patch, all known N32/N64 bugs should be fixed and we now pass the
first 10,000 tests generated by ABITest.py.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6117

llvm-svn: 221534

10 years agoRevert r221404 which caused lldb to not display
Fariborz Jahanian [Fri, 7 Nov 2014 16:47:05 +0000 (16:47 +0000)]
Revert r221404 which caused lldb to not display
vararg expressions.

llvm-svn: 221533

10 years agoMake sure only NEON enabled devices save/restore D16+ registers
Renato Golin [Fri, 7 Nov 2014 16:33:58 +0000 (16:33 +0000)]
Make sure only NEON enabled devices save/restore D16+ registers

llvm-svn: 221532

10 years ago[CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is built as...
NAKAMURA Takumi [Fri, 7 Nov 2014 16:08:19 +0000 (16:08 +0000)]
[CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is built as SHARED. Users of LLVMSupport won't inherit ${system_libs}.

unittests/SupporTests is another user of libpthreads. Apply LLVM_SYSTEM_LIBS for him explicitly.

llvm-svn: 221531

10 years agoPass PRIVATE to target_link_libraries if using shared libraries.
Rafael Espindola [Fri, 7 Nov 2014 15:33:56 +0000 (15:33 +0000)]
Pass PRIVATE to target_link_libraries if using shared libraries.

A shared library (unlike a .a), has its dependencies recorded in the library and
we can pass PRIVATE to target_link_libraries.

This patch then removes some bogus dependencies when using
BUILD_SHARED_LIBS=ON. For example, we go from

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMBitReader.so
lib/libLLVMTransformUtils.so lib/libLLVMInstCombine.so
lib/libLLVMScalarOpts.so lib/libLLVMipa.so lib/libLLVMAnalysis.so
lib/libLLVMMCParser.so lib/libLLVMMC.so lib/libLLVMObject.so
lib/libLLVMTarget.so lib/libLLVMProfileData.so

to

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMTransformUtils.so
lib/libLLVMScalarOpts.so lib/libLLVMAnalysis.so lib/libLLVMMC.so
lib/libLLVMTarget.so

In fact, build.ninja goes from 5231028 bytes to 4896759 bytes.

With this, old verisons of bfd ld (2.24 is OK, 2.23 warns) will print a bogus
warning when building with BUILD_SHARED_LIBS.

llvm-svn: 221530

10 years ago[mips] Removed the remainder of MipsCC. NFC.
Daniel Sanders [Fri, 7 Nov 2014 15:33:08 +0000 (15:33 +0000)]
[mips] Removed the remainder of MipsCC. NFC.

Summary:
One of the calls to AllocateStack (the one in LowerCall) doesn't look like
it should be there but it was there before and removing it breaks the
frame size calculation.

Reviewers: vmedic, theraven

Reviewed By: theraven

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6116

llvm-svn: 221529

10 years ago[mips] Remove MipsCC::reservedArgArea() in favour of MipsABIInfo::GetCalleeAllocdArgS...
Daniel Sanders [Fri, 7 Nov 2014 15:03:53 +0000 (15:03 +0000)]
[mips] Remove MipsCC::reservedArgArea() in favour of MipsABIInfo::GetCalleeAllocdArgSizeInBytes(). NFC.

Summary:

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6115

llvm-svn: 221528

10 years agoMipsCCState.h: Use LLVM_DELETED_FUNCTION for msc17.
NAKAMURA Takumi [Fri, 7 Nov 2014 14:56:31 +0000 (14:56 +0000)]
MipsCCState.h: Use LLVM_DELETED_FUNCTION for msc17.

llvm-svn: 221527

10 years agollvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.
NAKAMURA Takumi [Fri, 7 Nov 2014 14:50:10 +0000 (14:50 +0000)]
llvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.

llvm-svn: 221526

10 years ago[mips] Move MipsCCState to a separate file and clang-formatted it.
Daniel Sanders [Fri, 7 Nov 2014 14:24:31 +0000 (14:24 +0000)]
[mips] Move MipsCCState to a separate file and clang-formatted it.

Summary: Depends on D6113

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6114

llvm-svn: 221525

10 years agoImprove comments in vtordisp tests: fix a typo, add a bit more clarity
Timur Iskhodzhanov [Fri, 7 Nov 2014 14:11:14 +0000 (14:11 +0000)]
Improve comments in vtordisp tests: fix a typo, add a bit more clarity

llvm-svn: 221524

10 years ago[ELF] Remove is64bits() and isLittlEndian().
Shankar Easwaran [Fri, 7 Nov 2014 14:08:43 +0000 (14:08 +0000)]
[ELF] Remove is64bits() and isLittlEndian().

ELFLinkingContext had these two functions, which is really not needed since
the Writer uses a llvm::object template composed of Endianness, Alignment,
Is32bit/64bit. We could just use that and not duplicate functionality.

No Change In Functionality.

llvm-svn: 221523

10 years ago[mips] Fix unused variable warnings introduced in r221521
Daniel Sanders [Fri, 7 Nov 2014 12:43:01 +0000 (12:43 +0000)]
[mips] Fix unused variable warnings introduced in r221521

llvm-svn: 221522

10 years ago[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByVa...
Daniel Sanders [Fri, 7 Nov 2014 12:21:37 +0000 (12:21 +0000)]
[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByValArgRegs() and MipsABIInfo::GetVarArgRegs()

Summary: Depends on D6112

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6113

llvm-svn: 221521

10 years ago[sanitizer] Never remove the last frame off the stack trace.
Evgeniy Stepanov [Fri, 7 Nov 2014 12:03:07 +0000 (12:03 +0000)]
[sanitizer] Never remove the last frame off the stack trace.

It can only make it worse.

llvm-svn: 221520

10 years ago[mips] Remove MipsCC::getRegVT(). NFC
Daniel Sanders [Fri, 7 Nov 2014 12:02:59 +0000 (12:02 +0000)]
[mips] Remove MipsCC::getRegVT(). NFC

Summary: It's no longer used.

Reviewers: vmedic, theraven

Reviewed By: theraven

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6112

llvm-svn: 221519

10 years ago[mips] Remove MipsCC::analyzeCallOperands in favour of CCState::AnalyzeCallOperands...
Daniel Sanders [Fri, 7 Nov 2014 11:43:49 +0000 (11:43 +0000)]
[mips] Remove MipsCC::analyzeCallOperands in favour of CCState::AnalyzeCallOperands. NFC

Summary:
In addition to the usual f128 workaround, it was also necessary to provide
a means of accessing ArgListEntry::IsFixed.

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6111

llvm-svn: 221518

10 years ago[mips] Move SpecialCallingConv to MipsCCState and use it from tablegen-erated code...
Daniel Sanders [Fri, 7 Nov 2014 11:10:48 +0000 (11:10 +0000)]
[mips] Move SpecialCallingConv to MipsCCState and use it from tablegen-erated code. NFC

Summary:
In the long run, it should probably become a calling convention in its own
right but for now just move it out of
MipsISelLowering::analyzeCallOperands() so that we can drop this function
in favour of CCState::AnalyzeCallOperands().

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6085

llvm-svn: 221517

10 years ago[mips] Removed IsVarArg from MipsISelLowering::analyzeCallOperands(). NFC.
Daniel Sanders [Fri, 7 Nov 2014 10:45:16 +0000 (10:45 +0000)]
[mips] Removed IsVarArg from MipsISelLowering::analyzeCallOperands(). NFC.

Summary:
CCState objects already carry this information in their isVarArg() method.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6084

llvm-svn: 221516

10 years agoMove ARM failure from FIXME to XFAIL
Renato Golin [Fri, 7 Nov 2014 10:30:53 +0000 (10:30 +0000)]
Move ARM failure from FIXME to XFAIL

llvm-svn: 221515

10 years agollvm-symbolizer: teach it about PowerPC64 ELF function descriptors
Jay Foad [Fri, 7 Nov 2014 09:08:39 +0000 (09:08 +0000)]
llvm-symbolizer: teach it about PowerPC64 ELF function descriptors

Summary:
Teach llvm-symbolizer about PowerPC64 ELF function descriptors. Symbols in the .opd section point to function descriptors, the first word of which is a pointer to the real function. For the purposes of symbolizing we pretend that the symbol points directly to the function.

This is enough to get decent function names in stack traces for unoptimized binaries, which fixes the sanitizer print-stack-trace test on PowerPC64 Linux.

Reviewers: kcc, willschm, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6110

llvm-svn: 221514

10 years agoSCCP: overdefined calls cannot become constant
David Majnemer [Fri, 7 Nov 2014 08:54:19 +0000 (08:54 +0000)]
SCCP: overdefined calls cannot become constant

We would attempt to fold away a call instruction which had been marked
overdefined.  However, it's not valid to transition to constant from
overdefined.

This fixes PR21512.

llvm-svn: 221513

10 years ago[Refactor][NFC] Generalize the creation of ScopArrayInfo objects.
Johannes Doerfert [Fri, 7 Nov 2014 08:31:31 +0000 (08:31 +0000)]
[Refactor][NFC] Generalize the creation of ScopArrayInfo objects.

Differential Revision: http://reviews.llvm.org/D6031

llvm-svn: 221512

10 years agoCodeGen, Itanium: Properly dllimport RTTI data
David Majnemer [Fri, 7 Nov 2014 07:26:38 +0000 (07:26 +0000)]
CodeGen, Itanium: Properly dllimport RTTI data

We would blindly assume that RTTI data should have the same linkage as
the vtable because we didn't think the RTTI data was external.  This
oversight stemmed because we didn't take dllimport into account.

This fixes PR21512.

llvm-svn: 221511

10 years agoAdd Position-independent Code model Module API.
Justin Hibbits [Fri, 7 Nov 2014 04:46:10 +0000 (04:46 +0000)]
Add Position-independent Code model Module API.

Summary:
This makes PIC levels a Module flag attribute, which can be queried by the
backend.  The flag is named `PIC Level`, and can have a value of:

  0 - Backend-default
  1 - Small-model (-fpic)
  2 - Large-model (-fPIC)

These match the `-pic-level' command line argument for clang, and the value of the
preprocessor macro `__PIC__'.

Test Plan:
New flags tests specific for the 'PIC Level' module flag.
Tests to be added as part of a future commit for PowerPC, which will use this new API.

Reviewers: rafael, echristo

Reviewed By: rafael, echristo

Subscribers: rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D5882

llvm-svn: 221510

10 years agoUse llvm::StringRefMemoryObject NFC.
Rafael Espindola [Fri, 7 Nov 2014 04:24:12 +0000 (04:24 +0000)]
Use llvm::StringRefMemoryObject NFC.

llvm-svn: 221509

10 years agoFix Mach-O unit tests breakage on Windows
Rui Ueyama [Fri, 7 Nov 2014 02:54:52 +0000 (02:54 +0000)]
Fix Mach-O unit tests breakage on Windows

Mach-O normalized file reader assumes that the entire file is aligned
to a large boundary. If the in-memory file is not aligned properly, it will
abort with an assertion failure in read32/read64. This patch forces the
in-memory file for the unit test to be aligned at 64-byte boundary.

I found these tests are failing on Windows, but theoretically they could
fail on other platform.

llvm-svn: 221508

10 years ago[AArch64] Keep flags on condition vreg when instantiating a CB branch.
Ahmed Bougacha [Fri, 7 Nov 2014 02:50:00 +0000 (02:50 +0000)]
[AArch64] Keep flags on condition vreg when instantiating a CB branch.

Reversing a CB* instruction used to drop the flags on the condition. On the
included testcase, this lead to a read from an undefined vreg.
Using addOperand keeps the flags, here <undef>.

Differential Revision: http://reviews.llvm.org/D6159

llvm-svn: 221507

10 years agoDisable a Mach-O test on Windows that depends on Unix path separator.
Rui Ueyama [Fri, 7 Nov 2014 01:51:00 +0000 (01:51 +0000)]
Disable a Mach-O test on Windows that depends on Unix path separator.

llvm-svn: 221506

10 years agoAdd missing -target triple to ELF tests.
Rui Ueyama [Fri, 7 Nov 2014 01:45:32 +0000 (01:45 +0000)]
Add missing -target triple to ELF tests.

llvm-svn: 221505

10 years agoXFAIL elf/demangle.test on Windows.
Rui Ueyama [Fri, 7 Nov 2014 01:30:49 +0000 (01:30 +0000)]
XFAIL elf/demangle.test on Windows.

Because LLD on that platform can't demangle symbols.

llvm-svn: 221504

10 years agoUse a StringRefMemoryObject. NFC.
Rafael Espindola [Fri, 7 Nov 2014 01:09:51 +0000 (01:09 +0000)]
Use a StringRefMemoryObject. NFC.

llvm-svn: 221503

10 years agoUse StringRefMemoryObject. NFC.
Rafael Espindola [Fri, 7 Nov 2014 00:52:15 +0000 (00:52 +0000)]
Use StringRefMemoryObject. NFC.

llvm-svn: 221502

10 years agoLoopVectorize: Don't assume pointees are sized
David Majnemer [Fri, 7 Nov 2014 00:31:14 +0000 (00:31 +0000)]
LoopVectorize: Don't assume pointees are sized

A pointer's pointee might not be sized: the pointee could be a function.

Report this as IK_NoInduction when calculating isInductionVariable.

This fixes PR21508.

llvm-svn: 221501

10 years ago[PECOFF] Improve subsystem inference
Rui Ueyama [Thu, 6 Nov 2014 23:50:48 +0000 (23:50 +0000)]
[PECOFF] Improve subsystem inference

If /subsystem option is not given, the linker needs to infer the
subsystem based on the entry point symbol. If it fails to infer
that, the linker should error out on it.

LLD was almost correct, but it would fail to infer the subsystem
if the entry point is specified with /entry. This is because the
subsystem inference was coupled with the entry point function
searching (if no entry point name is specified, the linker needs
to find the right entry name).

This patch makes the subsystem inference an independent pass to
fix the issue. Now, as long as an entry point function is defined,
LLD can infer the subsystem no matter how it resolved the entry
point.

I don't think scanning all the defined symbols is fast, although
it shouldn't be that slow. The file class there does not provide
any easy way to find an atom by name, so this is what we can do
at this moment. I'd like to revisit this later to make it more
efficient.

llvm-svn: 221499

10 years agoInstCombine: Rely on cmpxchg's return code when it's strong
David Majnemer [Thu, 6 Nov 2014 23:23:30 +0000 (23:23 +0000)]
InstCombine: Rely on cmpxchg's return code when it's strong

Comparing the result of a cmpxchg instruction can be replaced with an
extractvalue of the cmpxchg success indicator.

llvm-svn: 221498

10 years agoRemove unused variable. NFC.
Rafael Espindola [Thu, 6 Nov 2014 23:16:57 +0000 (23:16 +0000)]
Remove unused variable. NFC.

llvm-svn: 221497

10 years agoFixes so tests compile and run remotely.
Greg Clayton [Thu, 6 Nov 2014 22:59:28 +0000 (22:59 +0000)]
Fixes so tests compile and run remotely.

Fixes include:
- dont set or change LDFLAGS, but set LD_EXTRAS instead
- fix compilation errors for iOS based builds with objective C code
    - fix test cases to create classes instead of relying on classes from AppKit
    - rename things where it makes sense

llvm-svn: 221496

10 years agoDon't repeat names in comments. NFC.
Rafael Espindola [Thu, 6 Nov 2014 22:57:10 +0000 (22:57 +0000)]
Don't repeat names in comments. NFC.

llvm-svn: 221495

10 years agoChanged program to go along with the previous commit to allow this test to be run...
Greg Clayton [Thu, 6 Nov 2014 22:56:56 +0000 (22:56 +0000)]
Changed program to go along with the previous commit to allow this test to be run remotely via lldb-platform.

llvm-svn: 221494

10 years agoFix the test to not have to run the binary separately first to get the golden output...
Greg Clayton [Thu, 6 Nov 2014 22:56:15 +0000 (22:56 +0000)]
Fix the test to not have to run the binary separately first to get the golden output, use the process STDOUT instead.

This helps this test be able to be run remotely.

llvm-svn: 221493

10 years agoMake sure stderr is filtered out in case xcodebuild or xcrun print errors when gettin...
Greg Clayton [Thu, 6 Nov 2014 22:55:09 +0000 (22:55 +0000)]
Make sure stderr is filtered out in case xcodebuild or xcrun print errors when getting the SDK path and use xcrun to find the SDK path.

llvm-svn: 221492

10 years ago[ELF][yaml2obj] Handle additional MIPS specific st_other field flags
Simon Atanasyan [Thu, 6 Nov 2014 22:46:24 +0000 (22:46 +0000)]
[ELF][yaml2obj] Handle additional MIPS specific st_other field flags

The ELF symbol `st_other` field might contain additional flags besides
visibility ones. This patch implements support for some MIPS specific
flags.

llvm-svn: 221491

10 years agoFactor out call to push_back. NFC.
Rafael Espindola [Thu, 6 Nov 2014 22:39:16 +0000 (22:39 +0000)]
Factor out call to push_back. NFC.

llvm-svn: 221490

10 years ago[X86][SSE] Vector integer/float conversion memory folding (cvttps2dq / cvttpd2dq)
Simon Pilgrim [Thu, 6 Nov 2014 22:15:41 +0000 (22:15 +0000)]
[X86][SSE] Vector integer/float conversion memory folding (cvttps2dq / cvttpd2dq)

Fixed an issue with the (v)cvttps2dq and (v)cvttpd2dq instructions being incorrectly put in the 2 source operand folding tables instead of the 1 source operand and added the missing SSE/AVX versions.

Also added missing (v)cvtps2dq and (v)cvtpd2dq instructions to the folding tables.

Differential Revision: http://reviews.llvm.org/D6001

llvm-svn: 221489

10 years ago[X86] Add VFMADDSUB cases for the 213->231 custom inserter.
Ahmed Bougacha [Thu, 6 Nov 2014 22:04:15 +0000 (22:04 +0000)]
[X86] Add VFMADDSUB cases for the 213->231 custom inserter.

Also add tests for vfmadd/vfmsub.

llvm-svn: 221488

10 years ago[X86] Add missing FMA3 VFMADDSUB in the emitter.
Ahmed Bougacha [Thu, 6 Nov 2014 21:58:11 +0000 (21:58 +0000)]
[X86] Add missing FMA3 VFMADDSUB in the emitter.

Also reuse the fma4 intrinsic test to cover fma3 instructions too.

llvm-svn: 221487

10 years agoThis is a large, but clearical, commit that enables the C++ formatters to take on...
Enrico Granata [Thu, 6 Nov 2014 21:55:30 +0000 (21:55 +0000)]
This is a large, but clearical, commit that enables the C++ formatters to take on the additional TypeSummaryOptions argument. It is still not used for anything, but it is now there. Adding support for this extra argument to Python formatters will follow suit

llvm-svn: 221486

10 years agoObject, COFF: Don't consider AuxFunctionDefinition for getSymbolSize
David Majnemer [Thu, 6 Nov 2014 21:46:55 +0000 (21:46 +0000)]
Object, COFF: Don't consider AuxFunctionDefinition for getSymbolSize

mingw lies about the size of a function's AuxFunctionDefinition.  Ignore
the field and rely on our heuristic to determine the symbol's size.

llvm-svn: 221485

10 years ago[X86] Split FMA4 RM tests into a separate file. NFC.
Ahmed Bougacha [Thu, 6 Nov 2014 21:46:23 +0000 (21:46 +0000)]
[X86] Split FMA4 RM tests into a separate file. NFC.

While there, remove useless comments.

llvm-svn: 221484

10 years agoFix formatting
Tobias Grosser [Thu, 6 Nov 2014 21:25:54 +0000 (21:25 +0000)]
Fix formatting

llvm-svn: 221483

10 years agoIntroduce the notion of "type summary options" as flags that can be passed down to...
Enrico Granata [Thu, 6 Nov 2014 21:23:20 +0000 (21:23 +0000)]
Introduce the notion of "type summary options" as flags that can be passed down to individual summary formatters to alter their behavior in a formatter-dependent way
Two flags are introduced:
- preferred display language (as in, ObjC vs. C++)
- summary capping (as in, should a limit be put to the amount of data retrieved)

The meaning - if any - of these options is for individual formatters to establish
The topic of a subsequent commit will be to actually wire these through to individual data formatters

llvm-svn: 221482

10 years agoReturn a DIDescriptor from CGDebugInfo::getDeclarationOrDefinition...
Frederic Riss [Thu, 6 Nov 2014 21:12:06 +0000 (21:12 +0000)]
Return a DIDescriptor from CGDebugInfo::getDeclarationOrDefinition...

... instead of a DIScope that might wrap something that's not actually
a DIScope (eg. a DIGlobalVariable);

llvm-svn: 221481

10 years agoBase check on the section name, not the variable name.
Rafael Espindola [Thu, 6 Nov 2014 20:01:34 +0000 (20:01 +0000)]
Base check on the section name, not the variable name.

The variable is private, so the name should not be relied on. Also, the
linker uses the sections, so asan should too when trying to avoid causing
the linker problems.

llvm-svn: 221480

10 years agoExplicitly annotate loops we want to run thread-parallel
Tobias Grosser [Thu, 6 Nov 2014 19:35:21 +0000 (19:35 +0000)]
Explicitly annotate loops we want to run thread-parallel

We introduces a new flag -polly-parallel and use it to annotate the for-nodes in
the isl ast that we want to execute thread parallel (e.g., using OpenMP). We
previously already emmitted openmp annotations, but we did this for various
kinds of parallel loops, including some which we can not run in parallel.

With this patch we now have three annotations:

  1) #pragma known-parallel [reduction]
  2) #pragma omp for
  3) #pragma simd

meaning:

  1) loop has no loop carried dependences
  2) loop will be executed thread-parallel
  3) loop can possibly be vectorized

This patch introduces 1) and reduces the use of 2) to only the cases where we
will actually generate thread parallel code.

It is in preparation of openmp code generation in our isl backend.

Legacy:

- We also have a command line option -enable-polly-openmp. This option controls
  the OpenMP code generation in CLooG. It will become an alias of
  -polly-parallel after the CLooG code generation has been dropped.

http://reviews.llvm.org/D6142

llvm-svn: 221479

10 years agoremove unneeded { }
Nick Kledzik [Thu, 6 Nov 2014 19:33:59 +0000 (19:33 +0000)]
remove unneeded { }

llvm-svn: 221478

10 years ago[mach-o] Add support for -force_load option
Nick Kledzik [Thu, 6 Nov 2014 19:33:57 +0000 (19:33 +0000)]
[mach-o] Add support for -force_load option

The darwin linker has two ways to force all members of an archive to be loaded.
The -all_load option applies to all static libraries.  The -force_load takes
a path to a library and just that library's members are force loaded.

llvm-svn: 221477

10 years agoHandle types from the runtime that conform to
Sean Callanan [Thu, 6 Nov 2014 19:26:10 +0000 (19:26 +0000)]
Handle types from the runtime that conform to
protocols.

<rdar://problem/18883778>

llvm-svn: 221476

10 years ago[RegAlloc] Remove reference to the trivial spiller in test case.
Lang Hames [Thu, 6 Nov 2014 19:24:18 +0000 (19:24 +0000)]
[RegAlloc] Remove reference to the trivial spiller in test case.

This test case was never actually testing the trivial spiller: the -spiller
option has not been hooked up for a while now.

llvm-svn: 221475

10 years ago[RegAlloc] Kill off the trivial spiller - nobody is using it any more.
Lang Hames [Thu, 6 Nov 2014 19:12:38 +0000 (19:12 +0000)]
[RegAlloc] Kill off the trivial spiller - nobody is using it any more.

llvm-svn: 221474

10 years ago[mach-o] Update test case to work with latest llvm-objdump output for ARM thumb
Kevin Enderby [Thu, 6 Nov 2014 19:12:28 +0000 (19:12 +0000)]
[mach-o] Update test case to work with latest llvm-objdump output for ARM thumb
code.  Same basic change that was done in r218429 for ARM code.

Where the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler is now
plumbed in with r221470 from the llvm trunk.

llvm-svn: 221473

10 years agoIndentation fixes
Michael Liao [Thu, 6 Nov 2014 19:05:57 +0000 (19:05 +0000)]
Indentation fixes

llvm-svn: 221472

10 years agoTry to appease MSVC buildbots after r221466.
Frederic Riss [Thu, 6 Nov 2014 19:00:47 +0000 (19:00 +0000)]
Try to appease MSVC buildbots after r221466.

llvm-svn: 221471

10 years agoPlumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler and
Kevin Enderby [Thu, 6 Nov 2014 19:00:13 +0000 (19:00 +0000)]
Plumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler and
add the code and test cases for 32-bit ARM symbolizer.

Also fixed the printing of data in code as it was not using the table correctly
and needed to fix one of the test cases too.

This will break lld’s test/mach-o/arm-interworking-movw.yaml till the tweak
for that is made. Which I’ll be committing immediately after this commit.

llvm-svn: 221470

10 years ago[Sanitizer] Introduce "stack_trace_format" runtime flag.
Alexey Samsonov [Thu, 6 Nov 2014 18:43:45 +0000 (18:43 +0000)]
[Sanitizer] Introduce "stack_trace_format" runtime flag.

This flag can be used to specify the format of stack frames - user
can now provide a string with placeholders, which should be printed
for each stack frame with placeholders replaced with actual data.
For example "%p" will be replaced by PC, "%s" will be replaced by
the source file name etc.

"DEFAULT" value enforces default stack trace format currently used in
all the sanitizers except TSan.

This change also implements __sanitizer_print_stack_trace interface
function in TSan.

llvm-svn: 221469

10 years agoPick better floating point numbers (ones that can be exactly represented) in floating...
Greg Clayton [Thu, 6 Nov 2014 18:39:39 +0000 (18:39 +0000)]
Pick better floating point numbers (ones that can be exactly represented) in floating point instead of something that can't to avoid test suite failures on different devices and architectures.

<rdar://problem/18826900>

llvm-svn: 221468

10 years agofixed minor code indenting http://reviews.llvm.org/D6127
Shawn Best [Thu, 6 Nov 2014 17:52:15 +0000 (17:52 +0000)]
fixed minor code indenting  reviews.llvm.org/D6127

llvm-svn: 221467

10 years agoChange DIBuilder::createImportedDeclaration from taking a DIScope to a DIDescriptor.
Frederic Riss [Thu, 6 Nov 2014 17:46:55 +0000 (17:46 +0000)]
Change DIBuilder::createImportedDeclaration from taking a DIScope to a DIDescriptor.

Imported declarations can be DIGlobalVariables which aren't a DIScope. Today
clang (unknowingly I believe) shoehorns these into a DIScope and it all works
just because we never access the fields.

llvm-svn: 221466

10 years ago[Hexagon] Adding basic Hexagon ELF object emitter.
Colin LeMahieu [Thu, 6 Nov 2014 17:05:51 +0000 (17:05 +0000)]
[Hexagon] Adding basic Hexagon ELF object emitter.

llvm-svn: 221465

10 years agoClean up NVPTXLowerStructArgs.cpp. NFC
Eli Bendersky [Thu, 6 Nov 2014 17:05:49 +0000 (17:05 +0000)]
Clean up NVPTXLowerStructArgs.cpp. NFC

* Remove unnecessary const_casts and C-style casts
* Simplify attribute access code
* Simplify ArrayRef creation
* 80-col and clang-format

llvm-svn: 221464

10 years ago[mips] Removed IsSoftFloat from MipsISelLowering::analyzeCallOperands(). NFC
Daniel Sanders [Thu, 6 Nov 2014 16:48:57 +0000 (16:48 +0000)]
[mips] Removed IsSoftFloat from MipsISelLowering::analyzeCallOperands(). NFC

Summary:
It isn't used anymore.

Depends on D6081

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6083

llvm-svn: 221463

10 years ago[Reassociate] Don't reassociate when mixing regular and fast-math FP
Chad Rosier [Thu, 6 Nov 2014 16:46:37 +0000 (16:46 +0000)]
[Reassociate] Don't reassociate when mixing regular and fast-math FP
instructions.  Inlining might cause such cases and it's not valid to
reassociate floating-point instructions without the unsafe algebra flag.

Patch by Mehdi Amini <mehdi_amini@apple.com>!

llvm-svn: 221462

10 years ago[mips] Removed MipsISelLowering::analyzeFormalArguments() in favour of CCState::Analy...
Daniel Sanders [Thu, 6 Nov 2014 16:36:30 +0000 (16:36 +0000)]
[mips] Removed MipsISelLowering::analyzeFormalArguments() in favour of CCState::AnalyzeFormalArguments()

Summary:
As with returns, we must be able to identify f128 arguments despite them
being lowered away. We do this with a pre-analyze step that builds a
vector and then we use this vector from the tablegen-erated code.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6081

llvm-svn: 221461

10 years agoAdd support for UNSUPPORTED tag to lit
Eric Fiselier [Thu, 6 Nov 2014 15:26:20 +0000 (15:26 +0000)]
Add support for UNSUPPORTED tag to lit

llvm-svn: 221460

10 years agoUse FileCheck in a few tests.
Rafael Espindola [Thu, 6 Nov 2014 15:05:51 +0000 (15:05 +0000)]
Use FileCheck in a few tests.

llvm-svn: 221459

10 years agoRemove references to the cortex-a9-mp CPU.
Charlie Turner [Thu, 6 Nov 2014 14:59:30 +0000 (14:59 +0000)]
Remove references to the cortex-a9-mp CPU.

This CPU definition is redundant. The Cortex-A9 is defined as
supporting multiprocessing extensions. Remove references to this CPU.

This CPU was recently removed from LLVM. See http://reviews.llvm.org/D6057

Change-Id: I62ae7cc656fcae54fbaefc4b6976e77e694a8678
llvm-svn: 221458

10 years agoUse GET_CURRENT_FRAME() to calculate the memory layout for power. This works
Will Schmidt [Thu, 6 Nov 2014 14:58:06 +0000 (14:58 +0000)]
Use GET_CURRENT_FRAME() to calculate the memory layout for power. This works
for both PPC64 Big and Little endian modes, so also eliminates the need for
the BIG_ENDIAN/LITTLE_ENDIAN #ifdeffery.

By trial and error, it also looks like the kPPC64_ShadowOffset64 value is
valid using (1ULL << 41) for both BE and LE, so that #if/#elif/#endif block
has also been simplified.

Differential Revision: http://reviews.llvm.org/D6044

llvm-svn: 221457

10 years agoCompute the correct jump table entries on 32 bit windows.
Rafael Espindola [Thu, 6 Nov 2014 14:39:49 +0000 (14:39 +0000)]
Compute the correct jump table entries on 32 bit windows.

On 32 bit windows we use label differences and .set does not suppress
rolocations, a combination that was not used before r220256.

This fixes PR21497.

llvm-svn: 221456

10 years ago[X86] When commuting SSE immediate blend, make sure that the new blend mask is a...
Andrea Di Biagio [Thu, 6 Nov 2014 14:36:45 +0000 (14:36 +0000)]
[X86] When commuting SSE immediate blend, make sure that the new blend mask is a valid imm8.

Example:
define <4 x i32> @test(<4 x i32> %a, <4 x i32> %b) {
  %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 5, i32 6, i32 3>
  ret <4 x i32> %shuffle
}

Before llc (-mattr=+sse4.1), produced the following assembly instruction:
  pblendw $4294967103, %xmm1, %xmm0

After
  pblendw $63, %xmm1, %xmm0

llvm-svn: 221455

10 years agoFixing some -Wcast-qual warnings; NFC.
Aaron Ballman [Thu, 6 Nov 2014 14:32:30 +0000 (14:32 +0000)]
Fixing some -Wcast-qual warnings; NFC.

llvm-svn: 221454

10 years ago[mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.
Toma Tabacu [Thu, 6 Nov 2014 14:25:42 +0000 (14:25 +0000)]
[mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.

Summary:
Currently, we give an error if %z is used with non-immediates, instead of continuing as if the %z isn't there.

For example, you use the %z operand modifier along with the "Jr" constraints ("r" makes the operand a register, and "J" makes it an immediate, but only if its value is 0).
In this case, you want the compiler to print "$0" if the inline asm input operand turns out to be an immediate zero and you want it to print the register containing the operand, if it's not.

We give an error in the latter case, and we shouldn't (GCC also doesn't).

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6023

llvm-svn: 221453

10 years agoFix lldb-mi warnings so that it builds when --enable-werror is set.
Deepak Panickal [Thu, 6 Nov 2014 13:42:49 +0000 (13:42 +0000)]
Fix lldb-mi warnings so that it builds when --enable-werror is set.

llvm-svn: 221452

10 years agoDon't manually insert L prefixes.
Rafael Espindola [Thu, 6 Nov 2014 13:30:38 +0000 (13:30 +0000)]
Don't manually insert L prefixes.

Simply marking the symbol private conveys the desire to hide them to LLVM.

llvm-svn: 221451

10 years ago[mips] Add the following MIPS options that control gp-relative addressing of
Sasa Stankovic [Thu, 6 Nov 2014 13:20:12 +0000 (13:20 +0000)]
[mips] Add the following MIPS options that control gp-relative addressing of
small data items: -mgpopt, -mlocal-sdata, -mextern-sdata. Implement gp-relative
addressing for constants.

Differential Revision: http://reviews.llvm.org/D4903

llvm-svn: 221450

10 years ago[X86] Slightly refactor default features for AMD bdver cpus (NFC). Also add missing...
Andrea Di Biagio [Thu, 6 Nov 2014 12:08:57 +0000 (12:08 +0000)]
[X86] Slightly refactor default features for AMD bdver cpus (NFC). Also add missing checks to test for target features.

This patch simplifies how default target features are set for AMD bdver2
and bdver1. In particular, method 'getDefaultFeatures' now implements a
fallthrough from case 'CK_BDVER2' to case 'CK_BDVER1'.
That is because 'bdver2' has the same features available in bdver1 plus
BMI, FMA, F16C and TBM.

This patch also adds missing checks for predefined macros in test
predefined-arch-macros.c. In the case of BTVER2, the test now also checks
for F16C, BMI and PCLMUL. In the case of BDVER3 and BDVER4, the test now
also checks for the presence of FSGSBASE.

Differential Revision: http://reviews.llvm.org/D6134

llvm-svn: 221449

10 years agoFix for exception specification mismatch in explicit instantiation.
Alexey Bataev [Thu, 6 Nov 2014 10:10:50 +0000 (10:10 +0000)]
Fix for exception specification mismatch in explicit instantiation.
According to C++ standard if an exception-specification is specified in an explicit instantiation directive, it shall be compatible with the exception-specifications of other declarations of that function. This patch adds checks for this.
Differential Revision: http://reviews.llvm.org/D5822

llvm-svn: 221448

10 years ago[mips] Improve error/warning messages and testing for the .cpload assembler directive.
Toma Tabacu [Thu, 6 Nov 2014 10:02:45 +0000 (10:02 +0000)]
[mips] Improve error/warning messages and testing for the .cpload assembler directive.

Summary:
Improved warning message when using .cpload inside a reorder section and added an error message for using .cpload with Mips16 enabled.
Modified the tests to fit with the changes mentioned above, added a test-case for the N32 ABI in cpload.s and did some reformatting to make the tests easier to read.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5465

llvm-svn: 221447

10 years ago[JIT] Fix more missing endian conversions (opcodes for AArch64, ARM, and Mips stub...
Daniel Sanders [Thu, 6 Nov 2014 09:53:05 +0000 (09:53 +0000)]
[JIT] Fix more missing endian conversions (opcodes for AArch64, ARM, and Mips stub functions, and ARM target in general)

Summary:
Fixed all of the missing endian conversions that Lang Hames and I identified in
RuntimeDyldMachOARM.h.

Fixed the opcode emission in RuntimeDyldImpl::createStubFunction() for AArch64,
ARM, Mips when the host endian doesn't match the target endian.
PowerPC will need changing if it's opcodes are affected by endianness but I've
left this for now since I'm unsure if this is the case and it's the only path
that specifies the target endian.

This patch fixes MachO_ARM_PIC_relocations.s on a big-endian Mips host. This
is the last of the known issues on this host.

Reviewers: lhames

Reviewed By: lhames

Subscribers: aemerson, llvm-commits

Differential Revision: http://reviews.llvm.org/D6130

llvm-svn: 221446

10 years agoUBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbases
David Majnemer [Thu, 6 Nov 2014 08:55:23 +0000 (08:55 +0000)]
UBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbases

When the __virtual_mask is set, __offset_flags >> __offset_shift yields
an offset into the vtable.  Dereferencing this vtable slot gets us the
vbase offset.

Adjust a test case to verify that this, in fact, works.

Differential Revision: http://reviews.llvm.org/D6074

llvm-svn: 221445

10 years agoObject, COFF: Infer symbol sizes from adjacent symbols
David Majnemer [Thu, 6 Nov 2014 08:10:41 +0000 (08:10 +0000)]
Object, COFF: Infer symbol sizes from adjacent symbols

Use the position of the subsequent symbol in the object file to infer
the size of it's predecessor.  I hope to eventually remove whatever COFF
specific details from this little algorithm so that we can unify this
logic with what Mach-O does.

llvm-svn: 221444

10 years agoX86, MC: Tidy up some whitespace in GetRelocType
David Majnemer [Thu, 6 Nov 2014 08:10:37 +0000 (08:10 +0000)]
X86, MC: Tidy up some whitespace in GetRelocType

No functionality change intended.

llvm-svn: 221443

10 years ago[Mips] Take into account that PIC code is inherently CPIC
Simon Atanasyan [Thu, 6 Nov 2014 07:07:29 +0000 (07:07 +0000)]
[Mips] Take into account that PIC code is inherently CPIC

Follow-up to r221439.

llvm-svn: 221442

10 years agoGCOV: Make sure that function idents in the .gcda and .gcno match
Justin Bogner [Thu, 6 Nov 2014 06:55:02 +0000 (06:55 +0000)]
GCOV: Make sure that function idents in the .gcda and .gcno match

When generating gcov compatible profiling, we sometimes skip emitting
data for functions for one reason or another. However, this was
emitting different function IDs in the .gcno and .gcda files, because
the .gcno case was using the loop index before skipping functions and
the .gcda the array index after. This resulted in completely invalid
gcov data.

This fixes the problem by making the .gcno loop track the ID
separately from the loop index.

llvm-svn: 221441

10 years ago[Mips] Follow-up to r221439. Include header to fix build on Windows.
Simon Atanasyan [Thu, 6 Nov 2014 06:28:40 +0000 (06:28 +0000)]
[Mips] Follow-up to r221439. Include header to fix build on Windows.

llvm-svn: 221440

10 years ago[Mips] Check ELF flags to prevent linking of incompatible files
Simon Atanasyan [Thu, 6 Nov 2014 05:53:10 +0000 (05:53 +0000)]
[Mips] Check ELF flags to prevent linking of incompatible files

1. The path checks ELF header flags to prevent linking of incompatible files.
   For example we do not allow to link files with different ABI, -mnan
   flags, some combination of target CPU etc.
2. The patch merge ELF header flags from input object files to put their
   combination to the generated file. For example, if some input files
   have EF_MIPS_NOREORDER flag we need to put this flag to the output
   file header.

I use the `parseFile()` (not `canParse()`) method because in case of
recognition of incorrect input flags combination we should show detailed
error message and stop the linking process and should not try to use
another `Reader`.

llvm-svn: 221439

10 years ago[Mips] Fix ELF flags for the non-PIC object file used in the test
Simon Atanasyan [Thu, 6 Nov 2014 05:52:54 +0000 (05:52 +0000)]
[Mips] Fix ELF flags for the non-PIC object file used in the test

No functional changes.

llvm-svn: 221438