platform/upstream/llvm.git
9 years ago[x86] Prevent llvm.x86.cmp.ps/pd/ss/sd from being selected with bad immediates. The...
Craig Topper [Sat, 27 Dec 2014 18:10:56 +0000 (18:10 +0000)]
[x86] Prevent llvm.x86.cmp.ps/pd/ss/sd from being selected with bad immediates. The frontend now checks this when the builtin is used. This will allow the instruction printer to not have to deal with invalid immediates on these instructions.

llvm-svn: 224885

9 years ago[FastIsel][X86] Fix invalid register replacement for bool args
Keno Fischer [Sat, 27 Dec 2014 13:10:15 +0000 (13:10 +0000)]
[FastIsel][X86] Fix invalid register replacement for bool args

Summary:
Consider the following IR:

  %3 = load i8* undef
  %4 = trunc i8 %3 to i1
  %5 = call %jl_value_t.0* @foo(..., i1 %4, ...)
  ret %jl_value_t.0* %5

Bools (that are the result of direct truncs) are lowered as whatever
the argument to the trunc was and a "and 1", causing the part of the
MBB responsible for this argument to look something like this:

  %vreg8<def,tied1> = AND8ri %vreg7<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg8,%vreg7

Later, when the load is lowered, it will insert

  %vreg15<def> = MOV8rm %vreg14, 1, %noreg, 0, %noreg; mem:LD1[undef] GR8:%vreg15 GR64:%vreg14

but remember to (at the end of isel) replace vreg7 by vreg15. Now for
the bug. In fast isel lowering, we mistakenly mark vreg8 as the result
of the load instead of the trunc. This adds a fixup to have
vreg8 replaced by whatever the result of the load is as well, so
we end up with

  %vreg15<def,tied1> = AND8ri %vreg15<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg15

which is an SSA violation and causes problems later down the road.

This fixes PR21557.

Test Plan: Test test case from PR21557 is added to the test suite.

Reviewers: ributzka

Reviewed By: ributzka

Subscribers: llvm-commits

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

llvm-svn: 224884

9 years ago[x86] Also add the missing type casts on the returns in the sha
Chandler Carruth [Sat, 27 Dec 2014 11:50:51 +0000 (11:50 +0000)]
[x86] Also add the missing type casts on the returns in the sha
intrinsic header file. Along with r224822, this should restore the build
bots to passing.

llvm-svn: 224883

9 years ago[x86] Add missing typecast to __v4si to sha intrinsic header file.
Craig Topper [Sat, 27 Dec 2014 07:19:25 +0000 (07:19 +0000)]
[x86] Add missing typecast to __v4si to sha intrinsic header file.

llvm-svn: 224882

9 years agoObjective-C: Tweak unavailability warning.
Nico Weber [Sat, 27 Dec 2014 07:09:37 +0000 (07:09 +0000)]
Objective-C: Tweak unavailability warning.

Don't warn when a selector has an unavailable and an available variant,
and the first also has an implementation.

llvm-svn: 224881

9 years ago[x86] Add range checking to the constant argument of cmpps/pd/ss/sd builtinas.
Craig Topper [Sat, 27 Dec 2014 07:00:08 +0000 (07:00 +0000)]
[x86] Add range checking to the constant argument of cmpps/pd/ss/sd builtinas.

llvm-svn: 224880

9 years ago[x86] Add the (v)cmpps/pd/ss/sd builtins to match gcc. Use them in the sse intrinsic...
Craig Topper [Sat, 27 Dec 2014 06:59:57 +0000 (06:59 +0000)]
[x86] Add the (v)cmpps/pd/ss/sd builtins to match gcc. Use them in the sse intrinsic files.

This still lower to the same intrinsics as before.

This is preparation for bounds checking the immediate on the avx version of the builtin so we don't pass illegal immediates into the backend. Since SSE uses a smaller size immediate its not possible to bounds check when using a shared builtin. Rather than creating a clang specific builtin for the different immediate, I decided (after consulting with Chandler) that it was better to match gcc.

llvm-svn: 224879

9 years agoAdd more feature flags to the x86 instrinsic test.
Craig Topper [Sat, 27 Dec 2014 06:59:44 +0000 (06:59 +0000)]
Add more feature flags to the x86 instrinsic test.

llvm-svn: 224878

9 years agoFix formatting. NFC.
Craig Topper [Sat, 27 Dec 2014 06:59:37 +0000 (06:59 +0000)]
Fix formatting. NFC.

llvm-svn: 224877

9 years agoAddress review feedback on r221933.
Nico Weber [Sat, 27 Dec 2014 03:58:08 +0000 (03:58 +0000)]
Address review feedback on r221933.

