platform/upstream/coreclr.git
7 years agoMerge pull request #8122 from alsemenn/add_debuggertests_build
Sasha Semennikov [Mon, 21 Nov 2016 23:46:08 +0000 (15:46 -0800)]
Merge pull request #8122 from alsemenn/add_debuggertests_build

Add debuggertests build

7 years agoMerge pull request #8106 from mikedn/magic-div
Russell C Hadley [Mon, 21 Nov 2016 20:54:46 +0000 (12:54 -0800)]
Merge pull request #8106 from mikedn/magic-div

Move magic division optimization from morph to lowering

7 years agoMerge pull request #8208 from adiaaida/fixShiftDecomp
Michelle McDaniel [Mon, 21 Nov 2016 18:48:05 +0000 (10:48 -0800)]
Merge pull request #8208 from adiaaida/fixShiftDecomp

Fix ordering of operands on GT_RSZ

7 years agoMerge pull request #8216 from stephentoub/asynclocal_allocs
Stephen Toub [Mon, 21 Nov 2016 16:09:16 +0000 (11:09 -0500)]
Merge pull request #8216 from stephentoub/asynclocal_allocs

Improve AsyncLocal throughput and memory usage

7 years agoRemove unsafe banned functions (#8162)
Jan Vorlicek [Mon, 21 Nov 2016 15:22:45 +0000 (16:22 +0100)]
Remove unsafe banned functions (#8162)

This change removes _snwprintf, _snprintf and _vsnwprintf usage from CoreCLR and
their implementations from PAL.
PAL exposes their secure variants instead and CoreCLR now uses those instead.
I have also removed the StringCchPrintfA/W, StringCchVPrintfA/W, StringCbVPrintfA/W,
StringCbPrintfA/W, StringCbPrintfExA/W, StringCchVPrintfExA/W, StringCbVPrintfExA/W
and StringCchPrintfExA/W replaced their usage by the secure variants of the sprintf
functions, since they were used at only few places and implementing all of the variants
using the secure sprintf variants would be a hassle.
I also needed to fix a missing support for size modifiers for %p formatting character
and for wide characters / strings in the secure sprintf functions that was revealed
by the PAL tests.
I have also removed a bunch of PAL tests that were using %n formatting character which
was not implemented since it is considered unsafe and translated PAL tests that were using
the removed functions to use the safe variants of those.

7 years agoAddress PR feedback
Stephen Toub [Mon, 21 Nov 2016 12:36:15 +0000 (07:36 -0500)]
Address PR feedback

- Delete !FEATURE_CORECLR code from ExecutionContext
- Add support for downgrading between map types when values are set to null
- Change ManyElementAsyncLocalValueMap.Set to size the dictionary based on whether the key is in the existing map

7 years agoFix "method has no body, 'ret' emitted" warning (#8212)
mikedn [Mon, 21 Nov 2016 02:08:45 +0000 (06:08 +0400)]
Fix "method has no body, 'ret' emitted" warning (#8212)

7 years agoMerge pull request #8057 from CarolEidt/StructOpts2
Carol Eidt [Mon, 21 Nov 2016 02:07:10 +0000 (18:07 -0800)]
Merge pull request #8057 from CarolEidt/StructOpts2

Enable optimization of structs

7 years agoImprove AsyncLocal throughput and memory usage
Stephen Toub [Sun, 20 Nov 2016 22:25:47 +0000 (17:25 -0500)]
Improve AsyncLocal throughput and memory usage

ExecutionContext stores an immutable dictionary used to hold the values of all AsyncLocal instances associated with that context.  Reading an AsyncLocal.Value looks up a value in the dictionary, keyed by the AsyncLocal instance.  Writing an AsyncLocal.Value creates a new dictionary with the contents of the old one and then sets the new pair into it. For small numbers of AsyncLocal instances, this adds a lot of overhead.

This commit adds a new internal IAsyncLocalValueMap interface that's used instead of Dictionary.  It then provides several concrete implementations of that interface, for 1 pair, 2 pairs, 3 pairs, up to 16 pairs, and then up to any number of pairs.  The first three implementations are optimized for those sizes, while the one for up to 16 uses an array, and the one for beyond that is just a Dictionary.

7 years agoFixing arm subsystem version (#8211)
Peter Marcu [Sun, 20 Nov 2016 07:37:51 +0000 (23:37 -0800)]
Fixing arm subsystem version (#8211)

7 years agoGeneric Dictionary - add constructor that accepts IEnumerable
Dan Moseley [Sat, 19 Nov 2016 18:24:21 +0000 (10:24 -0800)]
Generic Dictionary - add constructor that accepts IEnumerable

Generic Dictionary - add constructor that accepts IEnumerable

7 years agoAdd System.Collections.Generic.Dictionary constructor that accepts
Robert Matusewicz [Thu, 17 Nov 2016 09:37:43 +0000 (09:37 +0000)]
Add System.Collections.Generic.Dictionary constructor that accepts
IEnumerable<KeyValyePair<TKey, TValue>> to initialize dictionary

7 years agoReinstate the struct optimization changes:
Carol Eidt [Wed, 9 Nov 2016 17:09:49 +0000 (09:09 -0800)]
Reinstate the struct optimization changes:

Remove many of the restrictions on structs that were added to preserve behavior of the old IR form.
Change the init block representation to not require changing the parent when a copy block is changed to an init.
In addition, fix the bug that was causing the corefx  ValueTuple  tests to fail. This was a bug in assertion prop where it was not invaliding the assertions about the parent struct when a field is modified. Add a repro test case for that bug.
Incorporate the fix to #7954, which was encountered after the earlier version of these changes. This was a case where we reused a struct temp, and then it wound up eventually getting assigned the value it originally contained, so we had V09 = V09. This hit the assert in liveness where it wasn't expecting to find a struct assignment with the same lclVar on the lhs and rhs. This assert should have been eliminated with the IR change to struct assignments, but when this situation arises we may run into issues if we call a helper that doesn't expect the lhs and rhs to be the same. So, change morph to eliminate such assignments.

7 years agoFix ordering of operands on GT_RSZ
Michelle McDaniel [Fri, 18 Nov 2016 22:12:30 +0000 (14:12 -0800)]
Fix ordering of operands on GT_RSZ

By removing hiOp1 and loOp1 from LIR and then putting them back in, we
inadvertantly reversed the order of operations for high and lo. This is an
issue when op1 is a long add or sub where the order of operations is
important.

Fixes 8171.

7 years agoMerge pull request #8180 from jashook/arm64_lst_update
Jarret Shook [Fri, 18 Nov 2016 21:28:31 +0000 (13:28 -0800)]
Merge pull request #8180 from jashook/arm64_lst_update

Update the lst file to exclude failing tests.

7 years agoMerge pull request #8097 from pgavlin/VSO279396
Pat Gavlin [Fri, 18 Nov 2016 21:19:29 +0000 (13:19 -0800)]
Merge pull request #8097 from pgavlin/VSO279396

Do not fold (ind (addr (lclVar))) in certain cases.

7 years agoDelete dead files (#8202)
Jan Kotas [Fri, 18 Nov 2016 21:03:01 +0000 (13:03 -0800)]
Delete dead files (#8202)

7 years agoAdd CI job and build.cmd command for building with FEATURE_STANDALONE_GC (#8183)
Sean Gillespie [Fri, 18 Nov 2016 20:57:38 +0000 (12:57 -0800)]
Add CI job and build.cmd command for building with FEATURE_STANDALONE_GC (#8183)

* Add CI job and build.cmd command for building with FEATURE_STANDALONE_GC

* Add missed case

* Correct a condition

* Accidental fallthrough in switch

* Only run on x64

7 years agoUpdate the lst file to exclude failing tests.
jashook [Thu, 17 Nov 2016 18:18:24 +0000 (10:18 -0800)]
Update the lst file to exclude failing tests.

These are new regressions that were introduced during CI downtime.

7 years agoOrganizing the perflab tests under a common namespace. (#8184)
José Rivero [Fri, 18 Nov 2016 19:24:07 +0000 (11:24 -0800)]
Organizing the perflab tests under a common namespace. (#8184)

- These changes adds a hierarchy to the perflab tests under BenchView.

7 years agoMerge pull request #8198 from pgavlin/GH8170
Pat Gavlin [Fri, 18 Nov 2016 18:46:46 +0000 (10:46 -0800)]
Merge pull request #8198 from pgavlin/GH8170

Fix codegen for `(umod (gt_long) (const int))`.

7 years agoFix codegen for `(umod (gt_long) (const int))`.
Pat Gavlin [Fri, 18 Nov 2016 06:37:17 +0000 (22:37 -0800)]
Fix codegen for `(umod (gt_long) (const int))`.

When targeting x86, we opt not to use a helper call to implement the
64-bit unsigned modulus operator if we have a tree of either of the
following forms:
- `(umod ulong (x ulong) (cast ulong (const int const_val)))`
- `(umod ulong (x ulong) (const ulong const_val))`
where `const_val` falls in the range `[2, 0x3fffffff]`.

We eventually decompose this into `(umod uint (gt_long lo hi) (const int const_val))`.
This was then emitted as:

      mov eax, lo
      mov edx, hi
      mov reg, const_val

      div edx:eax reg

Unfortunately, this generated code does not take into account the fact
that the result of the modulus may not fit into 32 bits. This can cause
an overflow exception at runtime despite the fact that the modulus
originally produced a 64-bit result.

This change fixes the code generation to check for overflow before
performing the modulus and perform a 64-bit division if the result would
overflow. This results in generated code like the following:

      mov eax, lo
      mov edx, hi
      mov reg, const_val

      cmp edx, reg
      jb noOverflow
      mov temp, eax
      mov edx, eax
      xor edx, edx
      div edx:eax, const_val
      mov eax, temp

    noOverflow:
      div edx:eax, const_val

Which is identical to the code produced by JIT32 and the legacy backend.

7 years agoMerge pull request #8194 from AndyAyersMS/FixMismatchTests
Pat Gavlin [Fri, 18 Nov 2016 16:02:12 +0000 (08:02 -0800)]
Merge pull request #8194 from AndyAyersMS/FixMismatchTests

Revise mismatch tests so they don't rely on undefined behavior

7 years agoAdd missing Arg_BadDecimal resource string (#8197)
mikedn [Fri, 18 Nov 2016 14:19:12 +0000 (18:19 +0400)]
Add missing Arg_BadDecimal resource string (#8197)

7 years agoMerge pull request #8178 from adiaaida/excludeHeapVerify
Russ Keldorph [Fri, 18 Nov 2016 11:11:09 +0000 (03:11 -0800)]
Merge pull request #8178 from adiaaida/excludeHeapVerify

Exclude tests that timeout with HeapVerify

7 years agoMerge pull request #8187 from pgavlin/gh8150
Pat Gavlin [Fri, 18 Nov 2016 04:37:50 +0000 (20:37 -0800)]
Merge pull request #8187 from pgavlin/gh8150

Fix the transformation of `(call ARRADDR_ST x, y, null)`.

7 years agoType sigs (#8191)
Dan Moseley [Fri, 18 Nov 2016 03:39:43 +0000 (19:39 -0800)]
Type sigs (#8191)

7 years agoMerge pull request #8182 from mikedn/x86-cmp-long-linqmax
Sivarv [Fri, 18 Nov 2016 03:24:12 +0000 (19:24 -0800)]
Merge pull request #8182 from mikedn/x86-cmp-long-linqmax

Fix x86 long compares that produce a result

7 years agoFormat code.
Pat Gavlin [Fri, 18 Nov 2016 02:58:06 +0000 (18:58 -0800)]
Format code.

7 years agoRevise mismatch tests so they don't rely on undefined behavior
Andy Ayers [Fri, 18 Nov 2016 00:06:46 +0000 (16:06 -0800)]
Revise mismatch tests so they don't rely on undefined behavior

The mismatch32 and mismatch64 tests ensure that the jit will avoid
inlining in cases where there are bad type mismatches at call sites.

This change modifies the tests so that by default the call with the
bad type mismatch is not hit at runtime, since execution of this code
exposes undefined behavior that can be arch or jit specific (eg failing
on x86 and passing on other architectures).

The problematic call can still be hit at runtime by passing at least one
command line argument.

Remove the associated test exclusions for x86.

Fixes #8152.

7 years agoFix the transformation of `(call ARRADDR_ST x, y, null)`.
Pat Gavlin [Thu, 17 Nov 2016 23:49:49 +0000 (15:49 -0800)]
Fix the transformation of `(call ARRADDR_ST x, y, null)`.

`fgMorphCall` transforms `(call ARRADDR_ST x, y, null)` into
`(assign (arrindex x y) null)`. The transformation was not taking into
account the fact that the operands to the call might have been spilled
to temps, and was therefore silently dropping code in the case that they
had been.

This change collects all argument setup nodes in `gtCallArgs` in a
sequence of comma nodes if any exist and attaches the assignment
expression as the ultimate LHS of the comma tree.

Fixes #8150.

7 years agoExclude tests that timeout with HeapVerify
Michelle McDaniel [Thu, 17 Nov 2016 17:16:28 +0000 (09:16 -0800)]
Exclude tests that timeout with HeapVerify

7 years agoUse CoreFX Path code (#8132)
Jeremy Kuhne [Thu, 17 Nov 2016 21:51:43 +0000 (13:51 -0800)]
Use CoreFX Path code (#8132)

* Use CoreFX Path code

This is to address consistency and perf issues by moving the Path
code down to CoreCLR. It is more of an issue with Windows as
normalization requires complicated logic and costly platform calls.

* Delete unused files and avoid Unix crypto lib

* Address feedback, fix bug

Remove Unix crypto files and ifdef out usages completely.
Fix issue with static initialization of PathInternal.

* Use TriState to initialize case sensitivity

7 years agoFix x86 long compares that produce a result
Mike Danes [Thu, 17 Nov 2016 21:15:26 +0000 (23:15 +0200)]
Fix x86 long compares that produce a result

Remove the duplicate genProduceReg call. Also remove an unnecessary movzx.

7 years agoInliner: updates to RandomPolicy (#8128)
Andy Ayers [Thu, 17 Nov 2016 18:52:06 +0000 (10:52 -0800)]
Inliner: updates to RandomPolicy (#8128)

Fix issues with RandomPolicy setup in release builds with -DINLINE_DATA.

Reparent RandomPolicy on top of DiscretionaryPolicy to enable inline
data dumps from random inline runs. Remove some now-unneeded overrides.

Add a full dump mode to JitInlineDumpData that reports the inliner-visible
data for all inlines, as opposed to inliner-visible and post-inline
data for just the most recent inline. Small mods to the dumper code to
adjust comma placement for this new mode.

Have the RandomPolicy make the full set of profitability observations
for each accepted inline so they can be dumped.

7 years agoMerge pull request #8138 from sivarv/rmwFix
Sivarv [Thu, 17 Nov 2016 18:19:11 +0000 (10:19 -0800)]
Merge pull request #8138 from sivarv/rmwFix

Do not generate "inc/dec [mem]" when asked to generate debuggable code.

7 years agoTweak params of Console
Dan Moseley [Thu, 17 Nov 2016 17:27:09 +0000 (09:27 -0800)]
Tweak params of Console

This isn't the implementation of Console we ship, apparently it's only here for CLR tests, or maybe shouldn't be at all. Just tweaking the param names to match what we ship so it doesn't show up in the diffs.

7 years agoAddress PR feedback.
Pat Gavlin [Thu, 17 Nov 2016 16:47:27 +0000 (08:47 -0800)]
Address PR feedback.

7 years agoMerge pull request #8151 from adiaaida/enableTests
Michelle McDaniel [Thu, 17 Nov 2016 16:36:21 +0000 (08:36 -0800)]
Merge pull request #8151 from adiaaida/enableTests

Remove test exclusions for tests that now pass

7 years agoAdd RuntimeHelpers.Equals
Dan Moseley [Thu, 17 Nov 2016 04:21:12 +0000 (20:21 -0800)]
Add RuntimeHelpers.Equals

Fix dotnet/corefx#13692

We added this to the ref in 19fa781 but it was not present in the impl. The tools didn't flag this perhaps because Equals is available on Object, although since this is a new it really ought to know it wasn't referring to the Object one.

7 years agoAdd RuntimeHelpers.Equals
danmosemsft [Thu, 17 Nov 2016 01:36:03 +0000 (17:36 -0800)]
Add RuntimeHelpers.Equals

7 years agoTweak params
danmosemsft [Thu, 17 Nov 2016 01:08:56 +0000 (17:08 -0800)]
Tweak params

7 years agoAdd the missing implementation of IdnMapping.GetAscii (#8149)
Tarek Mahmoud Sayed [Thu, 17 Nov 2016 01:08:45 +0000 (17:08 -0800)]
Add the missing implementation of IdnMapping.GetAscii (#8149)

* Add the missing implementation of IdnMapping.GetAsccii

we should have this implementation in place but no idea why got removed in the first place

* Use nameof

7 years agoRemove test exclusions for tests that now pass
Michelle McDaniel [Thu, 17 Nov 2016 00:04:40 +0000 (16:04 -0800)]
Remove test exclusions for tests that now pass

This change removes tests that have been fixed for x86 RyuJIT. It also
updates the Issues for the remaining tests with additional details.

7 years agoMerge pull request #8146 from jashook/test_update_arm64
Jarret Shook [Wed, 16 Nov 2016 23:59:57 +0000 (15:59 -0800)]
Merge pull request #8146 from jashook/test_update_arm64

Update arm64 tests used by the CI

7 years agoAdd simple script generator
Sasha Semennikov [Tue, 15 Nov 2016 01:20:35 +0000 (17:20 -0800)]
Add simple script generator

Modify script generation to substitute config strings

Add Unix version of the script generation

Add config replacement

Fix windows deployment script issues

Add unix config generation

Address comments

7 years agoMerge pull request #8147 from rahku/reflection
Rahul Kumar [Wed, 16 Nov 2016 23:42:56 +0000 (15:42 -0800)]
Merge pull request #8147 from rahku/reflection

Expose MethodBase.IsSecuritySafeCritical

7 years agoDon't generate inc/dec [mem] while generating debuggable code.
sivarv [Wed, 16 Nov 2016 22:20:10 +0000 (14:20 -0800)]
Don't generate inc/dec [mem] while generating debuggable code.

7 years agoExpose MethodBase.IsSecuritySafeCritical
Rahul Kumar [Wed, 16 Nov 2016 21:38:38 +0000 (13:38 -0800)]
Expose MethodBase.IsSecuritySafeCritical

7 years agoFormat code.
Pat Gavlin [Wed, 16 Nov 2016 21:35:06 +0000 (13:35 -0800)]
Format code.

7 years agoDo not fold (ind (addr (lclVar))) in certain cases.
Pat Gavlin [Fri, 11 Nov 2016 21:41:09 +0000 (13:41 -0800)]
Do not fold (ind (addr (lclVar))) in certain cases.

Specifically, do not fold these trees into (lclFld) or (lclVar) if the
size of the access is larger than the size of the lclVar. Furthermore,
mark the lclVar as unenregisterable, as the indirection requires the
lclVar to be in memory.

7 years agoUpdate IssuesFeedbackEngagement.md
Dan Moseley [Wed, 16 Nov 2016 21:13:22 +0000 (13:13 -0800)]
Update IssuesFeedbackEngagement.md

7 years agoExpose a member of StrongNameKeyPair, fix bug in SynchronizationContext (#8142)
Koundinya Veluri [Wed, 16 Nov 2016 20:55:53 +0000 (12:55 -0800)]
Expose a member of StrongNameKeyPair, fix bug in SynchronizationContext (#8142)

Related to dotnet/corefx#11636
Related to dotnet/corefx#11808

7 years agoFixed string Join method
Dan Moseley [Wed, 16 Nov 2016 20:55:45 +0000 (12:55 -0800)]
Fixed string Join method

Fixed string Join(string separator, params object[] values) method.
Calling string.Join(",", null, 1, 2, 3); return empty string but should ",1,2,3".

7 years agoUpdate arm64 tests used by the CI.
jashook [Wed, 16 Nov 2016 19:00:30 +0000 (11:00 -0800)]
Update arm64 tests used by the CI.

7 years agoMerge pull request #8144 from adiaaida/formatArtifacts
Michelle McDaniel [Wed, 16 Nov 2016 17:48:23 +0000 (09:48 -0800)]
Merge pull request #8144 from adiaaida/formatArtifacts

Fix the path to build artifacts for formatting

7 years agoFix the path to build artifacts for formatting
Michelle McDaniel [Wed, 16 Nov 2016 17:45:49 +0000 (09:45 -0800)]
Fix the path to build artifacts for formatting

7 years agoEnable GCToOSInterface to be defined on the GC side of the GC interface (#8121)
Sean Gillespie [Wed, 16 Nov 2016 17:34:57 +0000 (09:34 -0800)]
Enable GCToOSInterface to be defined on the GC side of the GC interface (#8121)

* Re-introduce changes lost in a merge conflict

* Enable GCToOSInterface to be defined behind the GC interface
when building the GC in standalone mode. Provide a skeleton Windows
implementation and the framework for a Unix implementation.

* Address code review feedback

7 years agoFull support of idn mapping (#8134)
Tarek Mahmoud Sayed [Wed, 16 Nov 2016 01:35:36 +0000 (17:35 -0800)]
Full support of idn mapping (#8134)

* Enable full implementation of IdnMapping in corelib

* Add missing resources

7 years agoMerge pull request #8135 from pgavlin/fixExtendPtrVN
Pat Gavlin [Wed, 16 Nov 2016 01:00:10 +0000 (17:00 -0800)]
Merge pull request #8135 from pgavlin/fixExtendPtrVN

Fix value numbering for FieldSeqStore::NotAField.

7 years agoFormat code.
Pat Gavlin [Wed, 16 Nov 2016 00:19:57 +0000 (16:19 -0800)]
Format code.

7 years agoChanging JIT perf test names to fix how they are organized on BenchView (#8083)
jorive [Tue, 15 Nov 2016 23:25:52 +0000 (15:25 -0800)]
Changing JIT perf test names to fix how they are organized on BenchView (#8083)

* Changing JIT performance tests' names to fix how tests are organized on BenchView.

* Adding changes based on PR suggestions.
- Add double quotes on cmd script
- Keep name casing consistent for the Benchstone benchmarks.

* Updating datacontractxml value to match new class name.

* Removing an extra / on the xmlns string.

* Making sure we are getting latest BenchView tools.
- Changed where BenchView tools are installed to (from C:\tools to %WORKSPACE%)
- Check if the tools already exist, if so, delete them and download them again.

7 years agoMerge pull request #8110 from BruceForstall/FixLIRCallArgDumping
Bruce Forstall [Tue, 15 Nov 2016 23:25:05 +0000 (15:25 -0800)]
Merge pull request #8110 from BruceForstall/FixLIRCallArgDumping

Fix the arg name/number dumping for call args in LIR

7 years agoFix value numbering for FieldSeqStore::NotAField.
Pat Gavlin [Tue, 15 Nov 2016 22:28:30 +0000 (14:28 -0800)]
Fix value numbering for FieldSeqStore::NotAField.

Before this change, value numbering produced the same value number for
each occurrence of `FieldSeqStore::NotAField`. This semantics is not
logically consistent with the semantics of `NotAField`, however:
`NotAField` indicates that we cannot reason about the address expression
that it annotates, therefore we cannot reason about the value stored at
the corresponding location. A recent change to admit the VN for
`NotAField` in `ExtendPtrVN` exposed SBCG due to this mismatch in
semantics: distinct array elements were assigned the same value number
because each had the same base coupled with the `NotAField` VN.

This change revises the representation of `NotAField` during value
numbering: instead of reusing the same value number for each
occurrence of `NotAField`, each occurrence is instead assigned a new,
unique value number. These value numbers are represented using a new
chunk attribute to retain the ability to decide whether or not a value
number represents `NotAField` without the use of a more heavyweight map
(e.g. a `VNMap`).

Fixes #8133.

7 years agoMerge pull request #8125 from stephentoub/divrem_perf
Stephen Toub [Tue, 15 Nov 2016 22:22:53 +0000 (17:22 -0500)]
Merge pull request #8125 from stephentoub/divrem_perf

Improve Math.DivRem performance

7 years agoExpose members of ExecutionContext and AsyncFlowControl (#8107)
Koundinya Veluri [Tue, 15 Nov 2016 21:08:41 +0000 (13:08 -0800)]
Expose members of ExecutionContext and AsyncFlowControl (#8107)

Expose members of ExecutionContext and AsyncFlowControl

- Fix ExecutionContext.Capture and AsyncFlowControl.Undo when flow is suppressed
- Expose deserialization constructor for ExecutionContext

7 years agoMerge pull request #8131 from JohnChen0/xmm
John Chen [Tue, 15 Nov 2016 20:44:10 +0000 (12:44 -0800)]
Merge pull request #8131 from JohnChen0/xmm

Fix XMM register count in CONTEXT_SetThreadContextOnPort in PAL

7 years agoMerge pull request #8124 from martijnhoekstra/doc-aggex
Dan Moseley [Tue, 15 Nov 2016 20:00:13 +0000 (12:00 -0800)]
Merge pull request #8124 from martijnhoekstra/doc-aggex

fix grammar for AggregateException.Flatten

7 years agoFix XMM register count in CONTEXT_SetThreadContextOnPort in PAL
John Chen (CLR) [Tue, 15 Nov 2016 19:09:20 +0000 (11:09 -0800)]
Fix XMM register count in CONTEXT_SetThreadContextOnPort in PAL

7 years agoMerge pull request #8127 from jashook/arm64_post_build_script
Jarret Shook [Tue, 15 Nov 2016 18:10:11 +0000 (10:10 -0800)]
Merge pull request #8127 from jashook/arm64_post_build_script

Change over from the old arm64 scripting.

7 years agoChange over from the old ar64 scripting.
jashook [Tue, 15 Nov 2016 01:48:56 +0000 (17:48 -0800)]
Change over from the old ar64 scripting.

This change moves away from hosting all of scripts on the Z:\ drive.
The share that used to be shared between the x64 machines and the
arm64 devices. It removes all the old scripting for one python script
arm64_post_build.py, which is responsible for setup of dotnet and
launching
the x64_client.

7 years agoMerge pull request #8120 from adiaaida/fixDebuggerVarargs
Michelle McDaniel [Tue, 15 Nov 2016 15:59:56 +0000 (07:59 -0800)]
Merge pull request #8120 from adiaaida/fixDebuggerVarargs

Add special handling of varargs for x86 debugger

7 years agoFix crash in FunctionMemberPtrArrayHolder destructor (#8113)
Igor Kulaychuk [Tue, 15 Nov 2016 14:55:53 +0000 (17:55 +0300)]
Fix crash in FunctionMemberPtrArrayHolder destructor (#8113)

Some elements in FunctionMember array might not be initialized
and contain garbage. This leads to crash when elements are being deleted.

Move array allocation inside FunctionMemberPtrArrayHolder class
and initialize all array elements to nullptr.

7 years agoclean build-roofs and add lldb option (#8123)
SaeHie Park [Tue, 15 Nov 2016 14:49:02 +0000 (23:49 +0900)]
clean build-roofs and add lldb option (#8123)

- clean unused __MachineTriple
- add indents to case
- add lld 3.6 or 3.8 as option

7 years agoUse Math.DivRem in another place in mscorlib
Stephen Toub [Tue, 15 Nov 2016 14:36:38 +0000 (09:36 -0500)]
Use Math.DivRem in another place in mscorlib

Went through all uses of % looking for places DivRem could be used.  This looks like it's the only one of note.

7 years agoImprove Math.DivRem performance
Stephen Toub [Tue, 15 Nov 2016 12:28:20 +0000 (07:28 -0500)]
Improve Math.DivRem performance

Until the JIT is able to eliminate one of the two idiv operations, using a multiplication and subtraction is measurably faster than an extra division.

7 years agofix grammar for AggregateException.Flatten
Martijn Hoekstra [Tue, 15 Nov 2016 12:24:05 +0000 (13:24 +0100)]
fix grammar for AggregateException.Flatten

The old phrasing wasn't gramatically correct. It's somewhat
difficult to find a concise summary

7 years agoFix GT_MULHI register requirements
Mike Danes [Sun, 13 Nov 2016 09:56:46 +0000 (11:56 +0200)]
Fix GT_MULHI register requirements

We only care about the upper 32 bits of the 64 bit result and those are
in EDX. It doesn't make sense to set the destination candidate to EAX,
most of the time this will result in a useless `mov eax, edx` being
generated.

Also, genCodeForMulHi needs to check if the implicit operand is in EAX
rather than targetReg.

7 years agoMorph GT_MOD to GT_DIV in some cases
Mike Danes [Sun, 13 Nov 2016 14:49:31 +0000 (16:49 +0200)]
Morph GT_MOD to GT_DIV in some cases

Doing magic division in morph did have one positive effect. For code like
`x = a / 10; y = a % 10;` some (not all due to an assignment) of the common
code was CSEd.

To preserve this optimization we transform `a % b` to `a - (a / b) * b` if we
know that lowering will do magic division. If a redundant `a / b` exists
then CSE can pick it up.

7 years agoRemove magic division optimization from morph
Mike Danes [Sun, 13 Nov 2016 10:24:17 +0000 (12:24 +0200)]
Remove magic division optimization from morph

This is no longer needed, lowering does this now.

7 years agoDo magic division optimization in lowering
Mike Danes [Sun, 13 Nov 2016 09:16:41 +0000 (11:16 +0200)]
Do magic division optimization in lowering

Currently this optimization is done during global morph. Global morph
takes place very early so cases that rely on constant propagation and
folding (e.g "int d = 3; return n / d;") aren't handled.

Also, the IR generated during morph is complex and unlikely to enable
further optimizations. Quite the contrary, the presence of GT_ASG and
GT_MULHI nodes blocks other optimizations (CSE, LICM currently).

The generated code is identical to the code generated by the morph
implementation with one exception: when 2 shifts are needed
(e.g. for x / 7) they are now computed independently:

mov eax, edx
sar eax, 2
shr edx, 31
add eax, edx

instead of:
mov eax, edx
sar eax, 2
mov edx, eax
shr edx, 31
add eax, edx

This results in shorter code and avoids creating an additional temp.

7 years agoCopy GetSignedMagicNumberForDivide to lower.cpp
Mike Danes [Sun, 13 Nov 2016 08:48:15 +0000 (10:48 +0200)]
Copy GetSignedMagicNumberForDivide to lower.cpp

No actual code changes.

7 years agoAdding initial scripts
Sasha Semennikov [Mon, 14 Nov 2016 23:51:27 +0000 (15:51 -0800)]
Adding initial scripts

7 years agoReduce variable scope (#8021)
Dan Moseley [Mon, 14 Nov 2016 23:47:55 +0000 (15:47 -0800)]
Reduce variable scope (#8021)

7 years agoMerge pull request #8073 from dotnet/enablebinclash
chcosta [Mon, 14 Nov 2016 23:17:54 +0000 (15:17 -0800)]
Merge pull request #8073 from dotnet/enablebinclash

Enable binclash logger

7 years agoMerge pull request #8086 from pgavlin/VSO278523
Pat Gavlin [Mon, 14 Nov 2016 23:15:34 +0000 (15:15 -0800)]
Merge pull request #8086 from pgavlin/VSO278523

Admit more dest addresses in block assign value-numbering.

7 years agoAdmit more dest addresses in block assign value-numbering.
Pat Gavlin [Fri, 11 Nov 2016 18:20:59 +0000 (10:20 -0800)]
Admit more dest addresses in block assign value-numbering.

Internal testing revealed an assertion when computing the value number
for block assignments: the VN framework expected any block assignments
to a tracked lclVar to have a destination address of the form
`(addr (lclVar))` or `(addr (lclFld))`. However, the check that it
uses to determine whether or not a block assignment targets a lclVar
also admits addresses formed by some combination of adds of constants
to these patterns (e.g. `(add (const 4) (add (addr lclVar) (const 4)))`.

This fix admits these additional patterns in value numbering by allowing
`ExtendPtrVN(GenTree*, GenTree*)` to supply `NotAField` to
`ExtendPtrVN(GenTree*, FieldSeqNode*)`.

7 years agoAdd special handling of varargs for x86 debugger
Michelle McDaniel [Mon, 14 Nov 2016 21:44:06 +0000 (13:44 -0800)]
Add special handling of varargs for x86 debugger

On x86, stack arguments must be accessed via the varargs cookie for
varargs. Since the functions would be identical, this change moves the
code from codegenlinear to codegencommon to fix vararg argument
handling in the debugger.

Fixes VSO 284774.

7 years agoFix the arg name/number dumping for call args in LIR
Bruce Forstall [Mon, 14 Nov 2016 03:17:36 +0000 (19:17 -0800)]
Fix the arg name/number dumping for call args in LIR

Use the arg number in the arg info table. Before this, I saw cases
where the args were named: arg0, arg1, arg1, arg3, instead of:
arg0, arg2, arg1, arg3, for example.

7 years agoMerge pull request #8111 from BruceForstall/FixTestNewlines
Bruce Forstall [Mon, 14 Nov 2016 21:44:06 +0000 (13:44 -0800)]
Merge pull request #8111 from BruceForstall/FixTestNewlines

Don't generate explicit newlines in SIMD tests

7 years agoMerge pull request #8115 from chcosta/updatebuildtools
chcosta [Mon, 14 Nov 2016 21:40:51 +0000 (13:40 -0800)]
Merge pull request #8115 from chcosta/updatebuildtools

Update buildtools to version 01008-01

7 years agoMerge pull request #8031 from pgavlin/VSO283795
Pat Gavlin [Mon, 14 Nov 2016 21:10:52 +0000 (13:10 -0800)]
Merge pull request #8031 from pgavlin/VSO283795

Do not fold `(x + null)` in certain cases.

7 years agoMerge pull request #8101 from sivarv/rmwOpt
Sivarv [Mon, 14 Nov 2016 19:07:36 +0000 (11:07 -0800)]
Merge pull request #8101 from sivarv/rmwOpt

Generate "inc/dec [mem]" instead of "add/sub [mem], 1" for Read-Modify-Write (RMW) operations.

7 years agoFix test exclusions.
Pat Gavlin [Mon, 14 Nov 2016 19:02:12 +0000 (11:02 -0800)]
Fix test exclusions.

The new regression test should only be disabled for builds that use the
legacy backend.

7 years agoMerge pull request #8100 from rahku/reflection
Rahul Kumar [Mon, 14 Nov 2016 18:17:28 +0000 (10:17 -0800)]
Merge pull request #8100 from rahku/reflection

Expose Assembly::GetFile(s) apis

7 years agoUpdate buildtools to version 01008-01
Christopher Costa [Mon, 14 Nov 2016 16:40:16 +0000 (08:40 -0800)]
Update buildtools to version 01008-01

7 years agoFixed string Join method
Alexander Radchenko [Mon, 14 Nov 2016 15:58:58 +0000 (22:58 +0700)]
Fixed string Join method

Fixed string Join(string separator, params object[] values) method.
Calling string.Join(",", null, 1, 2, 3); return empty string but should ",1,2,3".

7 years agoMerge pull request #8108 from gkhanna79/Arm32Test
Gaurav Khanna [Mon, 14 Nov 2016 05:21:07 +0000 (21:21 -0800)]
Merge pull request #8108 from gkhanna79/Arm32Test

Enable WinArm32 P1 Test Build

7 years agoDon't generate explicit newlines in SIMD tests
Bruce Forstall [Mon, 14 Nov 2016 03:20:55 +0000 (19:20 -0800)]
Don't generate explicit newlines in SIMD tests

Use Console.WriteLine() instead.

7 years agoEnable WinArm32 P1 Test Build
Gaurav Khanna [Sun, 13 Nov 2016 23:47:11 +0000 (15:47 -0800)]
Enable WinArm32 P1 Test Build