oota-llvm.git
8 years ago[X86][AVX512] Added support for AVX512 UNPCK shuffle decode comments.
Simon Pilgrim [Tue, 17 Nov 2015 22:35:45 +0000 (22:35 +0000)]
[X86][AVX512] Added support for AVX512 UNPCK shuffle decode comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253391 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-profdata] Improve error messaging when merging mismatched profile data
Nathan Slingerland [Tue, 17 Nov 2015 22:08:53 +0000 (22:08 +0000)]
[llvm-profdata] Improve error messaging when merging mismatched profile data

Summary:
This change tries to make the root cause of instrumented profile data merge failures clearer.

Previous:

$ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata
test_1.profraw: foo: Function count mismatch
test_1.profraw: bar: Function count mismatch
test_1.profraw: baz: Function count mismatch
...

Changed:

$ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata
test_1.profraw: foo: Function basic block count change detected (counter mismatch)
Make sure that all profile data to be merged is generated from the same binary.
test_1.profraw: bar: Function basic block count change detected (counter mismatch)
test_1.profraw: baz: Function basic block count change detected (counter mismatch)
...

Reviewers: dnovillo, davidxl, bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253384 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Share AVX1/AVX2 shuffle tests with AVX512 where possible
Simon Pilgrim [Tue, 17 Nov 2015 21:19:45 +0000 (21:19 +0000)]
[X86][SSE] Share AVX1/AVX2 shuffle tests with AVX512 where possible

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253379 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Move WinEHFuncInfo from MachineModuleInfo to MachineFunction
Reid Kleckner [Tue, 17 Nov 2015 21:10:25 +0000 (21:10 +0000)]
[WinEH] Move WinEHFuncInfo from MachineModuleInfo to MachineFunction

Summary:
Now that there is a one-to-one mapping from MachineFunction to
WinEHFuncInfo, we don't need to use a DenseMap to select the right
WinEHFuncInfo for the current funclet.

The main challenge here is that X86WinEHStatePass is an IR pass that
doesn't have access to the MachineFunction. I gave it its own
WinEHFuncInfo object that it uses to calculate state numbers, which it
then throws away. As long as nobody creates or removes EH pads between
this pass and SDAG construction, we will get the same state numbers.

The other thing X86WinEHStatePass does is to mark the EH registration
node. Instead of communicating which alloca was the registration through
WinEHFuncInfo, I added the llvm.x86.seh.ehregnode intrinsic.  This
intrinsic generates no code and simply marks the alloca in use.

Reviewers: JCTremoulet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253378 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agodwarfdump: Reference the appropriate line table segment when dumping dwp files
David Blaikie [Tue, 17 Nov 2015 21:08:05 +0000 (21:08 +0000)]
dwarfdump: Reference the appropriate line table segment when dumping dwp files

Also improves .dwo type unit dumping which didn't handle this either.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253377 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix -Wunused-function in a non-Win32 build
David Blaikie [Tue, 17 Nov 2015 20:38:54 +0000 (20:38 +0000)]
Fix -Wunused-function in a non-Win32 build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253373 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[EH] Keep filter clauses for types that have been caught.
Andrew Kaylor [Tue, 17 Nov 2015 20:13:04 +0000 (20:13 +0000)]
[EH] Keep filter clauses for types that have been caught.

The instruction combiner previously removed types from filter clauses in Landing Pad instructions if the type had previously been seen in a catch clause.  This is incorrect and prevents unexpected exception handlers from rethrowing the caught type.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253370 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RuntimeDyld] Fix resolving R_PPC64_REL24 relocations
Ulrich Weigand [Tue, 17 Nov 2015 20:08:31 +0000 (20:08 +0000)]
[RuntimeDyld] Fix resolving R_PPC64_REL24 relocations

When resolving R_PPC64_REL24, code used to check for an address delta
that fits in 24 bits, while the instructions that take this relocation
actually can process address deltas that fit into *26* bits (as those
instructions have a 24 bit field, but implicitly append two zero bits
at the end since all instruction addresses are a multiple of 4).

This means that code would signal overflow once a single object's text
section exceeds 8 MB, while we can actually support up to 32 MB.

Partially fixes PR25540.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253369 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoadding sancov to Makefile directory list.
Mike Aizatsky [Tue, 17 Nov 2015 20:02:03 +0000 (20:02 +0000)]
adding sancov to Makefile directory list.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253368 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSwitch lto codegen to using diagnostic handlers.
Yunzhong Gao [Tue, 17 Nov 2015 19:48:12 +0000 (19:48 +0000)]
Switch lto codegen to using diagnostic handlers.

This patch removes the std::string& argument from a number of C++ LTO API calls
and instead makes them use the installed diagnostic handler. This would also
improve consistency of diagnostic handling infrastructure: if an LTO client used
lto_codegen_set_diagnostic_handler() to install a custom error handler, we do
not want some error messages to go through the custom error handler, and some
other error messages to go into sLastErrorString.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253367 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSpecify explicit storage type for AllocType. NFC.
George Burgess IV [Tue, 17 Nov 2015 19:48:06 +0000 (19:48 +0000)]
Specify explicit storage type for AllocType. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253366 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoVector of pointers in function attributes calculation
Elena Demikhovsky [Tue, 17 Nov 2015 19:30:51 +0000 (19:30 +0000)]
Vector of pointers in function attributes calculation