Remove ObjCMethodList::Count, instead store a "has more than one decl" bit in
the low bit of the ObjCMethodDecl pointer, using a PointerIntPair.

Most of this patch is replacing ".Method" with ".getMethod()".

No intended behavior change.

llvm-svn: 224876

9 years agoMake the test from r224873 actually pass.
Nico Weber [Sat, 27 Dec 2014 03:38:18 +0000 (03:38 +0000)]
Make the test from r224873 actually pass.

The behavior looks incorrect to me, but the test is supposed to document
current behavior for now.

llvm-svn: 224875

9 years agoMark __builtin_ia32_cmppd256 and __builtin_ia32_cmpps256 as taking an ICE for the...
Craig Topper [Sat, 27 Dec 2014 01:20:16 +0000 (01:20 +0000)]
Mark __builtin_ia32_cmppd256 and __builtin_ia32_cmpps256 as taking an ICE for the constant parameter.

llvm-svn: 224874

9 years agoAdd more test coverage for the Objective-C deprected selector warning.
Nico Weber [Sat, 27 Dec 2014 01:05:55 +0000 (01:05 +0000)]
Add more test coverage for the Objective-C deprected selector warning.

I broke this case in a local patch I'm writing, and there was no test to stop
me.  Now there is.

llvm-svn: 224873

9 years agoConvert test to llvm-readobj. NFC.
Rafael Espindola [Fri, 26 Dec 2014 22:47:39 +0000 (22:47 +0000)]
Convert test to llvm-readobj. NFC.

llvm-svn: 224872

9 years ago[Hexagon] Adding auto-incrementing loads with and without byte reversal.
Colin LeMahieu [Fri, 26 Dec 2014 21:09:25 +0000 (21:09 +0000)]
[Hexagon] Adding auto-incrementing loads with and without byte reversal.

llvm-svn: 224871

9 years ago[Hexagon] Adding locked loads.
Colin LeMahieu [Fri, 26 Dec 2014 20:42:27 +0000 (20:42 +0000)]
[Hexagon] Adding locked loads.

llvm-svn: 224870

9 years ago[Hexagon] Adding deallocframe and circular addressing loads.
Colin LeMahieu [Fri, 26 Dec 2014 20:30:58 +0000 (20:30 +0000)]
[Hexagon] Adding deallocframe and circular addressing loads.

llvm-svn: 224869

9 years ago[Hexagon] Adding remaining post-increment instruction variants. Removing unused...
Colin LeMahieu [Fri, 26 Dec 2014 19:31:46 +0000 (19:31 +0000)]
[Hexagon] Adding remaining post-increment instruction variants.  Removing unused classes.

llvm-svn: 224868

9 years ago[Hexagon] Adding post-increment unsigned byte loads.
Colin LeMahieu [Fri, 26 Dec 2014 19:12:11 +0000 (19:12 +0000)]
[Hexagon] Adding post-increment unsigned byte loads.

llvm-svn: 224867

9 years ago[Hexagon] Adding post-increment signed byte loads with tests.
Colin LeMahieu [Fri, 26 Dec 2014 18:57:13 +0000 (18:57 +0000)]
[Hexagon] Adding post-increment signed byte loads with tests.

llvm-svn: 224866

9 years agoAdjust the rest of the tests due to r224849.
David Majnemer [Fri, 26 Dec 2014 18:45:57 +0000 (18:45 +0000)]
Adjust the rest of the tests due to r224849.

llvm-svn: 224865

9 years agoUse llvm-readobj. NFC.
Rafael Espindola [Fri, 26 Dec 2014 18:22:05 +0000 (18:22 +0000)]
Use llvm-readobj. NFC.

llvm-svn: 224864

9 years agoEscape ? to silence GCC warning about trigraphs.
Daniel Jasper [Fri, 26 Dec 2014 18:21:34 +0000 (18:21 +0000)]
Escape ? to silence GCC warning about trigraphs.

llvm-svn: 224863

9 years ago[X86] Add the debug registers DR8-DR15 so we can assemble and disassemble references...
Craig Topper [Fri, 26 Dec 2014 18:20:05 +0000 (18:20 +0000)]
[X86] Add the debug registers DR8-DR15 so we can assemble and disassemble references to them.

llvm-svn: 224862

9 years ago[X86] Don't fail disassembly if REX.R/REX.B is used on an MMX register. Similar fix...
Craig Topper [Fri, 26 Dec 2014 18:19:44 +0000 (18:19 +0000)]
[X86] Don't fail disassembly if REX.R/REX.B is used on an MMX register. Similar fix to not fail to disassembler CR9-CR15 references.

llvm-svn: 224861

