Commit Graph

229028 Commits

Author SHA1 Message Date
Peter Collingbourne 892d498017 ELF: Re-implement -u directly and remove CanKeepUndefined flag.
The semantics of the -u flag are to load the lazy symbol named by the flag. We
were previously relying on this behavior falling out of symbol resolution
against a synthetic undefined symbol, but that didn't quite give us the
correct behavior, so we needed a flag to mark symbols created with -u so
we could treat them specially in the writer. However, it's simpler and less
error prone to implement the required behavior directly and remove the flag.

This fixes an issue where symbols loaded with -u would receive hidden
visibility even when the definition in an object file had wider visibility.

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

llvm-svn: 267639
2016-04-27 00:05:03 +00:00
Quentin Colombet e7d1e99543 [MachineInstrBundle] Update the comment for PhysRegInfo::DeadDef.
I missed read the comment when I commited r267621 and thought the
comment did not need update. Matthias kindly proved me wrong.
Fixing that.

llvm-svn: 267638
2016-04-26 23:55:41 +00:00
Peter Collingbourne 676c7cd1ed ELF: Move code to where it is used, and related cleanups. NFC.
Differential Revision: http://reviews.llvm.org/D19490

llvm-svn: 267637
2016-04-26 23:52:44 +00:00
Andrew Kaylor d9974cc913 Add optimization bisect opt-in calls for SystemZ passes
Differential Revision: http://reviews.llvm.org/D19562

llvm-svn: 267636
2016-04-26 23:49:41 +00:00
Andrew Kaylor 87b10dd7b3 Add optimization bisect opt-in calls for NVPTX passes
Differential Revision: http://reviews.llvm.org/D19518

llvm-svn: 267635
2016-04-26 23:44:31 +00:00
Quentin Colombet 4ff3cfb673 [X86] Make sure it is safe to clobber EFLAGS, if need be, when choosing
the prologue.

Do not use basic blocks that have EFLAGS live-in as prologue if we need
to realign the stack. Realigning the stack uses AND instruction and this
clobbers EFLAGS.

An other alternative would have been to save and restore EFLAGS around
the stack realignment code, but this is likely inefficient.

Fixes PR27531.

llvm-svn: 267634
2016-04-26 23:44:14 +00:00
Adrian Prantl 9491371f6f Module debugging: Add an assertion.
llvm-svn: 267633
2016-04-26 23:42:43 +00:00
Richard Smith d49941b726 PR27513: When determining which declaration to put into an exported lookup
table for a module / PCH, never map from a normal declaration of a class to an
injected-class-name declaration (or vice versa). Those declarations live in
distinct lookup tables and should not be confused.

We really shouldn't be using a CXXRecordDecl to represent an
injected-class-name in the first place; I've filed PR27532 so we don't forget.

llvm-svn: 267632
2016-04-26 23:40:43 +00:00
Justin Bogner c2bf63d29d PM: Port Reassociate to the new pass manager
llvm-svn: 267631
2016-04-26 23:39:29 +00:00
Adrian Prantl 0dabc2adba Module debugging: Also correctly handle typedef'd foward-declared members.
Thanks again to Richard Smith for pointing this out.

llvm-svn: 267630
2016-04-26 23:37:38 +00:00
Mitch Bodart 807e13379b [X86] Replace -mcpu with -mattr in several tests
Differential Revision: http://reviews.llvm.org/D19568

llvm-svn: 267629
2016-04-26 23:36:38 +00:00
Justin Bogner cb8a21c88e Reassociate: Convert another functor into a lambda. NFC
Also move the explanatory comment with it.

llvm-svn: 267628
2016-04-26 23:32:00 +00:00
Philip Reames f105db4fc3 [LVI] Cut short search if we know we can't return a useful result
Previously we were recursing on our operands for unary and binary operators regardless of whether we knew how to reason about the operator in question.  This has the effect of doing a potentially large amount of work, only to throw it away.  By checking whether the operation is one LVI can handle, we can cut short the search and return the (overdefined) answer more quickly.  The quality of the results produced should not change.

llvm-svn: 267626
2016-04-26 23:27:33 +00:00
Sunil Srivastava e9e3631aba Check 'r' and 'y specifiers of freebsd_kernel_printf format strings on PS4
This is an addendum to r229921.

llvm-svn: 267625
2016-04-26 23:19:00 +00:00
Sanjay Patel 29dea0d230 [SimplifyCFG] propagate branch metadata when creating select
llvm-svn: 267624
2016-04-26 23:15:48 +00:00
Quentin Colombet 2b3a4e787e [X86] Teach the expansion of copy instructions how to do proper liveness.
When the simple analysis provided by MachineBasicBlock::computeRegisterLiveness
fails, fall back on the LivePhysReg utility.