While setting function attributes we check all instructions that may access memory. For a call instruction we check all arguments. The special check is required for pointers.
I added vector-of-pointers to the call arguments types that should be checked.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253363 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSamplePGO - Move debug/dump function bodies out of header files. NFC.
Diego Novillo [Tue, 17 Nov 2015 19:04:46 +0000 (19:04 +0000)]
SamplePGO - Move debug/dump function bodies out of header files. NFC.

No point polluting the header declarations with debugging code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253361 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoStringRef-ify some Option APIs
David Blaikie [Tue, 17 Nov 2015 19:00:52 +0000 (19:00 +0000)]
StringRef-ify some Option APIs

Patch by Eugene Kosov!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253360 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agofix typos; NFC
Sanjay Patel [Tue, 17 Nov 2015 18:46:56 +0000 (18:46 +0000)]
fix typos; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253359 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agouse local variables; NFCI
Sanjay Patel [Tue, 17 Nov 2015 18:37:23 +0000 (18:37 +0000)]
use local variables; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253356 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoenabling sancov tests on linux x86_64 only
Mike Aizatsky [Tue, 17 Nov 2015 18:25:21 +0000 (18:25 +0000)]
enabling sancov tests on linux x86_64 only

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253354 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Don't pessimize i32 vselect.
Charlie Turner [Tue, 17 Nov 2015 17:25:15 +0000 (17:25 +0000)]
[ARM] Don't pessimize i32 vselect.

The underlying issues surrounding codegen for 32-bit vselects have been resolved. The pessimistic costs for 64-bit vselects remain due to the bad
scalarization that is still happening there.

I tested this on A57 in T32, A32 and A64 modes. I saw no regressions, and some improvements.

From my benchmarks, I saw these improvements in A57 (T32)
spec.cpu2000.ref.177_mesa 5.95%
lnt.SingleSource/Benchmarks/Shootout/strcat 12.93%
lnt.MultiSource/Benchmarks/MiBench/telecomm-CRC32/telecomm-CRC32 11.89%

I also measured A57 A32, A53 T32 and A9 T32 and found no performance regressions. I see much bigger wins in third-party benchmarks with this change

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253349 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agofunction names start with a lower case letter; NFC
Sanjay Patel [Tue, 17 Nov 2015 17:24:08 +0000 (17:24 +0000)]
function names start with a lower case letter; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253348 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support] Tweak path::system_temp_directory() on Windows.
Pawel Bylica [Tue, 17 Nov 2015 16:54:32 +0000 (16:54 +0000)]
[Support] Tweak path::system_temp_directory() on Windows.

Summary:
This patch changes the behavior of path::system_temp_directory() on Windows to be closer to GetTempPath Windows API call. Enforces path separator to be the native one, makes path absolute, etc. GetTempPath is not used directly because of limitations/implementation bugs on Windows 7.

Windows specific unit tests are added. Most of them runs in separated process with modified environment variables.

This change fixes FileSystemTest.CreateDir unittest that had been failing when run from Unix-like shell on Windows (Unix-like path separator (/) used in env variables).

Reviewers: chapuni, rafael, aaron.ballman

Subscribers: rafael, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253345 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Promote f16 SELECT_CC CC operands when op is legal.
Ahmed Bougacha [Tue, 17 Nov 2015 16:45:40 +0000 (16:45 +0000)]
[AArch64] Promote f16 SELECT_CC CC operands when op is legal.

SELECT_CC has the nasty property of having operands with unrelated
types. So if you do something like:

  f32 = select_cc f16, f16, f32, f32, cc

You'd only look for the action for <select_cc, f32>, but never f16.
If the types are all legal, but the op isn't (as for f16 on AArch64,
or for f128 on x86_64/AArch64?), then you get into trouble.
For f128, we have softenSetCCOperands to handle this case.

Similarly, for f16, we can directly promote the CC operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253344 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-rtdyld] Don't waste cycles invalidating instruction cache.
Davide Italiano [Tue, 17 Nov 2015 16:37:52 +0000 (16:37 +0000)]
[llvm-rtdyld] Don't waste cycles invalidating instruction cache.

Now that setExecutable() changed to do all the ground work to make
memory executable on the host, we can remove all (redundant) calls
to invalidate instruction cache here.

As an added bonus, this makes invalidateInstructionCache() dead
code, so it can be removed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253343 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[JIT/Memory] Fix up semantic of setExecutable().
Davide Italiano [Tue, 17 Nov 2015 16:34:28 +0000 (16:34 +0000)]
[JIT/Memory] Fix up semantic of setExecutable().

setExecutable() should do everything that's needed to make the memory
executable on host, i.e. unconditionally set permissions + invalidate
instruction cache. llvm-rtdyld will be updated in my next commit.

Discusseed with: Lang Hames (as part of D13631).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253341 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpdate DebugInfo tests for the change in DEBUG_VALUE output in r253338.
Dan Gohman [Tue, 17 Nov 2015 16:15:11 +0000 (16:15 +0000)]
Update DebugInfo tests for the change in DEBUG_VALUE output in r253338.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253340 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLower statepoints with multi-def targets.
Pat Gavlin [Tue, 17 Nov 2015 16:04:21 +0000 (16:04 +0000)]
Lower statepoints with multi-def targets.