9 years agoBand-aid fix for PR22032: don't emit DWARF debug info if AddressSanitizer is enabled...
Timur Iskhodzhanov [Fri, 26 Dec 2014 17:00:51 +0000 (17:00 +0000)]
Band-aid fix for PR22032: don't emit DWARF debug info if AddressSanitizer is enabled on Windows

llvm-svn: 224860

9 years agoNo need to run llvm-as. NFC.
Rafael Espindola [Fri, 26 Dec 2014 16:42:47 +0000 (16:42 +0000)]
No need to run llvm-as. NFC.

llvm-svn: 224859

9 years ago[sanitizer] Treat \r, \n, \t as flag separators.
Evgeniy Stepanov [Fri, 26 Dec 2014 16:09:15 +0000 (16:09 +0000)]
[sanitizer] Treat \r, \n, \t as flag separators.

llvm-svn: 224858

9 years ago[asan] Fix possibly uninitialized coverage flag.
Evgeniy Stepanov [Fri, 26 Dec 2014 16:07:33 +0000 (16:07 +0000)]
[asan] Fix possibly uninitialized coverage flag.

llvm-svn: 224857

9 years ago[ASan/Win] Add basic support for MemoryRangeIsAvailable and DumpProcessMap to make...
Timur Iskhodzhanov [Fri, 26 Dec 2014 14:28:32 +0000 (14:28 +0000)]
[ASan/Win] Add basic support for MemoryRangeIsAvailable and DumpProcessMap to make it easier to debug startup shadow mapping failures

llvm-svn: 224856

9 years ago[asan] Bump coverage size limit on 32-bit platforms.
Evgeniy Stepanov [Fri, 26 Dec 2014 13:54:11 +0000 (13:54 +0000)]
[asan] Bump coverage size limit on 32-bit platforms.

This increases the limit from 4M locations to 16M, reserving
64Mb virtual memory. Chrome has >5M unique coverage locations with coverage=3.

llvm-svn: 224855

9 years ago[asan] Extend coverage test.
Evgeniy Stepanov [Fri, 26 Dec 2014 12:51:31 +0000 (12:51 +0000)]
[asan] Extend coverage test.

llvm-svn: 224854

9 years ago[asan] Allow enabling coverage at activation.
Evgeniy Stepanov [Fri, 26 Dec 2014 12:32:32 +0000 (12:32 +0000)]
[asan] Allow enabling coverage at activation.

This is a re-commit of r224838 + r224839, previously reverted in r224850.
Test failures were likely (still can not reproduce) caused by two lit tests
using the same name for an intermediate build target.

llvm-svn: 224853

9 years ago[ASan/Win] Suppress error messaging when Abort() is called
Timur Iskhodzhanov [Fri, 26 Dec 2014 12:25:54 +0000 (12:25 +0000)]
[ASan/Win] Suppress error messaging when Abort() is called
This will prevent ASan bots from hanging / timing out

llvm-svn: 224852

9 years agoUpdate tests due to r224849
David Majnemer [Fri, 26 Dec 2014 10:29:40 +0000 (10:29 +0000)]
Update tests due to r224849

Inferring nuw caused some clang tests to change their output.

llvm-svn: 224851

9 years agoRevert r224838, r224839.
Evgeniy Stepanov [Fri, 26 Dec 2014 10:19:56 +0000 (10:19 +0000)]
Revert r224838, r224839.

Flaky failures on the build bots.

llvm-svn: 224850

9 years agoInstCombine: Infer nuw for multiplies
David Majnemer [Fri, 26 Dec 2014 09:50:35 +0000 (09:50 +0000)]
InstCombine: Infer nuw for multiplies

A multiply cannot unsigned wrap if there are bitwidth, or more, leading
zero bits between the two operands.

llvm-svn: 224849

9 years agoValueTracking: Small cleanup in ComputeNumSignBits
David Majnemer [Fri, 26 Dec 2014 09:20:17 +0000 (09:20 +0000)]
ValueTracking: Small cleanup in ComputeNumSignBits

Constant contains the isAllOnesValue and isNullValue predicates, not
ConstantInt.

llvm-svn: 224848

9 years agoInstCombe: Infer nsw for multiplies
David Majnemer [Fri, 26 Dec 2014 09:10:14 +0000 (09:10 +0000)]
InstCombe: Infer nsw for multiplies

We already utilize this logic for reducing overflow intrinsics, it makes
sense to reuse it for normal multiplies as well.

llvm-svn: 224847

9 years agoTeach disassembler to handle illegal immediates on (v)cmpps/pd/ss/sd instructions...
Craig Topper [Fri, 26 Dec 2014 06:36:28 +0000 (06:36 +0000)]
Teach disassembler to handle illegal immediates on (v)cmpps/pd/ss/sd instructions. Instead of rejecting we'll just generate the _alt forms that don't try to alter the mnemonic. While I'm here, merge some common code in the Instruction printers for the condition code replacement and fix the mask on SSE to be 3-bits instead of 4.