llvm-svn: 267623
2016-04-26 23:14:32 +00:00
Quentin Colombet 08e79990a0 [MachineBasicBlock] Take advantage of the partially dead information.
Thanks to that information we wouldn't lie on a register being live whereas it
is not.

llvm-svn: 267622
2016-04-26 23:14:29 +00:00
Quentin Colombet 3f19245015 [MachineInstrBundle] Improvement the recognition of dead definitions.
Now, it is possible to know that partial definitions are dead definitions and
recognize that clobbered registers are also dead.

llvm-svn: 267621
2016-04-26 23:14:24 +00:00
Philip Reames 053c2a6f25 [LVI] Apply transfer rule for overdefine inputs for binary operators
As pointed out by John Regehr over in http://reviews.llvm.org/D19485, LVI was being incredibly stupid about applying its transfer rules.  Rather than gathering local facts from the expression itself, it was simply giving up entirely if one of the inputs was overdefined.  This greatly impacts the precision of the overall analysis and makes it far more fragile as well.

This patch builds on 267609 which did the same thing for unary casts.

llvm-svn: 267620
2016-04-26 23:10:35 +00:00
Jingyue Wu c1b9d47b3b [NVPTX] Fix some usages of CodeGenOpt::None.
NVPTXLowerKernelArgs is required for correctness, so it should not be guarded
by CodeGenOpt::None.

NVPTXPeephole is optimization only, so it should be skipped when
CodeGenOpt::None.

llvm-svn: 267619
2016-04-26 22:59:25 +00:00
Philip Reames e5030e85ea [LVI] A better fix for the assertion error introduced by 267609
Essentially, I was using the wrong size function.  For types which were sized, but not primitive, I wasn't getting a useful size for the operand and failed an assert.  I fixed this, and also added a guard that the input is a sized type.  Test case is for the original mistake.  I'm not sure how to actually exercise the sized type check.

llvm-svn: 267618
2016-04-26 22:52:30 +00:00
Philip Reames d5c62a0aad [LVI] Speculative fix for assertion seen in clang bots
I'll clean this up and add a test case shortly.  I want to make sure this does actually fix the bots; if not, I'll revert.

llvm-svn: 267617
2016-04-26 22:31:53 +00:00
Adrian McCarthy fd5c9be4bb Fix TestRegisterVariables.py on Windows
Use __attribute__((regparm(x))) to ensure the compiler enregisters at least some arguments when calling functions.

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

llvm-svn: 267616
2016-04-26 22:25:40 +00:00
Sanjay Patel d2d2aa52cd [LowerExpectIntrinsic] make default likely/unlikely ratio bigger
We need the default ratio to be sufficiently large that it triggers transforms 
based on block frequency info (BFI) and plays well with the recently introduced
BranchProbability used by CGP.

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

llvm-svn: 267615
2016-04-26 22:23:38 +00:00
Justin Bogner 90744d215b Reassociate: Simplify using lambdas. NFC
llvm-svn: 267614
2016-04-26 22:22:18 +00:00
Rafael Espindola 1763dc44b9 Return R_GOTREL for R_MIPS_GPREL*.
This lets Writer.cpp know that they are got relative, which will allow
further simplifications.

llvm-svn: 267613
2016-04-26 22:00:04 +00:00
Adrian Prantl 90931c4853 Module debugging: Add testcase for member classes of class template specializations.
llvm-svn: 267612
2016-04-26 21:58:23 +00:00
Adrian Prantl 88d7917970 Module debugging: Use the definition to determine module-defined types.
Follow-up to r267464. Thanks to Richard Smith for pointing this out!

llvm-svn: 267611
2016-04-26 21:58:18 +00:00
Mike Aizatsky a3060c1159 [sanitizers] rewriting test assuming assert() changes coverage.
Summary:
On windows platform assert() call creates two distinct CFG edges
which are coverage-instrumented. Simply calling assert would
change coverage numbers on the platform.

Subscribers: kubabrecka

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

llvm-svn: 267610
2016-04-26 21:56:14 +00:00
Philip Reames 38c87c2e50 [LVI] Infer local facts from unary expressions
As pointed out by John Regehr over in http://reviews.llvm.org/D19485, LVI was being incredibly stupid about applying its transfer rules. Rather than gathering local facts from the expression itself, it was simply giving up entirely if one of the inputs was overdefined. This greatly impacts the precision of the overall analysis and makes it far more fragile as well.

This patch implements only the unary operation case. Once this is in, I'll implement the same for the binary operations.

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

llvm-svn: 267609
2016-04-26 21:48:16 +00:00
Andrew Kaylor 2bee5ef462 Optimization bisect support in X86-specific passes
Differential Revision: http://reviews.llvm.org/D19439

llvm-svn: 267608
2016-04-26 21:44:24 +00:00
Ahmed Bougacha 128f8732a5 [CodeGen] Add getBuildVector and getSplatBuildVector helpers. NFCI.
Differential Revision: http://reviews.llvm.org/D17176