Statepoint lowering currently expects that the target method of a
statepoint only defines a single value. This precludes using
statepoints with ABIs that return values in multiple registers
(e.g. the SysV AMD64 ABI). This change adds support for lowering
statepoints with mutli-def targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253339 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse TargetRegisterInfo for printing MachineOperand register comments
Dan Gohman [Tue, 17 Nov 2015 16:01:28 +0000 (16:01 +0000)]
Use TargetRegisterInfo for printing MachineOperand register comments

Several places in AsmPrinter.cpp print comments describing MachineOperand
registers using MCRegisterInfo, which uses MCOperand-oriented names. This
doesn't work for targets that use virtual registers exclusively, as
WebAssembly does, since virtual registers are represented and printed
differently.

This patch preserves what seems to be the spirit of r229978, avoiding the
use of TM.getSubtargetImpl(), while still using MachineOperand-oriented
printing for MachineOperands.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253338 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTypo.
Chad Rosier [Tue, 17 Nov 2015 13:58:10 +0000 (13:58 +0000)]
Typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253336 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Default to ARMv4t in favour of adding Other to ARMArch
Bradley Smith [Tue, 17 Nov 2015 13:38:29 +0000 (13:38 +0000)]
[ARM] Default to ARMv4t in favour of adding Other to ARMArch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253335 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Match VABDL from log2 shuffles.
Charlie Turner [Tue, 17 Nov 2015 13:21:35 +0000 (13:21 +0000)]
[ARM] Match VABDL from log2 shuffles.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253334 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][microMIPS] Implement EXTP, EXTPDP, EXTPDPV, EXTPV, EXTR[_RS].W, EXTR_S.H,...
Zlatko Buljan [Tue, 17 Nov 2015 12:54:15 +0000 (12:54 +0000)]
[mips][microMIPS] Implement EXTP, EXTPDP, EXTPDPV, EXTPV, EXTR[_RS].W, EXTR_S.H, EXTRV[_RS].W and EXTRV_S.H instructions
Differential Revision: http://reviews.llvm.org/D14174

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253332 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Properly initialize ARMArch in the ARM subtarget
Bradley Smith [Tue, 17 Nov 2015 11:57:33 +0000 (11:57 +0000)]
[ARM] Properly initialize ARMArch in the ARM subtarget

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253331 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][microMIPS] Implement SUBQ[_S].PH, SUBQ_S.W, SUBQH[_R].PH, SUBQH[_R].W, SUBU...
Zlatko Buljan [Tue, 17 Nov 2015 10:11:22 +0000 (10:11 +0000)]
[mips][microMIPS] Implement SUBQ[_S].PH, SUBQ_S.W, SUBQH[_R].PH, SUBQH[_R].W, SUBU[_S].PH, SUBU[_S].QB and SUBUH[_R].QB instructions
Differential Revision: http://reviews.llvm.org/D14114

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253329 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Assembler] Make fatal assembler errors non-fatal
Oliver Stannard [Tue, 17 Nov 2015 10:00:43 +0000 (10:00 +0000)]
[Assembler] Make fatal assembler errors non-fatal

Currently, if the assembler encounters an error after parsing (such as an
out-of-range fixup), it reports this as a fatal error, and so stops after the
first error. However, for most of these there is an obvious way to recover
after emitting the error, such as emitting the fixup with a value of zero. This
means that we can report on all of the errors in a file, not just the first
one. MCContext::reportError records the fact that an error was encountered, so
we won't actually emit an object file with the incorrect contents.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253328 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Assembler] Allow non-fatal errors after parsing
Oliver Stannard [Tue, 17 Nov 2015 09:58:07 +0000 (09:58 +0000)]
[Assembler] Allow non-fatal errors after parsing

This adds reportError to MCContext, which can be used as an alternative to
reportFatalError when the assembler wants to try to continue processing the
rest of the file after the error is reported, so that all of the errors ina
file can be reported. It records the fact that an error was encountered, so we
can avoid emitting an object file if any errors occurred.

This patch doesn't add any uses of this function (a later patch will convert
most uses of reportFatalError to use it), but there is a small functional
change: we use the SourceManager to print the error message, even if we have a
null SMLoc. This means that we get a SourceManager-style message, with the file
and line information shown as <unknown>, rather than the "LLVM ERROR" style
used by report_fatal_error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253327 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][microMIPS] Implement PRECEQ.W.PHL, PRECEQ.W.PHR, PRECEQU.PH.QBL, PRECEQU.PH...
Zlatko Buljan [Tue, 17 Nov 2015 09:43:29 +0000 (09:43 +0000)]
[mips][microMIPS] Implement PRECEQ.W.PHL, PRECEQ.W.PHR, PRECEQU.PH.QBL, PRECEQU.PH.QBLA, PRECEQU.PH.QBR, PRECEQU.PH.QBRA, PRECEU.PH.QBL, PRECEU.PH.QBLA, PRECEU.PH.QBR and PRECEU.PH.QBRA instructions
Differential Revision: http://reviews.llvm.org/D14279

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253326 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix typos in comments.
Jay Foad [Tue, 17 Nov 2015 08:54:53 +0000 (08:54 +0000)]
Fix typos in comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253324 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AliasAnalysis] CatchPad and CatchRet can modify escaped memory
David Majnemer [Tue, 17 Nov 2015 08:15:14 +0000 (08:15 +0000)]
[AliasAnalysis] CatchPad and CatchRet can modify escaped memory