llvm-svn: 224846

9 years agoUse MCPhysReg for table of register encodings.
Craig Topper [Fri, 26 Dec 2014 06:36:23 +0000 (06:36 +0000)]
Use MCPhysReg for table of register encodings.

llvm-svn: 224845

9 years agoSema: Qualify getPrintable's Expr argument
David Majnemer [Fri, 26 Dec 2014 06:06:56 +0000 (06:06 +0000)]
Sema: Qualify getPrintable's Expr argument

getPrintable has an overload which takes a bool.  This means that const
qualified Exprs would get forwarded to the bool overload instead of the
Expr overload.

llvm-svn: 224844

9 years agoWIP
David Majnemer [Fri, 26 Dec 2014 06:06:53 +0000 (06:06 +0000)]
WIP

llvm-svn: 224843

9 years ago[PowerPC] [FastISel] i1 constants must be zero extended
Hal Finkel [Thu, 25 Dec 2014 23:08:25 +0000 (23:08 +0000)]
[PowerPC] [FastISel] i1 constants must be zero extended

When materializing constant i1 values, they must be zero extended. We represent
i1 values as [0, 1], not [0, -1], in i32 registers. As it turns out, this code
path was dead for i1 values prior to r216006 (which is why this did not manifest in
miscompiles until recently).

Fixes -O0 self-hosting on PPC64/Linux.

llvm-svn: 224842

9 years ago[sanitizer] Tweak sancov.py output.
Evgeniy Stepanov [Thu, 25 Dec 2014 16:03:24 +0000 (16:03 +0000)]
[sanitizer] Tweak sancov.py output.

llvm-svn: 224841

9 years ago[sanitizer] sancov.py: print status to stderr
Evgeniy Stepanov [Thu, 25 Dec 2014 16:01:09 +0000 (16:01 +0000)]
[sanitizer] sancov.py: print status to stderr

llvm-svn: 224840

9 years ago[asan] Disable __sanitizer_cov_dump registration on Windows.
Evgeniy Stepanov [Thu, 25 Dec 2014 15:11:00 +0000 (15:11 +0000)]
[asan] Disable __sanitizer_cov_dump registration on Windows.

Looks like we can't use atexit() during ASan initialization on Windows.

llvm-svn: 224839

9 years ago[asan] Allow enabling coverage at activation.
Evgeniy Stepanov [Thu, 25 Dec 2014 14:26:45 +0000 (14:26 +0000)]
[asan] Allow enabling coverage at activation.

llvm-svn: 224838

9 years agoSimplify allocator_returns_null.cc test
Timur Iskhodzhanov [Thu, 25 Dec 2014 13:03:58 +0000 (13:03 +0000)]
Simplify allocator_returns_null.cc test

llvm-svn: 224837

9 years agoInitialize BackendConsumer::Context in constructor.
Yaron Keren [Thu, 25 Dec 2014 12:21:56 +0000 (12:21 +0000)]
Initialize BackendConsumer::Context in constructor.

llvm-svn: 224836

9 years agoInitialize CodeGeneratorImpl::Ctx in constructor.
Yaron Keren [Thu, 25 Dec 2014 11:38:15 +0000 (11:38 +0000)]
Initialize CodeGeneratorImpl::Ctx in constructor.

llvm-svn: 224835

9 years agotsan: fix trace initialization during thread id reuse
Dmitry Vyukov [Thu, 25 Dec 2014 10:32:25 +0000 (10:32 +0000)]
tsan: fix trace initialization during thread id reuse

The current code leaves the first event in the trace part uninitialized
(from the previous thread). It can cause unpredictable behavior
during stack/mutexset restoration.
Initialize the first event to a fake harmless memory access.

llvm-svn: 224834

9 years agoSilence GCC's -Wparentheses warning
David Majnemer [Thu, 25 Dec 2014 10:03:23 +0000 (10:03 +0000)]
Silence GCC's -Wparentheses warning

No functionality change intended.

llvm-svn: 224833

9 years agoDocumentation for Masked Load and Store intrinsics.
Elena Demikhovsky [Thu, 25 Dec 2014 09:29:13 +0000 (09:29 +0000)]
Documentation for Masked Load and Store intrinsics.

llvm-svn: 224832

9 years ago[Mips] Replace stderr output by the `llvm_unreachable` call
Simon Atanasyan [Thu, 25 Dec 2014 09:23:47 +0000 (09:23 +0000)]
[Mips] Replace stderr output by the `llvm_unreachable` call

