OSDN Git Service
Benjamin Kramer [Fri, 4 Jul 2014 12:36:05 +0000 (12:36 +0000)]
GlobalDCE: Delete available_externally initializers if it allows removing the value the initializer is referring to.
This is useful for functions that are not actually available externally but
referenced by a vtable of some kind. Clang emits functions like this for the MS
ABI.
PR20182.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212337
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 4 Jul 2014 11:58:03 +0000 (11:58 +0000)]
llvm/test/CodeGen/XCore/dwarf_debug.ll: Fix not to be affected by *-win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212335
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 4 Jul 2014 11:55:40 +0000 (11:55 +0000)]
llvm/test/CodeGen/X86/vector-gep.ll: Appease to add -mtriple=i686-linux.
This doesn't pass if stack alignment is not 16, like cygming, *bsd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212334
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 4 Jul 2014 10:58:05 +0000 (10:58 +0000)]
ARM: when falling back to scattered relocs, keep the type.
The linker relies on relocation type info (e.g. is it a branch?) to perform the
correct actions, so we should keep that even when we end up using a scattered
relocation for whatever reason.
rdar://problem/
17553104
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212333
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 4 Jul 2014 10:57:56 +0000 (10:57 +0000)]
llvm-readobj: fix MachO relocatoin printing a bit.
There were two issues here:
1. At the very least, scattered relocations cannot use the same code to
determine the corresponding symbol being referred to. For some reason we
pretend there is no symbol, even when one actually exists in the symtab, so to
match this behaviour getRelocationSymbol should simply return symbols_end for
scattered relocations.
2. Printing "-" when we can't get a symbol (including the scattered case, but
not exclusively), isn't that helpful. In both cases there *is* interesting
information in that field, so we should print it. As hex will do.
Small part of rdar://problem/
17553104
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212332
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 4 Jul 2014 10:22:21 +0000 (10:22 +0000)]
InstCombine: Strength reduce sadd.with.overflow into a regular nsw add if we can prove that it cannot overflow.
PR20194
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212331
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 4 Jul 2014 10:08:27 +0000 (10:08 +0000)]
[mips][mips64r6] Correct the encoding of dmuh, dmuhu, dmul, and dmulu.
We have detected a documentation bug in the encoding tables of the released
MIPS64r6 specification that has resulted in the wrong encodings being used for
these instructions in LLVM. This commit corrects them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212330
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Fri, 4 Jul 2014 09:00:35 +0000 (09:00 +0000)]
Phabricator doc: Explicit the fact that the patch needs to be there before the commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212328
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 4 Jul 2014 08:39:30 +0000 (08:39 +0000)]
[x86] Relax the line in this check to pacify build bots.
I still don't love testing the comments, but its the only sane way to
check shuffle instructions...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212326
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 4 Jul 2014 08:19:37 +0000 (08:19 +0000)]
[x86] Move some check lines to be slightly easier for me to find.
(meant to put this cleanup in the previous patch, sorry)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212325
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 4 Jul 2014 08:11:49 +0000 (08:11 +0000)]
[x86] Generalize BuildVectorSDNode::getConstantSplatValue to work for
any constant, constant FP, or undef splat and to tolerate any undef
lanes in a splat, then replace all uses of isSplatVector in X86's
lowering with it.
This fixes issues where undef lanes in an otherwise splat vector would
prevent the splat logic from firing. It is a touch more awkward to use
this interface, but it is much more accurate. Suggestions for better
interface structuring welcome.
With this fix, the code generated with the widening legalization
strategy for widen_cast-4.ll is *dramatically* improved as the special
lowering strategies for a v16i8 SRA kick in even though the high lanes
are undef.
We also get a slightly different choice for broadcasting an aligned
memory location, and use vpshufd instead of vbroadcastss. This looks
like a minor win for pipelining and domain crossing, but a minor loss
for the number of micro-ops. I suspect its a wash, but folks can easily
tweak the lowering if they want.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212324
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 4 Jul 2014 08:11:38 +0000 (08:11 +0000)]
Add an explicit bool operator to SDValue to make it easier to test for
a non-null node. In particular, this makes it easier to use condition
variables with SDValues, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212323
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Volkov [Fri, 4 Jul 2014 07:14:56 +0000 (07:14 +0000)]
[X86] Limit maximum nop length on Silvermont
Silvermont can only decode one instruction per cycle if the instruction exceeds 8 bytes.
Also in Silvermont instructions with more than 3 prefixes will cause 3 cycle penalty.
Maximum nop length is limited to 7 bytes when used for padding on Silvermont.
For other x86 processors max nop length remains unchanged 15 bytes.
Differential Revision: http://reviews.llvm.org/D4374
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212321
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Lytton [Fri, 4 Jul 2014 06:38:22 +0000 (06:38 +0000)]
XCore target: remove incorrect DebugLoc entries from prologue
Summary: This was causing the prologue_end to be incorrectly positioned.
Differential Revision: http://reviews.llvm.org/D4122
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212318
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 4 Jul 2014 05:11:55 +0000 (05:11 +0000)]
Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like cygming.
This makes unittests run with BUILD_SHARED_LIBS on DLL platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212316
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 4 Jul 2014 04:45:40 +0000 (04:45 +0000)]
[CMake] Introduce LLVM_ENABLE_PLUGINS as an internal option. BUILD_SHARED_LIBS may not control enable/disable plugins.
FIXME: Make this configurable.
FIXME: "ENABLE_SHARED" doesn't make sense, since it is used just for plugins. We may rename it.
I introduced config.enable_shared in r120273.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212315
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 4 Jul 2014 04:23:26 +0000 (04:23 +0000)]
[CMake] Introduce LLVM_SHLIB_OUTPUT_INTDIR.
For now, its user is configure_lit_site_cfg().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212314
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 4 Jul 2014 04:23:15 +0000 (04:23 +0000)]
[CMake] Fix set_output_directory to do nothing if *_OUTPUT_INTDIR was not given.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212313
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Fri, 4 Jul 2014 02:01:54 +0000 (02:01 +0000)]
Fix prefix comparison from r212308
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212310
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 4 Jul 2014 01:55:26 +0000 (01:55 +0000)]
Move function dependent resetting of a subtarget variable out of the
subtarget. This involved having the movt predicate take the current
function - since we care about size in instruction selection for
whether or not to use movw/movt take the function so we can check
the attributes. This required adding the current MachineFunction to
FastISel and propagating through.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212309
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Fri, 4 Jul 2014 00:58:41 +0000 (00:58 +0000)]
Sink undesirable LTO functions into the old C API
We want to encourage users of the C++ LTO API to reuse memory buffers instead
of repeatedly opening and reading the same file contents.
This reverts commit r212305 and implements a tidier scheme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212308
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 4 Jul 2014 00:23:39 +0000 (00:23 +0000)]
InstSimplify: Fix a bug when INT_MIN is in a sdiv
When INT_MIN is the numerator in a sdiv, we would not properly handle
overflow when calculating the bounds of possible values; abs(INT_MIN) is
not a meaningful number.
Instead, check and handle INT_MIN by reasoning that the largest value is
INT_MIN/-2 and the smallest value is INT_MIN.
This fixes PR20199.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212307
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 3 Jul 2014 23:49:28 +0000 (23:49 +0000)]
Modify LTOModule::isTargetMatch to take a StringRef instead of a MemoryBuffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212305
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 3 Jul 2014 23:28:03 +0000 (23:28 +0000)]
gold plugin: move target initialization to the top of the onload function.
On at least my machine, ar does not register an all symbols read hook (which
previously triggered target initialization), but it does register a claim
files hook, which depends on the targets being initialized.
Differential Revision: http://reviews.llvm.org/D4372
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212303
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 3 Jul 2014 23:28:00 +0000 (23:28 +0000)]
LTO: rename the various makeLTOModule overloads.
This rename makes it easier to identify the specific overload being called
in each particular case and makes future refactorings easier.
Differential Revision: http://reviews.llvm.org/D4370
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212302
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 23:03:50 +0000 (23:03 +0000)]
Move createIRObjectFile to the IRObjectFile class and return the concrete type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212301
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 3 Jul 2014 22:57:44 +0000 (22:57 +0000)]
[x86] Clarify that this lowering only applies to vectors and is only
used when we have SSE2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212300
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 22:43:03 +0000 (22:43 +0000)]
Use std::unique_ptr to manage memory. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212299
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 3 Jul 2014 22:24:54 +0000 (22:24 +0000)]
Temporarily revert "Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information." as it appears to be breaking some LTO constructs.
This reverts commit r212203.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212298
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 3 Jul 2014 22:24:49 +0000 (22:24 +0000)]
Remove caching of the target machine and initialization of the
subtarget from ARMISelDAGtoDAG. The former is unnecessary and the
latter is initialized on each runOnMachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212297
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Thu, 3 Jul 2014 22:24:18 +0000 (22:24 +0000)]
[CostModel][x86] Improved cost model for alternate shuffles.
This patch:
1) Improves the cost model for x86 alternate shuffles (originally
added at revision 211339);
2) Teaches the Cost Model Analysis pass how to analyze alternate shuffles.
Alternate shuffles are a special kind of blend; on x86, we can often
easily lowered alternate shuffled into single blend
instruction (depending on the subtarget features).
The existing cost model didn't take into account subtarget features.
Also, it had a couple of "dead" entries for vector types that are never
legal (example: on x86 types v2i32 and v2f32 are not legal; those are
always either promoted or widened to 128-bit vector types).
The new x86 cost model takes into account what target features we have
before returning the shuffle cost (i.e. the number of instructions
after the blend is lowered/expanded).
This patch also teaches the Cost Model Analysis how to identify and analyze
alternate shuffles (i.e. 'SK_Alternate' shufflevector instructions):
- added function 'isAlternateVectorMask';
- added some logic to check if an instruction is a alternate shuffle and, in
case, call the target specific TTI to get the corresponding shuffle cost;
- added a test to verify the cost model analysis on alternate shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212296
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 3 Jul 2014 21:51:07 +0000 (21:51 +0000)]
Add the -just-symbol-name (aka -j) flag to llvm-nm to just print the
symbol’s name. On darwin the -j flag is used (often in combinations
with other flags) to produce a complete list of symbol names which
than can then be reorder and used with ld(1)’s -order_file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212294
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Thu, 3 Jul 2014 21:51:06 +0000 (21:51 +0000)]
[X86] Add ISel patterns to select 'f32_to_f16' and 'f16_to_f32' dag nodes.
This patch adds tablegen patterns to select F16C float-to-half-float
conversion instructions from 'f32_to_f16' and 'f16_to_f32' dag nodes.
If the target doesn't have F16C, then 'f32_to_f16' and 'f16_to_f32'
are expanded into library calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212293
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 21:34:25 +0000 (21:34 +0000)]
Expand the note about llvm-ar now that inline asm works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212292
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 20:26:21 +0000 (20:26 +0000)]
Move test since it now depends on the x86 backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212289
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 20:19:03 +0000 (20:19 +0000)]
LTO depends on Object now.
Fixes the build with only the ARM backend enabled. For some reason some
other backend was pulling Object and this went unnoticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212288
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 19:40:08 +0000 (19:40 +0000)]
Add support for inline asm symbols in llvm-ar.
This should allow llvm-ar to be used instead of gnu ar + plugin in a LTO
build. I will add a release note about it once I finish a LTO bootstrap with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212287
91177308-0d34-0410-b5e6-
96231b3b80d8
Gerolf Hoflehner [Thu, 3 Jul 2014 19:28:15 +0000 (19:28 +0000)]
Run interprocedural const prop before global optimizer
Exposes more constant globals that can be removed by
the global optimizer. A specific example is the removal
of the static global block address array in
clang/test/CodeGen/indirect-goto.c. This change impacts only
lower optimization levels. With LTO interprocedural
const prop runs already before global opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212284
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 19:09:53 +0000 (19:09 +0000)]
fix configure+make build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212283
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 18:59:23 +0000 (18:59 +0000)]
Add support for inline asm symbols to IRObjectFile.
This also enables it in llvm-nm so that it can be tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212282
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 3 Jul 2014 18:18:50 +0000 (18:18 +0000)]
Add the -U flag to llvm-nm as an alias to -defined-only
as darwin’s nm(1) uses -U for this functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212280
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 3 Jul 2014 16:17:20 +0000 (16:17 +0000)]
fixed typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212279
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 3 Jul 2014 16:12:55 +0000 (16:12 +0000)]
IR: cleanup Module::dropReferences
This replaces some old-style loops with range-based for.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212278
91177308-0d34-0410-b5e6-
96231b3b80d8
Yi Kong [Thu, 3 Jul 2014 16:00:41 +0000 (16:00 +0000)]
[ARM] Implement ISB memory barrier intrinsic
Adds support for __builtin_arm_isb. Also corrects DSB and ISB instructions
modelling by adding has-side-effects property.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212276
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 3 Jul 2014 15:19:40 +0000 (15:19 +0000)]
bug fix for PR20020: anti-dependency-breaker causes miscompilation
This patch sets the 'KeepReg' bit for any tied and live registers during the PrescanInstruction() phase of the dependency breaking algorithm. It then checks those 'KeepReg' bits during the ScanInstruction() phase to avoid changing any tied registers. For more details, please see comments in:
http://llvm.org/bugs/show_bug.cgi?id=20020
I added two FIXME comments for code that I think can be removed by using register iterators that include self. I don't want to include those code changes with this patch, however, to keep things as small as possible.
The test case is larger than I'd like, but I don't know how to reduce it further and still produce the failing asm.
Differential Revision: http://reviews.llvm.org/D4351
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212275
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 3 Jul 2014 15:06:47 +0000 (15:06 +0000)]
Fix ppcf128 component access on little-endian systems
The PowerPC 128-bit long double data type (ppcf128 in LLVM) is in fact a
pair of two doubles, where one is considered the "high" or
more-significant part, and the other is considered the "low" or
less-significant part. When a ppcf128 value is stored in memory or a
register pair, the high part always comes first, i.e. at the lower
memory address or in the lower-numbered register, and the low part
always comes second. This is true both on big-endian and little-endian
PowerPC systems. (Similar to how with a complex number, the real part
always comes first and the imaginary part second, no matter the byte
order of the system.)
This was implemented incorrectly for little-endian systems in LLVM.
This commit fixes three related issues:
- When printing an immediate ppcf128 constant to assembler output
in emitGlobalConstantFP, emit the high part first on both big-
and little-endian systems.
- When lowering a ppcf128 type to a pair of f64 types in SelectionDAG
(which is used e.g. when generating code to load an argument into a
register pair), use correct low/high part ordering on little-endian
systems.
- In a related issue, because lowering ppcf128 into a pair of f64 must
operate differently from lowering an int128 into a pair of i64,
bitcasts between ppcf128 and int128 must not be optimized away by the
DAG combiner on little-endian systems, but must effect a word-swap.
Reviewed by Hal Finkel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212274
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 3 Jul 2014 11:56:30 +0000 (11:56 +0000)]
[msan] Stop propagating shadow in blacklisted functions.
With this change all values passed through blacklisted functions
become fully initialized. Previous behavior was to initialize all
loads in blacklisted functions, but apply normal shadow propagation
logic for all other operation.
This makes blacklist applicable in a wider range of situations.
It also makes code for blacklisted functions a lot shorter, which
works as yet another workaround for PR17409.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212268
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 3 Jul 2014 11:49:50 +0000 (11:49 +0000)]
[msan] Add missing attributes in MemorySanitizer tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212267
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 3 Jul 2014 11:35:08 +0000 (11:35 +0000)]
Revert of r212265.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212266
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 3 Jul 2014 11:18:48 +0000 (11:18 +0000)]
[msan] Stop propagating shadow in blacklisted functions.
With this change all values passed through blacklisted functions
become fully initialized. Previous behavior was to initialize all
loads in blacklisted functions, but apply normal shadow propagation
logic for all other operation.
This makes blacklist applicable in a wider range of situations.
It also makes code for blacklisted functions a lot shorter, which
works as yet another workaround for PR17409.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212265
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcello Maggioni [Thu, 3 Jul 2014 08:29:06 +0000 (08:29 +0000)]
Minor stylistic fix in SimplifyCFG (test commit)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212259
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 3 Jul 2014 07:25:00 +0000 (07:25 +0000)]
Let llvm/test/CodeGen/X86/lower-bitcast.ll tolerant of win32 calling convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212258
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 3 Jul 2014 07:04:38 +0000 (07:04 +0000)]
[x86] Fix the completely broken vector widening legalization of bswap.
This operation was classified as a binary operation in the widening
logic for some reason (clearly, untested). It is in fact a unary
operation. Add a RUN line to a test to exercise this for x86.
Note that again the vector widening strategy doesn't regress anything
and in one case removes a totally unecessary instruction that we
couldn't avoid when promoting the element type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212257
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 3 Jul 2014 03:43:47 +0000 (03:43 +0000)]
[x86] Fix crashes in lowering bitcast instructions with the widening
mode.
This also runs the test in that mode which would reproduce the crash.
What I love is that *every single FIXME* in the test is addressed by
switching to widening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212254
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 3 Jul 2014 02:12:26 +0000 (02:12 +0000)]
[aarch64] Add a test that should have been in r212242 but I forgot to
add it. Sorry about that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212251
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Thu, 3 Jul 2014 02:11:49 +0000 (02:11 +0000)]
Add new lines to debugging information.
Differential Revision: http://reviews.llvm.org/D4262
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212250
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 3 Jul 2014 02:11:29 +0000 (02:11 +0000)]
[x86] Based on a long conversation between myself, Jim Grosbach, Hal
Finkel, Eric Christopher, and a bunch of other people I'm probably
forgetting (sorry), add an option to the x86 backend to widen vectors
during type legalization rather than promote them.
This still would promote vNi1 vectors to get the masks right, but would
widen other vectors. A lot of experiments are piling up right now
showing that widening should probably be the default legalization
strategy outside of vNi1 cases, but it is very hard to test the
rammifications of that and fix bugs in widening-based legalization
without an option that enables it. I'll be checking in tests shortly
that use this option to exercise cases where widening doesn't work well
and hopefully we'll be able to switch fully to this soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212249
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Jul 2014 02:01:39 +0000 (02:01 +0000)]
Invert the MC -> Object dependency.
Now that we have a lib/MC/MCAnalysis, the dependency was there just because
of two helper classes. Move the two over to MC.
This will allow IRObjectFile to parse inline assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212248
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 3 Jul 2014 00:44:31 +0000 (00:44 +0000)]
Make these preprocessor directives match all of the others in the port.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212245
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 3 Jul 2014 00:44:28 +0000 (00:44 +0000)]
Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212244
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 3 Jul 2014 00:23:43 +0000 (00:23 +0000)]
[codegen,aarch64] Add a target hook to the code generator to control
vector type legalization strategies in a more fine grained manner, and
change the legalization of several v1iN types and v1f32 to be widening
rather than scalarization on AArch64.
This fixes an assertion failure caused by scalarizing nodes like "v1i32
trunc v1i64". As v1i64 is legal it will fail to scalarize v1i32.
This also provides a foundation for other targets to have more granular
control over how vector types are legalized.
Patch by Hao Liu, reviewed by Tim Northover. I'm committing it to allow
some work to start taking place on top of this patch as it adds some
really important hooks to the backend that I'd like to immediately start
using. =]
http://reviews.llvm.org/D4322
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212242
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 3 Jul 2014 00:10:24 +0000 (00:10 +0000)]
Move subtarget dependent features into the subtarget from the target
machine. Includes a fix for a subtarget initialization for
hard floating point on mips16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212240
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 2 Jul 2014 23:29:55 +0000 (23:29 +0000)]
So that we can include frame lowering in the subtarget, remove include
circular dependency with the subtarget by inlining accessor methods and
outlining a routine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212236
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Wed, 2 Jul 2014 23:23:58 +0000 (23:23 +0000)]
Add the -reverse-sort flag (aka -r) to llvm-nm
which exists in other Unix nm(1)’s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212235
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 2 Jul 2014 23:18:40 +0000 (23:18 +0000)]
So that we can include target lowering in the subtarget, remove include
circular dependency with the subtarget by inlining accessor methods and
outlining a routine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212234
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 2 Jul 2014 22:31:51 +0000 (22:31 +0000)]
Update comment and include guard.
I missed these when moving the files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212231
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 2 Jul 2014 22:17:20 +0000 (22:17 +0000)]
[OCaml] Documentation improvements.
Patch by Julien Sagot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212230
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 2 Jul 2014 22:05:40 +0000 (22:05 +0000)]
Fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212228
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 2 Jul 2014 21:42:28 +0000 (21:42 +0000)]
Revert "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself."
This reverts commit r212205.
Reverting this again, still seeing crashes when building compiler-rt...
Sorry for the continued noise, not sure why I'm failing to reproduce
this locally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212226
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 2 Jul 2014 21:29:23 +0000 (21:29 +0000)]
Move the data layout and selection dag info from the mips target machine
down to the subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212224
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 2 Jul 2014 21:26:01 +0000 (21:26 +0000)]
[X86] AVX512: Allow writemask argument in vpermt* intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212223
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 2 Jul 2014 21:25:58 +0000 (21:25 +0000)]
[X86] AVX512: Generate Pat<>'s for the vpermt2* intrinsics via multiclass
This new multiclass, avx512_perm_table_3src derives from the current one and
provides the Pat<>. The next patch will add another Pat<> that uses the
writemask.
Note that I dropped the type annotation from the intrinsic call, i.e.: (v16f32
VR512:$src1) -> R512:$src1. I think that this should be fine (at least many
intrinsic calls don't provide them) and it greatly reduces the number of
template arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212222
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 2 Jul 2014 21:25:54 +0000 (21:25 +0000)]
[X86] AVX512: Add writemask variants for vperm*2*
This includes assembler and codegen support (see the new tests in
avx512-encodings.s and avx512-shuffle.ll).
<rdar://problem/
17492620>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212221
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 2 Jul 2014 20:53:57 +0000 (20:53 +0000)]
R600: Add a comment that llvm.AMDGPU.trunc is a legacy intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212218
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 2 Jul 2014 20:53:56 +0000 (20:53 +0000)]
R600/SI: Use a ComplexPattern for ADDR64 addressing of MUBUF loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212217
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 2 Jul 2014 20:53:54 +0000 (20:53 +0000)]
R600: Promote i64 loads to v2i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212216
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 2 Jul 2014 20:53:48 +0000 (20:53 +0000)]
R600/SI: Adjsut SGPR live ranges before register allocation
SGPRs are written by instructions that sometimes will ignore control flow,
which means if you have code like:
if (VGPR0) {
SGPR0 = S_MOV_B32 0
} else {
SGPR0 = S_MOV_B32 1
}
The value of SGPR0 will 1 no matter what the condition is.
In order to deal with this situation correctly, we need to view the
program as if it were a single basic block when we calculate the
live ranges for the SGPRs. They way we actually update the live
range is by iterating over all of the segments in each LiveRange
object and setting the end of each segment equal to the start of
the next segment. So a live range like:
[3888r,9312r:0)[10032B,10384B:0) 0@3888r
will become:
[3888r,10032B:0)[10032B,10384B:0) 0@3888r
This change will allow us to use SALU instructions within branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212215
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 2 Jul 2014 20:53:44 +0000 (20:53 +0000)]
R600/SI: Add verifier check for immediates in register operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212214
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Wed, 2 Jul 2014 20:25:42 +0000 (20:25 +0000)]
Remove non-static field initializer to appease MSVC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212212
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 2 Jul 2014 20:05:48 +0000 (20:05 +0000)]
Fix configure+make build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212210
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 2 Jul 2014 19:49:34 +0000 (19:49 +0000)]
Move CFG building code to a new lib/MC/MCAnalysis library.
The new library is 150KB on a Release+Asserts build, so it is quiet a bit of
code that regular users of MC don't need to link with now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212209
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 2 Jul 2014 18:32:05 +0000 (18:32 +0000)]
DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself.
Originally committed in r211723, reverted in r211724 due to failure
cases found and fixed (ArgumentPromotion: r211872, Inlining: r212065),
committed again in r212085 and reverted again in r212089 after fixing
some other cases, such as debug info subprogram lists not keeping track
of the function they represent (r212128) and then short-circuiting
things like LiveDebugVariables that build LexicalScopes for functions
that might not have full debug info.
And again, I believe the invariant actually holds for some reasonable
amount of code (but I'll keep an eye on the buildbots and see what
happens... ).
Original commit message:
PR20038: DebugInfo: Inlined call sites where the caller has debug info
but the call itself has no debug location.
This situation does bad things when inlined, so I've fixed Clang not to
produce inlinable call sites without locations when the caller has debug
info (in the one case where I could find that this occurred). This
updates the PR20038 test case to be what clang now produces, and readds
the assertion that had to be removed due to this bug.
I've also beefed up the debug info verifier to help diagnose these
issues in the future, and I hope to add checks to the inliner to just
assert-fail if it encounters this situation. If, in the future, we
decide we have to cope with this situation, the right thing to do is
probably to just remove all the DebugLocs from the inlined instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212205
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Wed, 2 Jul 2014 18:32:04 +0000 (18:32 +0000)]
[RegAllocGreedy] Provide a subtarget hook to disable the local reassignment
heuristic.
By default, no functionality change.
This is a follow-up of r212099.
This hook provides a finer grain to control the optimization.
<rdar://problem/
17444599>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212204
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 2 Jul 2014 18:31:35 +0000 (18:31 +0000)]
Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information.
If a function isn't actually in a CU's subprogram list in the debug info
metadata, ignore all the DebugLocs and don't try to build scopes, track
variables, etc.
While this is possibly a minor optimization, it's also a correctness fix
for an incoming patch that will add assertions to LexicalScopes and the
debug info verifier to ensure that all scope chains lead to debug info
for the current function.
Fix up a few test cases that had broken/incomplete debug info that could
violate this constraint.
Add a test case where this occurs by design (inlining a
debug-info-having function in an attribute nodebug function - we want
this to work because /if/ the nodebug function is then inlined into a
debug-info-having function, it should be fine (and will work fine - we
just stitch the scopes up as usual), but should the inlining not happen
we need to not assert fail either).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212203
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 2 Jul 2014 18:30:05 +0000 (18:30 +0000)]
Constify the Function pointers in the result of makeSubprogramMap
These don't need to be mutable and callers being added soon in CodeGen
won't have access to non-const Module&.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212202
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 2 Jul 2014 18:17:40 +0000 (18:17 +0000)]
AArch64: Re-enable AArch64AddressTypePromotion
This reverts commits r212189 and r212190.
While this pass was accidentally disabled (until r212073), r205437
slipped in a use of `auto` that should have been `auto&`.
This fixes PR20188.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212201
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 2 Jul 2014 18:14:03 +0000 (18:14 +0000)]
AArch64: Remove unnecessary parens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212199
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 2 Jul 2014 17:44:53 +0000 (17:44 +0000)]
R600: Fix crashes when an illegal type load or store is not handled.
I don't think anything hits this now, but will be exposed in future
patches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212197
91177308-0d34-0410-b5e6-
96231b3b80d8
Puyan Lotfi [Wed, 2 Jul 2014 17:33:00 +0000 (17:33 +0000)]
Just adding a getHalfTy method to IRBuilder for completeness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212195
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 2 Jul 2014 17:26:39 +0000 (17:26 +0000)]
AArch64: Merge isa with dyn_cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212194
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 2 Jul 2014 17:07:03 +0000 (17:07 +0000)]
XFAIL the test to go with r202189
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212190
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 2 Jul 2014 17:03:16 +0000 (17:03 +0000)]
AArch64: Temporarily disable AArch64AddressTypePromotion
Temporarily disable AArch64AddressTypePromotion, which was effectively
re-enabled in r212073 and r212075, while I look into PR20188.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212189
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Wed, 2 Jul 2014 16:54:41 +0000 (16:54 +0000)]
[ASan] Print exact source location of global variables in error reports.
See https://code.google.com/p/address-sanitizer/issues/detail?id=299 for the
original feature request.
Introduce llvm.asan.globals metadata, which Clang (or any other frontend)
may use to report extra information about global variables to ASan
instrumentation pass in the backend. This metadata replaces
llvm.asan.dynamically_initialized_globals that was used to detect init-order
bugs. llvm.asan.globals contains the following data for each global:
1) source location (file/line/column info);
2) whether it is dynamically initialized;
3) whether it is blacklisted (shouldn't be instrumented).
Source location data is then emitted in the binary and can be picked up
by ASan runtime in case it needs to print error report involving some global.
For example:
0x... is located 4 bytes to the right of global variable 'C::array' defined in '/path/to/file:17:8' (0x...) of size 40
These source locations are printed even if the binary doesn't have any
debug info.
This is an ABI-breaking change. ASan initialization is renamed to
__asan_init_v4(). Pre-built libraries compiled with older Clang will not work
with the fresh runtime.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212188
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 2 Jul 2014 16:46:08 +0000 (16:46 +0000)]
Revert "Revert "MachineScheduler: better book-keeping for asserts.""
This reverts commit r212109, which reverted r212088.
However, disable the assert as it's not necessary for correctness. There are
several corner cases that the assert needed to handle better for in-order
scheduling, but none of them are incorrect scheduler behavior. The assert is
mainly there to collect good unit tests like this and ensure that the
target-independent scheduler is working as expected with the various machine
models.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212187
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Wed, 2 Jul 2014 15:25:25 +0000 (15:25 +0000)]
Also document the 'arc commit' commands in the 'Committing a change' section of the Phabricator doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212184
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 2 Jul 2014 15:09:44 +0000 (15:09 +0000)]
X86: When combining shuffles just remove shuffles that are completely redundant.
CombineTo doesn't allow replacing a node with itself so this would crash if the
combined shuffle is the same as the input shuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212181
91177308-0d34-0410-b5e6-
96231b3b80d8
Axel Naumann [Wed, 2 Jul 2014 14:40:35 +0000 (14:40 +0000)]
Undefine R2, R4, R6 after use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212179
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Wed, 2 Jul 2014 14:11:05 +0000 (14:11 +0000)]
AVX-512: dec/inc instructions are slow on KNL
After Alexey Volkov, I'm adding the same property for KNL, that prefers ADD/SUB instead of INC/DEC.
Added a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212178
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 2 Jul 2014 06:50:48 +0000 (06:50 +0000)]
Move operator[] to DomTreeNodeBase
The comment in base even refers to it, but it was only defined
in the subclass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212169
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 2 Jul 2014 06:45:26 +0000 (06:45 +0000)]
Fix missing const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212168
91177308-0d34-0410-b5e6-
96231b3b80d8