CatchPad and CatchRet behave a lot like function calls: they can
potentially modify any memory which has been escaped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253323 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix a typo in BasicAliasAnalysis
David Majnemer [Tue, 17 Nov 2015 08:15:08 +0000 (08:15 +0000)]
Fix a typo in BasicAliasAnalysis

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253322 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAVX512 : regenerate the test file against trunk.
Igor Breger [Tue, 17 Nov 2015 08:03:43 +0000 (08:03 +0000)]
AVX512 : regenerate the test file against trunk.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253321 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdded microMIPSDSPr1 assembler and disassembler tests to existing microMIPSDSPr2...
Zlatko Buljan [Tue, 17 Nov 2015 07:58:27 +0000 (07:58 +0000)]
Added microMIPSDSPr1 assembler and disassembler tests to existing microMIPSDSPr2 test files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253320 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd MemoryBufferRef(MemoryBuffer&) constructor.
Rafael Espindola [Tue, 17 Nov 2015 05:11:44 +0000 (05:11 +0000)]
Add MemoryBufferRef(MemoryBuffer&) constructor.

patch by Jonathan Anderson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253311 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix unaligned memory read issue exposed by ubsan
Xinliang David Li [Tue, 17 Nov 2015 03:47:21 +0000 (03:47 +0000)]
Fix unaligned memory read issue exposed by ubsan

Indexed profile data as designed today does not guarantee
counter data to be well aligned, so reading needs to use
the slower form (with memcpy). This is less than ideal and
should be improved in the future (i.e., with fixed length
function key instead of variable length name key).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253309 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Documentation] Add guidelines for grouping tests together.
Davide Italiano [Tue, 17 Nov 2015 02:17:35 +0000 (02:17 +0000)]
[Documentation] Add guidelines for grouping tests together.

This was considered a good practice but it was not documented. Now it is.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253281 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDrop prelink support.
Rafael Espindola [Tue, 17 Nov 2015 00:51:23 +0000 (00:51 +0000)]
Drop prelink support.

The way prelink used to work was

* The compiler decides if a given section only has relocations that
are know to point to the same DSO. If so, it names it
.data.rel.ro.local<something>.
* The static linker puts all of these together.
* The prelinker program assigns addresses to each library and resolves
the local relocations.

There are many problems with this:
* It is incompatible with address space randomization.
* The information passed by the compiler is redundant. The linker
knows if a given relocation is in the same DSO or not. If could sort
by that if so desired.
* There are newer ways of speeding up DSO (gnu hash for example).
* Even if we want to implement this again in the compiler, the previous
  implementation is pretty broken. It talks about relocations that are
  "resolved by the static linker". If they are resolved, there are none
  left for the prelinker. What one needs to track is if an expression
  will require only dynamic relocations that point to the same DSO.

At this point it looks like the prelinker is an historical curiosity.
For example, fedora has retired it because it failed to build for two
releases
(http://pkgs.fedoraproject.org/cgit/prelink.git/commit/?id=eb43100a8331d91c801ee3dcdb0a0bb9babfdc1f)

This patch removes support for it. That is, it stops printing the
".local" sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253280 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAssume lane masks are always precise
Matthias Braun [Tue, 17 Nov 2015 00:50:55 +0000 (00:50 +0000)]
Assume lane masks are always precise

Allowing imprecise lane masks in case of more than 32 sub register lanes
lead to some tricky corner cases, and I need another bugfix for another
one. Instead I rather declare lane masks as precise and let tablegen
abort if we do not have enough bits.

This does not affect any in-tree target, even AMDGPU only needs 16 lanes
at the moment. If the 32 lanes turn out to be a problem in the future,
then we can easily change the LaneBitmask typedef to uint64_t.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253279 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix indentation
David Blaikie [Tue, 17 Nov 2015 00:41:02 +0000 (00:41 +0000)]
Fix indentation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253278 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agodwarfdump: Use the index to find the right abbrev offset in DWP files
David Blaikie [Tue, 17 Nov 2015 00:39:55 +0000 (00:39 +0000)]
dwarfdump: Use the index to find the right abbrev offset in DWP files

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253277 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Fix printing of global operands
Derek Schuff [Tue, 17 Nov 2015 00:20:44 +0000 (00:20 +0000)]
[WebAssembly] Fix printing of global operands

This was regressed in r252656 which wasn't quite NFC. Instead of using a
custom instruction as before, use a pattern to select CONST_I32 for the
global addrs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253276 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PRE] Preserve !invariant.load metadata
Philip Reames [Tue, 17 Nov 2015 00:15:09 +0000 (00:15 +0000)]
[PRE] Preserve !invariant.load metadata

Spoted via inspection.  Test case included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253275 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Merged BLEND shuffle decode comments. NFC.
Simon Pilgrim [Mon, 16 Nov 2015 23:03:18 +0000 (23:03 +0000)]
[X86][SSE] Merged BLEND shuffle decode comments. NFC.

Now that we can recognise different vector sizes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253268 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDemote a single-use named function object to a lambda
David Blaikie [Mon, 16 Nov 2015 22:56:30 +0000 (22:56 +0000)]
Demote a single-use named function object to a lambda

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253267 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Merged ALIGNR/SLLDQ/SRLDQ shuffle decode comments. NFC.
Simon Pilgrim [Mon, 16 Nov 2015 22:54:41 +0000 (22:54 +0000)]
[X86][SSE] Merged ALIGNR/SLLDQ/SRLDQ shuffle decode comments. NFC.