If a regular symbol has microMIPS-bit we need to stop linking. Now the
LLD does not check the `applyRelocation` return value and continues
linking anyway. As a temporary workaround use the `llvm_unreachable`
call to stop the linker.

llvm-svn: 224831

9 years ago[Mips] Make the test more tolerant to the linker output order
Simon Atanasyan [Thu, 25 Dec 2014 09:23:37 +0000 (09:23 +0000)]
[Mips] Make the test more tolerant to the linker output order

The LLD output in the YAML mode depends on LLD_RUN_ROUNDTRIP_TEST
environment variable. Do not check unimportant YAML items like section-name.

llvm-svn: 224830

9 years agoMasked Load/Store - Changed the order of parameters in intrinsics.
Elena Demikhovsky [Thu, 25 Dec 2014 07:49:20 +0000 (07:49 +0000)]
Masked Load/Store - Changed the order of parameters in intrinsics.
No functional changes.
The documentation is coming.

llvm-svn: 224829

9 years agoCodeGen: Error on redefinitions instead of asserting
David Majnemer [Wed, 24 Dec 2014 23:06:55 +0000 (23:06 +0000)]
CodeGen: Error on redefinitions instead of asserting

It's possible to have a prior definition of a symbol in module asm.
Raise an error instead of crashing.

llvm-svn: 224828

9 years agoCodeGen: Allow aliases to be overridden by variables
David Majnemer [Wed, 24 Dec 2014 22:44:29 +0000 (22:44 +0000)]
CodeGen: Allow aliases to be overridden by variables

llvm-svn: 224827

9 years ago[Mips] Support linking of microMIPS 32-bit code
Simon Atanasyan [Wed, 24 Dec 2014 21:04:05 +0000 (21:04 +0000)]
[Mips] Support linking of microMIPS 32-bit code

The change is rather large but mainly it just adds handling of new relocations,
PLT entries etc.

llvm-svn: 224826

9 years agoMC: address some comments in deprecation checks
Saleem Abdulrasool [Wed, 24 Dec 2014 18:40:42 +0000 (18:40 +0000)]
MC: address some comments in deprecation checks

Bob Wilson pointed out the unnecessary checks that had been committed to the
instruction check predicates.  The check was meant to ensure that the check was
not accidentally applied to non-ARM instructions.  This is better served as an
assertion rather than a condition check.

llvm-svn: 224825

9 years ago[asan] Support ASAN_ACTIVATION_OPTIONS.
Evgeniy Stepanov [Wed, 24 Dec 2014 16:58:50 +0000 (16:58 +0000)]
[asan] Support ASAN_ACTIVATION_OPTIONS.

This is mostly useful for testing, as the only other way of specifying
activation options (Android system property) is system-wide and affects
concurrently running tests.

llvm-svn: 224824

9 years ago[ASan/Win] Bandaid fix for PR22025 -- deadlocks when creating suspended threads
Timur Iskhodzhanov [Wed, 24 Dec 2014 16:14:16 +0000 (16:14 +0000)]
[ASan/Win] Bandaid fix for PR22025 -- deadlocks when creating suspended threads

llvm-svn: 224823

9 years ago[sanitizer] Disable InternalMmapWithOffset test on OSX.
Evgeniy Stepanov [Wed, 24 Dec 2014 13:59:35 +0000 (13:59 +0000)]
[sanitizer] Disable InternalMmapWithOffset test on OSX.

llvm-svn: 224822

9 years ago[sanitizer] Fix off-by-8x in direct coverage.
Evgeniy Stepanov [Wed, 24 Dec 2014 13:57:11 +0000 (13:57 +0000)]
[sanitizer] Fix off-by-8x in direct coverage.

File mapping offset was calculated by offsetting (uptr *) instead of (char *).

llvm-svn: 224821

9 years ago[sanitizer] Disable InternalMmapWithOffset test on Windows.
Evgeniy Stepanov [Wed, 24 Dec 2014 13:05:21 +0000 (13:05 +0000)]
[sanitizer] Disable InternalMmapWithOffset test on Windows.

llvm-svn: 224820

9 years ago[sanitizer] mmap2 syscall works with 4096-byte units instead of bytes.
Evgeniy Stepanov [Wed, 24 Dec 2014 12:58:09 +0000 (12:58 +0000)]
[sanitizer] mmap2 syscall works with 4096-byte units instead of bytes.

Ouch.

llvm-svn: 224819

9 years ago[asan] Disable one test on Android.
Evgeniy Stepanov [Wed, 24 Dec 2014 12:23:15 +0000 (12:23 +0000)]
[asan] Disable one test on Android.

It used to pass by chance and started failing on recent Android builds.