llvm-svn: 267606
2016-04-26 21:15:30 +00:00
David Majnemer abb9f55c80 Revert "[SimplifyLibCalls] sprintf doesn't copy null bytes"
The destination buffer that sprintf uses is restrict qualified, we do
not need to worry about derived pointers referenced via format
specifiers.

This reverts commit r267580.

llvm-svn: 267605
2016-04-26 21:04:47 +00:00
Erik Pilkington ce26eac511 Test commit
llvm-svn: 267604
2016-04-26 20:55:48 +00:00
Rafael Espindola 6c75238aca Call repl in getSymbolBody. NFC.
Every caller was doing it.

llvm-svn: 267603
2016-04-26 20:45:31 +00:00
Rui Ueyama cf0dd1ebf2 Move utility functions to DriverUtils.cpp.
llvm-svn: 267602
2016-04-26 20:41:32 +00:00
Nico Weber 197e5cfe34 Try to get at_file_missing.c passing after LLVM r267556.
r267556 made backslashes escape the next character
unconditionally in rsp files.  This test echos a path into
a rsp file, and paths contain backslashes on Windows. Since
it's not important for this test to get the filename from
the rsp file, just pass it regularly.

llvm-svn: 267601
2016-04-26 20:40:23 +00:00
Rui Ueyama 673b609586 Handle Windows drive letters and ".." for --reproduce.
When --reproduce <path> is given, then we need to concatenate input
file paths to the given path to save input files to the directory.
Previously, path concatenation didn't handle Windows drive letters
so it could generate invalid paths such as "C:\D:\foo". It also didn't
handle ".." path components, so it could produce some bad paths
such as "foo/../../etc/passwd".

In this patch, Windows drive letters and ".." are removed before
concatenating paths.

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

llvm-svn: 267600
2016-04-26 20:36:46 +00:00
Nico Weber 2f1459cbb7 Try to get ResponseFile.ll passing on Windows after r267556.
llvm-svn: 267599
2016-04-26 20:32:51 +00:00
Zachary Turner c3c4e15697 Remove more unused variables.
llvm-svn: 267598
2016-04-26 20:32:35 +00:00
Elena Demikhovsky 308a7eb0d2 Masked Store in Loop Vectorizer - bugfix
Fixed a bug in loop vectorization with conditional store.

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

llvm-svn: 267597
2016-04-26 20:18:04 +00:00
Justin Bogner 4563a06cee PM: Port Internalize to the new pass manager
llvm-svn: 267596
2016-04-26 20:15:52 +00:00
Zachary Turner 7756127077 [llvm-pdbdump] Fix version reading on big endian systems.
llvm-svn: 267595
2016-04-26 19:48:18 +00:00
Jim Ingham dae50baf44 UtilityFunction::MakeFunctionCaller uses the Error to report failure,
but when there's was no process it was just returning an null pointer
and not setting the error.  I don't have a scenario where this might
go wrong, just code inspection...

llvm-svn: 267594
2016-04-26 19:46:39 +00:00
Andrew Kaylor 5b444a21df Add optimization bisect opt-in calls for Hexagon passes
Differential Revision: http://reviews.llvm.org/D19509

llvm-svn: 267593
2016-04-26 19:46:28 +00:00
Alexander Kornienko 900cadd3ad [clang-tidy] Now adding correct misc-move-const-arg documentation ;]
+ brushed the code a bit and renamed the test file to match the check name

llvm-svn: 267592
2016-04-26 19:33:49 +00:00
Marshall Clow 8dc9dcaeac Apparently XFAIL tests that are supposed to fail to compile can be problematic. They still get compiled, and if the compile succeeds, the buildbots complain. Replace the XFAIL with #error.
llvm-svn: 267591
2016-04-26 19:29:35 +00:00
Yaxun Liu 382d355359 [OpenCL] Add predefined macros.
OpenCL spec requires __OPENCL_C_VERSION__ to be defined based on -cl-std option. This patch implements that.

The patch also defines __FAST_RELAXED_MATH__ based on -cl-fast-relaxed-math option.

Also fixed a test using -std=c99 for OpenCL program. Limit allowed language standard of OpenCL to be OpenCL standards.

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

llvm-svn: 267590
2016-04-26 19:25:46 +00:00
Zachary Turner ff788aa0ee Fix warnings and -Werror build on clang.
llvm-svn: 267589
2016-04-26 19:24:10 +00:00
Rui Ueyama 3578d334fb Make test/ELF/reproduces.s test to work on Windows.
Previously, the test didn't work on Windows because it tried to
concatenate two (possibly) absolute paths. If two paths are absolute
paths that have drive letters, then the result would become something
like C:\foo\D:\bar. That's not a valid path. I changed the test to
use relative paths.

llvm-svn: 267588
2016-04-26 19:04:35 +00:00