Now that we can recognise different vector sizes - will make future AVX512 additions easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253266 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Merged SHUF/PERM shuffle decode comments. NFC.
Simon Pilgrim [Mon, 16 Nov 2015 22:39:27 +0000 (22:39 +0000)]
[X86][SSE] Merged SHUF/PERM shuffle decode comments. NFC.

Now that we can recognise different vector sizes - will make future AVX512 additions easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253260 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Merged UNPCK shuffle decode comments. NFC.
Simon Pilgrim [Mon, 16 Nov 2015 22:21:10 +0000 (22:21 +0000)]
[X86][SSE] Merged UNPCK shuffle decode comments. NFC.

Now that we can recognise different vector sizes - will make future AVX512 additions easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253258 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agouse range-based for loop; NFCI
Sanjay Patel [Mon, 16 Nov 2015 22:16:52 +0000 (22:16 +0000)]
use range-based for loop; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253256 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd isInteger() to APFloat.
Stephen Canon [Mon, 16 Nov 2015 21:52:48 +0000 (21:52 +0000)]
Add isInteger() to APFloat.

Useful utility function; this wasn't too hard to do before, but also wasn't
obviously discoverable.  Make it explicit.  Reviewed offline by Michael
Gottesman.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253254 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PR25538]: Fix a failure caused by r253126.
Michael Zolotukhin [Mon, 16 Nov 2015 21:17:26 +0000 (21:17 +0000)]
[PR25538]: Fix a failure caused by r253126.

In r253126 we stopped to recompute LCSSA after loop unrolling in all
cases, except the unrolling is full and at least one of the loop exits
is outside the parent loop. In other cases the transformation should not
break LCSSA, but it turned out, that we also call SimplifyLoop on the
parent loop, which might break LCSSA by itself. This fix just triggers
LCSSA recomputation in this case as well.

I'm committing it without a test case for now, but I'll try to invent
one. It's a bit tricky because in an isolated test LoopSimplify would
be scheduled before LoopUnroll, and thus will change the test and hide
the problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253253 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Fix function return type printing
Derek Schuff [Mon, 16 Nov 2015 21:12:41 +0000 (21:12 +0000)]
[WebAssembly] Fix function return type printing

Summary:
Previously return type information for a function was derived from
return dag nodes. But this didn't work for dags with != return node. So
instead compute it directly from the LLVM function as is done for imports.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253251 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Reverse the order of operands for br_if
Derek Schuff [Mon, 16 Nov 2015 21:04:51 +0000 (21:04 +0000)]
[WebAssembly] Reverse the order of operands for br_if

Summary: This is to match the new version in the spec

Reviewers: sunfish

Subscribers: jfb, llvm-commits, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253249 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IR] Manage TheNoneToken with a std::unique_ptr
David Majnemer [Mon, 16 Nov 2015 20:55:57 +0000 (20:55 +0000)]
[IR] Manage TheNoneToken with a std::unique_ptr

Hopefully, this will make the sanitizer build bots happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253248 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFind available scratch register to use in function prologue and epilogue as part...
Kit Barton [Mon, 16 Nov 2015 20:22:15 +0000 (20:22 +0000)]
Find available scratch register to use in function prologue and epilogue as part of shrink wrapping.

Phabricator: http://reviews.llvm.org/D13955

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253247 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Don't let UnwindHelp alias the return address
Reid Kleckner [Mon, 16 Nov 2015 18:47:25 +0000 (18:47 +0000)]
[WinEH] Don't let UnwindHelp alias the return address

On top of that, don't bother allocating and initializing UnwindHelp if
we don't have any funclets. Currently we always use RBP as our frame
pointer when funclets are present, so this change makes it impossible to
come here without any fixed stack objects.

Fixes PR25533.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253245 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse the subtarget reference that we already have
Reid Kleckner [Mon, 16 Nov 2015 18:47:12 +0000 (18:47 +0000)]
Use the subtarget reference that we already have

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253244 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd intermediate subtract instructions to reassociation worklist.
Owen Anderson [Mon, 16 Nov 2015 18:07:30 +0000 (18:07 +0000)]
Add intermediate subtract instructions to reassociation worklist.

We sometimes create intermediate subtract instructions during
reassociation.  Adding these to the worklist to revisit exposes many
additional reassociation opportunities.

Patch by Aditya Nandakumar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253240 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopStrengthReduce] Don't increment iterator past the end of the BB
David Majnemer [Mon, 16 Nov 2015 17:37:58 +0000 (17:37 +0000)]
[LoopStrengthReduce] Don't increment iterator past the end of the BB

We tried to move the insertion point beyond instructions like landingpad
and cleanuppad.
However, we *also* tried to move past catchpad.  This is problematic
because catchpad is also a terminator.

This fixes PR25541.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253238 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Disable code generation through FastISel for MIPS32R6.
Vasileios Kalintiris [Mon, 16 Nov 2015 17:05:01 +0000 (17:05 +0000)]
[mips] Disable code generation through FastISel for MIPS32R6.

Reviewers: dsanders