llvm-svn: 224818

9 years ago[Mips] Join two if statements
Simon Atanasyan [Wed, 24 Dec 2014 12:19:42 +0000 (12:19 +0000)]
[Mips] Join two if statements

No functional changes.

llvm-svn: 224817

9 years ago[Mips] Make the comment more descriptive
Simon Atanasyan [Wed, 24 Dec 2014 12:19:36 +0000 (12:19 +0000)]
[Mips] Make the comment more descriptive

No functional changes.

llvm-svn: 224816

9 years ago[Mips] Factor out the code checks a symbol's binding
Simon Atanasyan [Wed, 24 Dec 2014 12:19:30 +0000 (12:19 +0000)]
[Mips] Factor out the code checks a symbol's binding

No functional changes.

llvm-svn: 224815

9 years ago[Mips] Rename the function s/readAddend/getAddend/
Simon Atanasyan [Wed, 24 Dec 2014 12:19:24 +0000 (12:19 +0000)]
[Mips] Rename the function s/readAddend/getAddend/

No functional changes.

llvm-svn: 224814

9 years ago[Mips] Use OR operation to set the microMIPS bit
Simon Atanasyan [Wed, 24 Dec 2014 12:19:18 +0000 (12:19 +0000)]
[Mips] Use OR operation to set the microMIPS bit

llvm-svn: 224813

9 years ago[ASan] Fix asan_preload_test-2 on PowerPC64 Linux
Jay Foad [Wed, 24 Dec 2014 11:48:40 +0000 (11:48 +0000)]
[ASan] Fix asan_preload_test-2 on PowerPC64 Linux

Summary:
This test failed because clang compiled the call to memset() into a
single sth instruction, instead of a call. Fix it by using write() instead
of memset().

Reviewers: kcc, samsonov, garious, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 224812

9 years agoMC: Label definitions are permitted after .set directives
David Majnemer [Wed, 24 Dec 2014 10:27:50 +0000 (10:27 +0000)]
MC: Label definitions are permitted after .set directives

.set directives may be overridden by other .set directives as well as
label definitions.

This fixes PR22019.

llvm-svn: 224811

9 years agoIAS: correct debug line info for asm macros
Saleem Abdulrasool [Wed, 24 Dec 2014 06:32:43 +0000 (06:32 +0000)]
IAS: correct debug line info for asm macros

Correct the line information generation for preprocessed assembly.  Although we
tracked the source information for the macro instantiation, we failed to account
for the fact that we were instantiating a macro, which is populated into a new
buffer and that the line information would be relative to the definition rather
than the actual instantiation location.  This could cause the line number
associated with the statement to be very high due to wrapping of the difference
calculated for the preprocessor line information emitted into the stream.
Properly calculate the line for the macro instantiation, referencing the line
where the macro is actually used as GCC/gas do.

The test case uses x86, though the same problem exists on any other target using
the LLVM IAS.

llvm-svn: 224810

9 years ago[X86] Remove the single AdSize indicator and replace it with separate AdSize16/32...
Craig Topper [Wed, 24 Dec 2014 06:05:22 +0000 (06:05 +0000)]
[X86] Remove the single AdSize indicator and replace it with separate AdSize16/32/64 flags.

This removes a hardcoded list of instructions in the CodeEmitter. Eventually I intend to remove the predicates on the affected instructions since in any given mode two of them are valid if we supported addr32/addr16 prefixes in the assembler.

llvm-svn: 224809

9 years agoMC: Don't emit .no_dead_strip on targets which don't support it
David Majnemer [Wed, 24 Dec 2014 04:11:42 +0000 (04:11 +0000)]
MC: Don't emit .no_dead_strip on targets which don't support it

llvm-svn: 224808

9 years agoLiveInterval: Remove accidentally committed debug code.
Matthias Braun [Wed, 24 Dec 2014 02:35:07 +0000 (02:35 +0000)]
LiveInterval: Remove accidentally committed debug code.

llvm-svn: 224807

9 years agoLiveInterval: Introduce createMainRangeFromSubranges().
Matthias Braun [Wed, 24 Dec 2014 02:11:51 +0000 (02:11 +0000)]
LiveInterval: Introduce createMainRangeFromSubranges().

This function constructs the main liverange by merging all subranges if
subregister liveness tracking is available. This should be slightly
faster to compute instead of performing the liveness calculation again
for the main range. More importantly it avoids cases where the main
liverange would cover positions where no subrange was live. These cases
happened for partial definitions where the actual defined part was dead
and only the undefined parts used later.

The register coalescing requires that every part covered by the main
live range has at least one subrange live.

I also expect this function to become usefull later for places where the
subranges are modified in a way that it is hard to correctly fix the
main liverange in the machine scheduler, we can simply reconstruct it
from subranges then.