Subscribers: llvm-commits, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253225 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SimplifyLibCalls] Generalize a comment. This doesn't apply only to sqrt.
Davide Italiano [Mon, 16 Nov 2015 16:54:28 +0000 (16:54 +0000)]
[SimplifyLibCalls] Generalize a comment. This doesn't apply only to sqrt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253224 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Prevent use of a value pointed by end() iterator when placing a jump table
Petr Pavlu [Mon, 16 Nov 2015 16:41:13 +0000 (16:41 +0000)]
[ARM] Prevent use of a value pointed by end() iterator when placing a jump table

Function ARMConstantIslands::doInitialJumpTablePlacement() iterates over all
basic blocks in a machine function. It calls `MI = MBB.getLastNonDebugInstr()`
to get the last instruction in each block and then uses MI->getOpcode() to
decide what to do. If getLastNonDebugInstr() returns MBB.end() (for example,
when the block does not contain any instructions) then calling getOpcode() on
this value is incorrect. Avoid this problem by checking the result of
getLastNonDebugInstr().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253222 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM,AArch64] Store source location of asm constant pool entries
Oliver Stannard [Mon, 16 Nov 2015 16:25:47 +0000 (16:25 +0000)]
[ARM,AArch64] Store source location of asm constant pool entries

Storing the source location of the expression that created a constant pool
entry allows us to emit better error messages if we later discover that the
expression cannot be represented by a relocation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253220 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM,AArch64] Store source location for values in assembly files
Oliver Stannard [Mon, 16 Nov 2015 16:22:47 +0000 (16:22 +0000)]
[ARM,AArch64] Store source location for values in assembly files

The MCValue class can store a SMLoc to allow better error messages to be
emitted if an error is detected after parsing. The ARM and AArch64 assembly
parsers were not setting this, so error messages did not have source
information.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253219 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Prototype passes for register coloring and register stackifying.
Dan Gohman [Mon, 16 Nov 2015 16:18:28 +0000 (16:18 +0000)]
[WebAssembly] Prototype passes for register coloring and register stackifying.

These passes are not yet enabled by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253217 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][ias] Remove spurious ';' from inline assembly test.
Daniel Sanders [Mon, 16 Nov 2015 14:19:32 +0000 (14:19 +0000)]
[mips][ias] Remove spurious ';' from inline assembly test.

IAS will not emit it. NFC at the moment but will prevent a test failure once
IAS is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253210 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][ias] Accept $31 or $ra in hf16call32.ll. IAS prints the latter.
Daniel Sanders [Mon, 16 Nov 2015 14:16:45 +0000 (14:16 +0000)]
[mips][ias] Accept $31 or $ra in hf16call32.ll. IAS prints the latter.

NFC at the moment, but it will prevent a test failure once IAS is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253209 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][ias] Allow whitespace after commas in inlineasm*.ll tests.
Daniel Sanders [Mon, 16 Nov 2015 14:14:59 +0000 (14:14 +0000)]
[mips][ias] Allow whitespace after commas in inlineasm*.ll tests.

IAS always prints whitespace after a comma. NFC at the moment but this will
prevent failures when IAS is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253208 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoHandle ARMv6KZ naming
Artyom Skrobov [Mon, 16 Nov 2015 14:05:32 +0000 (14:05 +0000)]
Handle ARMv6KZ naming

Summary:
* ARMv6KZ is the "canonical" name, given in the ARMARM
* ARMv6Z is an "official abbreviation" for it, mentioned in the ARMARM
* ARMv6ZK is a popular misspelling, which we should support as an alias.

The patch corrects the handling of the names.

Functional changes:
* ARMv6Z no longer treated as an architecture in its own right
* ARMv6ZK renamed to ARMv6KZ, accepting ARMv6ZK as an alias
* arm1176jz-s and arm1176jzf-s recognized as ARMv6ZK, instead of ARMv6K
* default ARMv6K CPU changed to arm1176j-s

Reviewers: rengolin, logan, compnerd

Subscribers: aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253206 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC refactorings in lib/Support/TargetParser.cpp
Artyom Skrobov [Mon, 16 Nov 2015 12:08:05 +0000 (12:08 +0000)]
NFC refactorings in lib/Support/TargetParser.cpp

Summary:
* declare FPUNames, ARCHNames, ARCHExtNames, HWDivNames, CPUNames
  as static const
* implement getDefaultExtensions with a StringSwitch, in the same
  way getDefaultFPU is implemented

Reviewers: rengolin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253201 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Allow TargetParser to accurately target architectures
Bradley Smith [Mon, 16 Nov 2015 11:15:22 +0000 (11:15 +0000)]
[ARM] Allow TargetParser to accurately target architectures

Instead of defaulting to an empty string, we want to default to
the CPU 'generic' in the case of no valid default CPU being found,
(as long as the architecture is actually valid).

In order to do this we add a default FPU for each architecture, as
well as falling back to architecture defaults for extensions and FPU
in the case of a generic CPU is specified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253198 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Introduce subtarget features per ARM architecture.
Bradley Smith [Mon, 16 Nov 2015 11:10:19 +0000 (11:10 +0000)]
[ARM] Introduce subtarget features per ARM architecture.

This allows for accurate architecture targeting as well as removing
duplicate information (hardcoded feature strings) from MCTargetDesc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253196 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoProperly check if a CMPZ node is in fact comparing against zero
James Molloy [Mon, 16 Nov 2015 10:49:25 +0000 (10:49 +0000)]
Properly check if a CMPZ node is in fact comparing against zero