llvm-svn: 224806

9 years agoRegisterCoalescer: With subrange liveness there may be no RedefVNI for unused lanes.
Matthias Braun [Wed, 24 Dec 2014 02:11:48 +0000 (02:11 +0000)]
RegisterCoalescer: With subrange liveness there may be no RedefVNI for unused lanes.

llvm-svn: 224805

9 years agoLiveRangeEdit: Check for completely empy subranges after removing ValNos.
Matthias Braun [Wed, 24 Dec 2014 02:11:46 +0000 (02:11 +0000)]
LiveRangeEdit: Check for completely empy subranges after removing ValNos.

Completely empty subranges are not allowed and must be removed when
subreg liveness is enabled.

llvm-svn: 224804

9 years agoLiveIntervalAnalysis: Fix performance bug that I introduced in r224663.
Matthias Braun [Wed, 24 Dec 2014 02:11:43 +0000 (02:11 +0000)]
LiveIntervalAnalysis: Fix performance bug that I introduced in r224663.

Without a reference the code did not remember when moving the iterators
of the subranges/registerunit ranges forward and instead would scan from
the beginning again at the next position.

llvm-svn: 224803

9 years ago[OCaml] PR21901: Update tests.
Peter Zotov [Wed, 24 Dec 2014 01:58:45 +0000 (01:58 +0000)]
[OCaml] PR21901: Update tests.

This finishes the fix partially applied by r224782.

llvm-svn: 224802

9 years ago[OCaml] Expose Llvm_executionengine.get_{global_value,function}_address.
Peter Zotov [Wed, 24 Dec 2014 01:52:51 +0000 (01:52 +0000)]
[OCaml] Expose Llvm_executionengine.get_{global_value,function}_address.

Patch by Ramkumar Ramachandra <artagnon@gmail.com>.

Also remove Llvm_executionengine.get_pointer_to_global, as it
is actually deprecated and didn't appear in a stable release.

llvm-svn: 224801

9 years ago[SROA] Update the documentation and names for accessing the slices
Chandler Carruth [Wed, 24 Dec 2014 01:48:09 +0000 (01:48 +0000)]
[SROA] Update the documentation and names for accessing the slices
within a partition of an alloca in SROA.

This reflects the fact that the organization of the slices isn't really
ideal for analysis, but is the naive way in which the slices are
available while we're processing them in the core partitioning
algorithm.

It is possible we could improve matters, and I've left a FIXME with
one of my ideas for how to do this, but it is a lot of work, the benefit
is somewhat minor, and it isn't clear that it would be strictly better.
=/ Not really satisfying, but I'm out of really good ideas.

This also improves one place where the debug logging failed to mark some
split partitions. Now we log in one place, slightly later, and with
accurate information about whether the slice is split by the partition
being rewritten.

llvm-svn: 224800

9 years agoDebug Info: In symmetry to DW_TAG_pointer_type, do not emit the byte size
Adrian Prantl [Wed, 24 Dec 2014 01:17:51 +0000 (01:17 +0000)]
Debug Info: In symmetry to DW_TAG_pointer_type, do not emit the byte size
of a DW_TAG_ptr_to_member_type.
This restores the behavior from before r224780-r224781.

llvm-svn: 224799

9 years ago[SROA] Refactor the integer and vector promotion testing logic to
Chandler Carruth [Wed, 24 Dec 2014 01:05:14 +0000 (01:05 +0000)]
[SROA] Refactor the integer and vector promotion testing logic to
operate in terms of the new Partition class, and generally have a more
clear set of arguments. No functionality changed.

The most notable improvements here are consistently using the
terminology of 'partition' for a collection of slices that will be
rewritten together and 'slice' for a region of an alloca that is used by
a particular instruction.

This also makes it more clear that the split things are actually slices
as well, just ones that will be split by the proposed partition.

This doesn't yet address the confusing aspects of the partition's
interface where slices that will be split by the partition and start
prior to the partition are accesssed via Partition::splitSlices() while
the core range of slices exposed by a Partition includes both unsplit
slices and slices which will be split by the end, but started within the
offset range of the partition. This is particularly hard to address
because the algorithm which computes partitions quite literally doesn't
know which slices these will end up being until too late. I'm looking at
whether I can fix that or not, but I'm not optimistic. I'll update the
comments and/or names to further explain this either way. I've also
added one FIXME in this patch relating to this confusion so that I don't
forget about it.

llvm-svn: 224798

9 years ago[analyzer] Updated progress for memory.ZeroAlloc
Anton Yartsev [Wed, 24 Dec 2014 01:04:38 +0000 (01:04 +0000)]
[analyzer] Updated progress for memory.ZeroAlloc