This was left implicit and never ever checked, which means we could have a CMPZ against some non-zero value and we were carrying on with BFI conversion regardless.

Caught by Oliver Stannard using csmith; regression test added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253195 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDon't generate discriminators for calls to debug intrinsics
Pavel Labath [Mon, 16 Nov 2015 10:40:38 +0000 (10:40 +0000)]
Don't generate discriminators for calls to debug intrinsics

Summary:
This fails a check in Verifier.cpp, which checks for location matches between the declared
variable and the !dbg attachments.

Reviewers: dnovillo, dblaikie, danielcdh

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253194 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] ldr= pseudo-instruction silently ignored if register invalid
Oliver Stannard [Mon, 16 Nov 2015 10:25:19 +0000 (10:25 +0000)]
[AArch64] ldr= pseudo-instruction silently ignored if register invalid

The AArch64 assembler was silently ignoring instructions like this:
  ldr foo, =bar

AArch64AsmParser::parseOperand was returning true as the parse failed, but was
not calling AArch64AsmParser::Error to report this to the user, so the
instruction was ignored without printing an error message.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253193 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalOpt] Address post-commit review comments on r253168
James Molloy [Mon, 16 Nov 2015 10:16:22 +0000 (10:16 +0000)]
[GlobalOpt] Address post-commit review comments on r253168

Address Duncan Exon Smith's comments on D14148, which was added after the patch had been LGTM'd and committed:
  * clang-format one area where whitespace diffs occurred.
  * Add a threshold to limit the store/load dominance checks as they are quadratic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253192 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMove helper classes into anonymous namespaces. NFC.
Benjamin Kramer [Mon, 16 Nov 2015 09:01:28 +0000 (09:01 +0000)]
Move helper classes into anonymous namespaces. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253189 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix r253186 test case
Keno Fischer [Mon, 16 Nov 2015 08:25:14 +0000 (08:25 +0000)]
Fix r253186 test case

Referencing a DILocation whose scope is a different subprogram causes
an assertion failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253187 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DIBuilder] Make createReferenceType take size and align
Keno Fischer [Mon, 16 Nov 2015 07:57:32 +0000 (07:57 +0000)]
[DIBuilder] Make createReferenceType take size and align

Summary: Since we're passing references to dbg.value as pointers,
we need to have the frontend properly declare their sizes and
alignments (as it already does for regular pointers) in preparation
for my upcoming patch to have the verifer check that the sizes agree.

Also augment the backend logic that skips actually emitting this
information into DWARF such that it also handles reference types.

Reviewers: aprantl, dexonsmith, dblaikie

Subscribers: dblaikie, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253186 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAVX512: Implemented encoding and intrinsics for VMOVSHDUP/VMOVSLDUP instructions.
Igor Breger [Mon, 16 Nov 2015 07:22:00 +0000 (07:22 +0000)]
AVX512: Implemented encoding and intrinsics for VMOVSHDUP/VMOVSLDUP instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253185 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAlso map the personality function in CloneFunctionInto
Keno Fischer [Mon, 16 Nov 2015 05:13:30 +0000 (05:13 +0000)]
Also map the personality function in CloneFunctionInto

Summary: The Old personality function gets copied over, but the
Materializer didn't  have a chance to inspect it (e.g. to fix up
references to the correct module for the target function).
Also add a verifier check that makes sure the personality routine
is in the same module as the function whose personality it is.

Reviewers: majnemer

Subscribers: jevinskie, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253183 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Sink] Don't move landingpads
Keno Fischer [Mon, 16 Nov 2015 04:47:58 +0000 (04:47 +0000)]
[Sink] Don't move landingpads

Summary: Moving landingpads into successor basic blocks makes the
verifier sad. Teach Sink that much like PHI nodes and terminator
instructions, landingpads (and cleanuppads, etc.) may not be moved
between basic blocks.

Reviewers: majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253182 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Make capacity_in_bytes support BitVector. NFC.
Vedant Kumar [Mon, 16 Nov 2015 04:02:36 +0000 (04:02 +0000)]
[ADT] Make capacity_in_bytes support BitVector. NFC.

This makes it a bit easier to replace instances of vector<bool> with
BitVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253180 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Use tabs instead of spaces in assembly output.
Dan Gohman [Sun, 15 Nov 2015 15:34:19 +0000 (15:34 +0000)]
[WebAssembly] Use tabs instead of spaces in assembly output.

This seems to be the most popular convention among the other backends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253172 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Tidyup with implicit SDValue bool check. NFC.
Simon Pilgrim [Sun, 15 Nov 2015 14:57:07 +0000 (14:57 +0000)]
[X86][SSE] Tidyup with implicit SDValue bool check. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253171 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix mapping of unmaterialized global values during metadata linking
Teresa Johnson [Sun, 15 Nov 2015 14:50:14 +0000 (14:50 +0000)]
Fix mapping of unmaterialized global values during metadata linking

Summary:
The patch to move metadata linking after global value linking didn't
correctly map unmaterialized global values to null as desired. They
were in fact mapped to the source copy. It largely worked by accident
since most module linker clients destroyed the source module which
caused the source GVs to be replaced by null, but caused a failure with
LTO linking on Windows:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312869.html

The problem is that a null return value from materializeValueFor is
handled by mapping the value to self. This is the desired behavior when
materializeValueFor is passed a non-GlobalValue. The problem is how to
distinguish that case from the case where we really do want to map to
null.

This patch addresses this by passing in a new flag to the value mapper
indicating that unmapped global values should be mapped to null. Other
Value types are handled as before.

Note that the documented behavior of asserting on unmapped values when
the flag RF_IgnoreMissingValues isn't set is currently disabled with
FIXME notes due to bootstrap failures. I modified these disabled asserts
so when they are eventually enabled again it won't assert for the
unmapped values when the new RF_NullMapMissingGlobalValues flag is set.

I also considered using a callback into the value materializer, but a
flag seemed cleaner given that there are already existing flags.
I also considered modifying materializeValueFor to return the input
value when we want to map to source and then treat a null return
to mean map to null. However, there are other value materializer
subclasses that implement materializeValueFor, and they would all need
to be audited and the return values possibly changed, which seemed
error-prone.

Reviewers: dexonsmith, joker.eph

Subscribers: pcc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253170 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalOpt] Demote globals to locals more aggressively
James Molloy [Sun, 15 Nov 2015 14:21:37 +0000 (14:21 +0000)]
[GlobalOpt] Demote globals to locals more aggressively

Global to local demotion can speed up programs that use globals a lot. It is particularly useful with LTO, when the entire call graph is known and most functions have been internalized.

For a global to be demoted, it must only be accessed by one function and that function:
  1. Must never recurse directly or indirectly, else the GV would be clobbered.
  2. Must never rely on the value in GV at the start of the function (apart from the initializer).

GlobalOpt can already do this, but it is hamstrung and only ever tries to demote globals inside "main", because C++ gives extra guarantees about how main is called - once and only once.

In LTO mode, we can often prove the first property (if the function is internal by this point, we know enough about the callgraph to determine if it could possibly recurse). FunctionAttrs now infers the "norecurse" attribute for this reason.

The second property can be proven for a subset of functions by proving that all loads from GV are dominated by a store to GV. This is conservative in the name of compile time - this only requires a DominatorTree which is fairly cheap in the grand scheme of things. We could do more fancy stuff with MemoryDependenceAnalysis too to catch more cases but this appears to catch most of the useful ones in my testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253168 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Docs] Fix typo
Alex Denisov [Sun, 15 Nov 2015 14:13:24 +0000 (14:13 +0000)]
[Docs] Fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253167 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r253160.
Igor Breger [Sun, 15 Nov 2015 12:19:11 +0000 (12:19 +0000)]
Revert r253160.

It broke layering violation. Reproducible with BUILD_SHARED_LIBS=ON.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253163 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFixed GEP visitor in the InstCombine pass.
Elena Demikhovsky [Sun, 15 Nov 2015 08:19:35 +0000 (08:19 +0000)]
Fixed GEP visitor in the InstCombine pass.
The current implementation of GEP visitor in InstCombine fails with assertion on Vector GEP with mix of scalar and vector types, like this:

getelementptr double, double* %a, <8 x i32> %i
(It fails to create a "sext" from <8 x i32> to <8 x i64>)

I fixed it and added some tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253162 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAVX512: Implemented encoding and intrinsics for VMOVSHDUP/VMOVSLDUP instructions.
Igor Breger [Sun, 15 Nov 2015 07:23:13 +0000 (07:23 +0000)]
AVX512: Implemented encoding and intrinsics for VMOVSHDUP/VMOVSLDUP instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253160 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC: Document MSVC getters on Triple
Dylan McKay [Sun, 15 Nov 2015 05:43:11 +0000 (05:43 +0000)]
NFC: Document MSVC getters on Triple

Summary:
Document the differences between the isKnownWindowsMSVC() and isWindowsMSVC() methods on Triple.

Also removed the '\brief' Doxygen annotations - now that 'AUTOBRIEF' is set to on, they are unnecessary.

Subscribers: jfb, tberghammer, danalbert, srhines, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253159 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse a different block id for block of metadata kind records
Teresa Johnson [Sun, 15 Nov 2015 02:00:09 +0000 (02:00 +0000)]
Use a different block id for block of metadata kind records

Summary:
There are currently two blocks with the METADATA_BLOCK id at module
scope. The first has the module-level metadata values (consisting of
some combination of METADATA_* record codes except for METADATA_KIND).
The second consists only of METADATA_KIND records. The latter is used
only in the METADATA_ATTACHMENT block within function blocks (for
metadata attached to instructions).

For ThinLTO we want to delay the parsing of module level metadata
until all functions have been imported from that module (there is some
bookkeeping used to suture it up when we read it during a post-pass).
However, we do need the METADATA_KIND records when parsing the function
body during importing, since those kinds are used as described above.

To simplify identification and parsing of just the block containing
the metadata kinds, use a different block id (METADATA_KIND_BLOCK_ID).
Support older bitcode without the new block id as well.

Reviewers: dexonsmith, joker.eph

Subscribers: davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253154 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Minor code simplification. NFC.
Dan Gohman [Sat, 14 Nov 2015 23:28:15 +0000 (23:28 +0000)]
[WebAssembly] Minor code simplification. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253150 91177308-0d34-0410-b5e6-96231b3b80d8