llvm-svn: 224797

9 years ago[analyzer] +memory.ZeroAlloc
Anton Yartsev [Wed, 24 Dec 2014 00:46:56 +0000 (00:46 +0000)]
[analyzer] +memory.ZeroAlloc

llvm-svn: 224796

9 years ago[Hexagon] Removing old classes.
Colin LeMahieu [Wed, 24 Dec 2014 00:43:00 +0000 (00:43 +0000)]
[Hexagon] Removing old classes.

llvm-svn: 224795

9 years agoAnother attempt to fix the LLVM Windows build bot lld-x86_64-win7, one last place...
Kevin Enderby [Wed, 24 Dec 2014 00:16:51 +0000 (00:16 +0000)]
Another attempt to fix the LLVM Windows build bot lld-x86_64-win7, one last place to fix I think.

llvm-svn: 224794

9 years agoAttempt to fix the LLVM Windows build bot lld-x86_64-win7.
Kevin Enderby [Tue, 23 Dec 2014 23:43:59 +0000 (23:43 +0000)]
Attempt to fix the LLVM Windows build bot lld-x86_64-win7.

llvm-svn: 224793

9 years agoAdd printing the LC_THREAD load commands with llvm-objdump’s -private-headers.
Kevin Enderby [Tue, 23 Dec 2014 22:56:39 +0000 (22:56 +0000)]
Add printing the LC_THREAD load commands with llvm-objdump’s -private-headers.

llvm-svn: 224792

9 years agoclang-cl: Various changes to /Zc: handling.
Nico Weber [Tue, 23 Dec 2014 22:55:34 +0000 (22:55 +0000)]
clang-cl: Various changes to /Zc: handling.

* /Zc:trigraphs and /Zc:trigraphs- are now honored
* /Zc:strictStrings is now honored
* /Zc:auto is now honored/ignored (clang does the Right Thing for this already)

Also add a dedicated test for the various /Zc: flags.
clang-cl doesn't always agree with cl.exe on the default values for /Zc flags.
For example, I think clang always behaves as if /Zc:inline is passed, and
warns if the user explicitly passes /Zc:inline-

Fixes PR21974.

llvm-svn: 224791

9 years agoAdd driver flags -ftrigraphs, -fno-trigraphs.
Nico Weber [Tue, 23 Dec 2014 22:32:37 +0000 (22:32 +0000)]
Add driver flags -ftrigraphs, -fno-trigraphs.

-trigraphs is now an alias for -ftrigraphs.  -fno-trigraphs makes it possible
to explicitly disable trigraphs, which couldn't be done before.

  clang -std=c++11 -fno-trigraphs

now builds without GNU extensions, but with trigraphs disabled.  Previously,
trigraphs were only disabled in GNU modes or with -std=c++1z.

Make the new -f flags the cc1 interface too.  This requires changing -trigraphs
to -ftrigraphs in a few cc1 tests.

Related to PR21974.

llvm-svn: 224790

9 years ago[asan] change the coverage collection scheme so that we can easily emit coverage...
Kostya Serebryany [Tue, 23 Dec 2014 22:32:17 +0000 (22:32 +0000)]
[asan] change the coverage collection scheme so that we can easily emit coverage for the entire process as a single bit set, and if coverage_bitset=1 actually emit that bitset

llvm-svn: 224789

9 years ago[PowerPC] Ensure that the TOC reload directly follows bctrl on PPC64
Hal Finkel [Tue, 23 Dec 2014 22:29:40 +0000 (22:29 +0000)]
[PowerPC] Ensure that the TOC reload directly follows bctrl on PPC64

On non-Darwin PPC64, the TOC reload needs to come directly after the bctrl
instruction (for indirect calls) because the 'bctrl/ld 2, 40(1)' instruction
sequence is interpreted by the unwinding code in libgcc. To make sure these
occur as a pair, as with other pairings interpreted by the linker, fuse the two
instructions into one instruction (for code generation only).

In the future, we might wish to do this by emitting CFI directives instead,
but this solution is simpler, and mirrors what GCC does. Additional discussion
on this point is contained in the PR.

Fixes PR22015.

llvm-svn: 224788

9 years ago[Hexagon] Adding doubleword load.
Colin LeMahieu [Tue, 23 Dec 2014 20:44:59 +0000 (20:44 +0000)]
[Hexagon] Adding doubleword load.

llvm-svn: 224787

9 years ago[Hexagon] Reapplying 224775 load words.
Colin LeMahieu [Tue, 23 Dec 2014 20:02:16 +0000 (20:02 +0000)]
[Hexagon] Reapplying 224775 load words.

llvm-svn: 224786