Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Enable checking of GTF_EXCEPT and GTF_ASG flags.#13668

Merged
erozenfeld merged 5 commits into
dotnet:masterfrom
erozenfeld:SideEffectFlags
Sep 1, 2017
Merged

Enable checking of GTF_EXCEPT and GTF_ASG flags.#13668
erozenfeld merged 5 commits into
dotnet:masterfrom
erozenfeld:SideEffectFlags

Conversation

@erozenfeld
Copy link
Copy Markdown
Member

fgDebugCheckFlags is modified to check that GTF_EXCEPT and GTF_ASG are set precisely when needed.
It's also modified to handle several special operators correctly.

fgAddrCouldBeNull is updated to check for handles, implicit byref locals, and stack byrefs.

OperMayThrow is modified to handle several operators correctly.

GTF_IND_NONFAULTING is reused on operations for which OperIsIndir() is true and on GT_ARR_LENGTH.

Various places in morph are updated to set side effect flags correctly.

gtUpdateSideEffects is re-written so that it's precise for GTF_ASG and GTF_EXCEPT
and conservatively correct for the other side effects. It's now called from more places
to keep the flags up-to-date after transformations.

NoThrow in HelperCallProperties is updated and GTF_EXCEPT flag is set on helper calls according to
that property.

optRemoveRangeCheck is cleaned up and simplified.

fgDebugCheckFlags is modified to check that GTF_EXCEPT and GTF_ASG are set precisely when needed.
It's also modified to handle several special operators correctly.

fgAddrCouldBeNull is updated to check for handles, implicit byref locals, and stack byrefs.

OperMayThrow is modified to handle several operators correctly.

GTF_IND_NONFAULTING is reused on operations for which OperIsIndir() is true and on GT_ARR_LENGTH.

Various places in morph are updated to set side effect flags correctly.

gtUpdateSideEffects is re-written so that it's precise for GTF_ASG and GTF_EXCEPT
and conservatively correct for the other side effects. It's now called from more places
to keep the flags up-to-date after transformations.

NoThrow in HelperCallProperties is updated and GTF_EXCEPT flag is set on helper calls according to
that property.

optRemoveRangeCheck is cleaned up and simplified.
@erozenfeld
Copy link
Copy Markdown
Member Author

erozenfeld commented Aug 29, 2017

SPC codesize numbers:

Summary:
(Note: Lower is better)
Total bytes of diff: -360 (-0.01 % of base)
    diff is an improvement.
Total byte diff includes 0 bytes from reconciling methods
        Base had    0 unique methods,        0 unique bytes
        Diff had    0 unique methods,        0 unique bytes
Top file improvements by size (bytes):
        -360 : System.Private.CoreLib.dasm (-0.01 % of base)
1 total files with size differences (1 improved, 0 regressed), 0 unchanged.
Top method regessions by size (bytes):
          64 : System.Private.CoreLib.dasm - CustomAttributeBuilder:InitCustomAttributeBuilder(ref,ref,ref,ref,ref,ref):this
          35 : System.Private.CoreLib.dasm - ILGenerator:Emit(struct,ref):this (8 methods)
          21 : System.Private.CoreLib.dasm - DynamicILGenerator:Emit(struct,ref):this (6 methods)
          19 : System.Private.CoreLib.dasm - TypeLoadException:SetMessageField():this
          18 : System.Private.CoreLib.dasm - TypeAnalysis:.ctor(ref,ref,ref):this
Top method improvements by size (bytes):
        -133 : System.Private.CoreLib.dasm - GenericEqualityComparer`1:LastIndexOf(ref,struct,int,int):int:this (19 methods)
        -133 : System.Private.CoreLib.dasm - GenericEqualityComparer`1:IndexOf(ref,struct,int,int):int:this (19 methods)
         -78 : System.Private.CoreLib.dasm - GenericArraySortHelper`1:DownHeap(ref,int,int,int) (18 methods)
         -72 : System.Private.CoreLib.dasm - ObjectEqualityComparer`1:LastIndexOf(ref,struct,int,int):int:this (11 methods)
         -72 : System.Private.CoreLib.dasm - ObjectEqualityComparer`1:IndexOf(ref,struct,int,int):int:this (11 methods)
59 total methods with size differences (28 improved, 31 regressed), 16218 unchanged.

@erozenfeld
Copy link
Copy Markdown
Member Author

Benchmarks codesize numbers:

Total bytes of diff: 10 (0.01 % of base)
    diff is a regression.
Total byte diff includes 0 bytes from reconciling methods
        Base had    0 unique methods,        0 unique bytes
        Diff had    0 unique methods,        0 unique bytes
Top file regressions by size (bytes):
          20 : BenchmarksGame\fasta\fasta\fasta.dasm (0.62 % of base)
          16 : BenchmarksGame\fastaredux\fastaredux\fastaredux.dasm (0.50 % of base)
Top file improvements by size (bytes):
         -20 : BenchmarksGame\k-nucleotide\k-nucleotide\k-nucleotide.dasm (-0.42 % of base)
          -3 : BenchI\NDhrystone\NDhrystone\NDhrystone.dasm (-0.14 % of base)
          -3 : BenchmarksGame\spectralnorm\spectralnorm\spectralnorm.dasm (-0.14 % of base)
5 total files with size differences (3 improved, 2 regressed), 51 unchanged.
Top method regessions by size (bytes):
          27 : BenchmarksGame\fasta\fasta\fasta.dasm - Fasta:Bench()
          16 : BenchmarksGame\fastaredux\fastaredux\fastaredux.dasm - FastaRedux:Bench()
           2 : BenchmarksGame\k-nucleotide\k-nucleotide\k-nucleotide.dasm - knucleotide:Main(ref):int
Top method improvements by size (bytes):
         -22 : BenchmarksGame\k-nucleotide\k-nucleotide\k-nucleotide.dasm - knucleotide:CountFrequency(ref,int):ref
          -4 : BenchmarksGame\fasta\fasta\fasta.dasm - Fasta:MakeRepeatFasta(ref,ref,ref,int,ref)
          -3 : BenchI\NDhrystone\NDhrystone\NDhrystone.dasm - NDhrystone:Proc0()
          -3 : BenchmarksGame\fasta\fasta\fasta.dasm - Fasta:MakeRandomFasta(ref,ref,ref,int,ref)
          -3 : BenchmarksGame\spectralnorm\spectralnorm\spectralnorm.dasm - SpectralNorm:Approximate(int):double:this
8 total methods with size differences (5 improved, 3 regressed), 419 unchanged.

@erozenfeld
Copy link
Copy Markdown
Member Author

Frameworks codesize numbers:

Summary:
(Note: Lower is better)
Total bytes of diff: 1199 (0.01 % of base)
    diff is a regression.
Total byte diff includes 0 bytes from reconciling methods
        Base had    0 unique methods,        0 unique bytes
        Diff had    0 unique methods,        0 unique bytes
Top file regressions by size (bytes):
         532 : Microsoft.CodeAnalysis.dasm (0.07 % of base)
         528 : System.Linq.Parallel.dasm (0.09 % of base)
         230 : Microsoft.CodeAnalysis.VisualBasic.dasm (0.01 % of base)
         228 : Microsoft.CodeAnalysis.CSharp.dasm (0.01 % of base)
          91 : System.Collections.Immutable.dasm (0.06 % of base)
Top file improvements by size (bytes):
        -360 : System.Private.CoreLib.dasm (-0.01 % of base)
         -30 : System.Runtime.Extensions.dasm (-0.02 % of base)
         -29 : System.Linq.Expressions.dasm (-0.01 % of base)
         -20 : System.Net.Security.dasm (-0.01 % of base)
         -17 : System.ComponentModel.Annotations.dasm (-0.05 % of base)
27 total files with size differences (13 improved, 14 regressed), 52 unchanged.
Top method regessions by size (bytes):
         520 : System.Linq.Parallel.dasm - QueryOpeningEnumerator`1:OpenQuery():this (26 methods)
          64 : System.Private.CoreLib.dasm - CustomAttributeBuilder:InitCustomAttributeBuilder(ref,ref,ref,ref,ref,ref):this
          58 : Microsoft.CodeAnalysis.dasm - ReferenceIndexerBase:Visit(ref):this (17 methods)
          50 : System.Collections.Immutable.dasm - Enumerator:.ctor(ref):this (5 methods)
          49 : Microsoft.CodeAnalysis.VisualBasic.dasm - Binder:AdjustReceiverTypeOrValue(ref,ref,bool,bool,ref,byref,byref):ref:this
Top method improvements by size (bytes):
        -133 : System.Private.CoreLib.dasm - GenericEqualityComparer`1:LastIndexOf(ref,struct,int,int):int:this (19 methods)
        -133 : System.Private.CoreLib.dasm - GenericEqualityComparer`1:IndexOf(ref,struct,int,int):int:this (19 methods)
         -78 : System.Private.CoreLib.dasm - GenericArraySortHelper`1:DownHeap(ref,int,int,int) (18 methods)
         -75 : Microsoft.CodeAnalysis.VisualBasic.dasm - SourceModuleSymbol:BindImports(struct):ref:this
         -72 : System.Private.CoreLib.dasm - ObjectEqualityComparer`1:LastIndexOf(ref,struct,int,int):int:this (11 methods)
278 total methods with size differences (94 improved, 184 regressed), 66022 unchanged.

@erozenfeld
Copy link
Copy Markdown
Member Author

I measured instructions retired TP impact when crossgen-ing SPC:
minopts: 0.09% regression
fullopts: 0.13% regression

@erozenfeld
Copy link
Copy Markdown
Member Author

@pgavlin @JosephTremoulet @briansull @CarolEidt @dotnet/jit-contrib PTAL

@erozenfeld
Copy link
Copy Markdown
Member Author

The three main sources of regressions:

  1. There are places where we now set GTF_EXCEPT flag where previously we didn't. In particular, dereferencing struct fields requires this flag unless we can prove the byref is non-null.
  2. Simplified call args can affect arg sorting.
  3. Removing GTF_ASG may affect setting of GTF_REVERSE_OP on an ancestor assignment node.

@erozenfeld
Copy link
Copy Markdown
Member Author

@dotnet-bot test Ubuntu16.04 arm Cross Debug Build

Copy link
Copy Markdown

@CarolEidt CarolEidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I have a few suggestions.

Comment thread src/jit/compiler.hpp

inline GenTreeCall* Compiler::gtNewHelperCallNode(unsigned helper, var_types type, unsigned flags, GenTreeArgList* args)
//------------------------------------------------------------------------------
// gtNewHelperCallNode : Helper to create a call helper node.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I would simply say "Create a node that calls a helper method.". The repetition of "helper" is somewhat confusing, and although a number of these gtNew methods are described as helpers, I'm not sure I'd really call them that.

Comment thread src/jit/compiler.hpp
unsigned mask = GTF_COMMON_MASK;
if (this->OperIsIndirOrArrLength() && OperIsIndir(oper))
{
mask |= GTF_IND_NONFAULTING;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: at first glance this is confusing because it almost looks like you're unconditionally setting this flag (though if one reads a bit further it's clear). It wouldn't hurt to add a comment such as "If this is an indirection, we want to inherit the value of the GTF_IND_NONFAULTING flag in addition to anything set in GTF_COMMON_MASK or something to that effect.

Comment thread src/jit/compiler.hpp
@@ -1529,8 +1601,13 @@ inline void GenTree::ChangeOper(genTreeOps oper, ValueNumberUpdate vnUpdate)

inline void GenTree::ChangeOperUnchecked(genTreeOps oper)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense for ChangeOper to call this, so that the logic (such as it is) doesn't have to be duplicated?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChangeOper calls SetOper while ChangeOperUnchecked calls SetOperRaw so ChangeOper can's call ChangeOperUnchecked.

Comment thread src/jit/copyprop.cpp Outdated
{
VarSetOps::OldStyleClearD(this, optCopyPropKillSet);

bool updateFlags = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be unused

Comment thread src/jit/flowgraph.cpp

return gtNewHelperCallNode(helper, type, callFlags, argList);
GenTreeCall* result = gtNewHelperCallNode(helper, type, argList);
result->gtFlags |= callFlags;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this, and the setting of callFlags above are now redundant, as this is done in gtNewHelperCallNode(), right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not redundant since in this method callFlags can also have GTF_CALL_HOISTABLE. The setting of GTF_EXCEPT above is redundant and I will remove it.

Comment thread src/jit/flowgraph.cpp Outdated
// addr - Address to check
//
// Return Value:
// True is address could be null; false otherwise
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps should be "True if address ..."?

Comment thread src/jit/gentree.cpp Outdated
// gtUpdateSideEffects: Update the side effects for statement tree nodes.
//
// Arguments:
// stmt - The statement to update side effects on
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need a description of the tree argument. Also, since tree is unused in the then clause below, and stmt is unused in the else clause, would it make sense to have two different versions of this method, especially since their behavior is quite different - in one case an entire statement is updated, and in another case, only the direct children of tree, and its ancestors.

Comment thread src/jit/morph.cpp
// any struct arguments.
// i.e. assert(((call->gtFlags & GTF_EXCEPT) != 0) || ((args->Current()->gtFlags & GTF_EXCEPT) == 0)
flagsSummary |= (args->Current()->gtFlags & GTF_EXCEPT);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see this go!

Comment thread src/jit/morph.cpp Outdated
else
{
src->gtFlags |= GTF_IND_NONFAULTING;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, but the above pattern appears a lot - it might be nice to extract it into a method.

Comment thread src/jit/compiler.h Outdated

GenTreePtr gtNewIndexRef(var_types typ, GenTreePtr arrayOp, GenTreePtr indexOp);

GenTreeArrLen* gtNewArrLen(var_types typ, GenTreePtr arrayOp, int lenOffset);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we stick to using GenTree* in new code?

Comment thread src/jit/compiler.hpp Outdated

inline GenTreeCall* Compiler::gtNewHelperCallNode(unsigned helper, var_types type, GenTreeArgList* args)
{
unsigned flags = this->s_helperCallProperties.NoThrow((CorInfoHelpFunc)helper) ? 0 : GTF_EXCEPT;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this-> for? Looks strange considering that you're accessing a static member.

Comment thread src/jit/copyprop.cpp Outdated
// curSsaName - The map from lclNum to its recently live definitions as a stack
//
// Return Value:
// true if copy propagation was performed for the tree; false otherwise.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the function doesn't return anything.

Comment thread src/jit/copyprop.cpp Outdated
}
#endif
break;
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks odd, considering that the function ends right after the loop and there's even a useless return after the loop.

Comment thread src/jit/gentree.cpp Outdated

case GT_CALL:

GenTreeCall* call;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable seems unnecessary, it's used only once.

Comment thread src/jit/gentree.cpp Outdated
}
}

genTreeOps oper = tree->OperGet();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable?

Comment thread src/jit/morph.cpp

if (tree->OperMayThrow(this))
{
tree->gtFlags |= GTF_EXCEPT;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add some flags setters to GenTree, this stuff keeps repeating.

tree->SetFlag(GTF_EXCEPT, tree->OperMayThrow(this)) for example.

Comment thread src/jit/morph.cpp Outdated
if (argx->gtOper == GT_OBJ)
{
argx->gtFlags &= ~(GTF_ALL_EFFECT) | (argx->AsBlk()->Addr()->gtFlags & GTF_ALL_EFFECT);
if (argx->OperMayThrow(this))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not usually a fan of ?: but sometimes it seems useful: argx->gtFlags |= argx->OperMayThrow(this) ? GTF_EXCEPT : GTF_IND_NONFAULTING;

Comment thread src/jit/morph.cpp Outdated
dest->gtFlags |= (GTF_EXCEPT | GTF_GLOB_REF | GTF_IND_TGTANYWHERE);
tree->gtFlags |= (GTF_EXCEPT | GTF_GLOB_REF | GTF_IND_TGTANYWHERE);
dest->gtFlags |= (GTF_GLOB_REF | GTF_IND_TGTANYWHERE);
tree->gtFlags |= (GTF_GLOB_REF | GTF_IND_TGTANYWHERE);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct to set GTF_IND_TGTANYWHERE on tree? Seems like it is a GT_ASG, not a GT_IND.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pre-existing but I don't think it's correct. I'll try to remove it.

Comment thread src/jit/utils.cpp Outdated
case CORINFO_HELP_MON_ENTER:
case CORINFO_HELP_MON_EXIT:
case CORINFO_HELP_MON_ENTER_STATIC:
case CORINFO_HELP_MON_EXIT_STATIC:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the monitor helpers really "no throw"? Seems like "exit" could throw SynchronizationLockException.

Comment thread src/jit/compiler.hpp
// New GT_IND node

inline GenTreePtr Compiler::gtNewIndir(var_types typ, GenTreePtr addr)
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GenTreePtr => GenTree*

@erozenfeld
Copy link
Copy Markdown
Member Author

@CarolEidt @mikedn @briansull Thank you for the review. I pushed a commit that addresses your comments. PTAL.

@erozenfeld
Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT x64 Release Priority 1 Build and Test
@dotnet-bot test Windows_NT arm Cross Checked Build and Test

@erozenfeld
Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT jitstress1
@dotnet-bot test Windows_NT jitstress2_jitstressregs8

@erozenfeld
Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT arm Cross Checked Build and Test

Copy link
Copy Markdown

@JosephTremoulet JosephTremoulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up! Looks good w/ a few comments.

Comment thread src/jit/compiler.hpp Outdated
assert(!OperIsConst(oper)); // use ChangeOperLeaf() instead

unsigned mask = GTF_COMMON_MASK;
if (this->OperIsIndirOrArrLength() && OperIsIndir(oper))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this assymetric? I presume we never ChangeOper from vanilla indir to array length, but if we did, wouldn't we want to propagate the flag?

Comment thread src/jit/compiler.hpp Outdated
inline void GenTree::ChangeOperUnchecked(genTreeOps oper)
{
unsigned mask = GTF_COMMON_MASK;
if (this->OperIsIndirOrArrLength() && OperIsIndir(oper))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Comment thread src/jit/gentree.h Outdated
// contribution to its argument).
#define GTF_IND_VOLATILE 0x40000000 // GT_IND -- the load or store must use volatile sematics (this is a nop on X86)
#define GTF_IND_NONFAULTING 0x20000000 // GT_IND -- An indir that cannot fault.
#define GTF_IND_NONFAULTING 0x20000000 // Operations for which OperIsIndirOrArrLength() is true -- An indir that cannot fault.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend defining GTF_ARRLEN_NONFAULTING where the other GTF_ARRLEN flags are defined and adding a static_assert_no_msg that the two flags agree -- that'll make it easier not to mistakenly try to re-use that bit if somebody goes to add another flag for array length nodes in the future. We currently do the same for GTF_FLD_VOLATILE and GTF_CLS_VAR_VOLATILE (and the static assertion is over by their use in morph that requires them to be the same).

@erozenfeld
Copy link
Copy Markdown
Member Author

@JosephTremoulet Good points, thanks. I pushed a commit that addresses your comments.

Comment thread src/jit/gentree.h Outdated

#define GTF_ARR_BOUND_INBND 0x80000000 // GT_ARR_BOUNDS_CHECK -- have proved this check is always in-bounds

#define GTF_ARRLEN_NONFAULTING 0x20000000 // GT_ARR_LENGTH -- An array length operation that cannot fault. Same as GT_IND_NONFAULTING.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind moving this down a line to be below GTF_ARRLEN_ARR_IDX? The flags in this file are typically listed in descending numerical order within each group.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks.

Copy link
Copy Markdown

@pgavlin pgavlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally looks good, just a couple questions.

It does look like this primarily targets the frontend: do you plan on adding side-effect checks to LIR::Range::CheckLIR() as a follow-up change?

Comment thread src/jit/flowgraph.cpp
break;

case GT_MEMORYBARRIER:
chkFlags |= GTF_GLOB_REF | GTF_ASG;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit surprised that GT_MEMORYBARRIER does not imply GT_ORDER_SIDEEFF...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised by that too but the meaning of GTF_ORDER_SIDEEFF and GTF_GLOB_REF is not very well defined at the moment so I deferred the work to fix and check them and just kept the existing behavior.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GTF_ORDER_SIDEEFF is well defined: it is a full compiler barrier. I suppose that when you say that its meaning is not well defined you're referring to the fact that we don't always check it?

Copy link
Copy Markdown
Member Author

@erozenfeld erozenfeld Aug 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's currently always used that way. In any case, checking GTF_ORDER_SIDEFF is a future work item and I'll investigate why it's not set on GT_MEMORYBARRIER at that time.

Comment thread src/jit/gentree.cpp Outdated

CorInfoHelpFunc helper;
helper = comp->eeGetHelperNum(this->AsCall()->gtCallMethHnd);
if ((helper == CORINFO_HELP_UNDEF) || !comp->s_helperCallProperties.NoThrow(helper))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just

return (helper == CORINFO_HELP_UNDEF) || !comp->s_helperCallProperties.NoThrow(helper);

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason. I pushed a commit with an update.

@erozenfeld
Copy link
Copy Markdown
Member Author

I'll include adding side-effect checks to LIR::Range::CheckLIR() to my list of follow-up changes.

@pgavlin
Copy link
Copy Markdown

pgavlin commented Aug 31, 2017

I'll include adding side-effect checks to LIR::Range::CheckLIR() to my list of follow-up changes.

Cool. There is a fundamental difference between side-effects in HIR and LIR in that the flags on a node do not need to be a summary of that node's side effects along with those of its operands: instead, the flags for a node should reflect only that node's side effects.

@erozenfeld
Copy link
Copy Markdown
Member Author

GC.API.NoGCRegion.NoGC.NoGC failed in Ubuntu x64 Checked Build and Test . I see this failure in other PRs, e.g., #13728, #13576. @Maoni0 Is this a known issue?

@erozenfeld
Copy link
Copy Markdown
Member Author

Rerunning the job. Link to the failure: https://ci.dot.net/job/dotnet_coreclr/job/master/job/checked_ubuntu_tst_prtest/9021/

@erozenfeld
Copy link
Copy Markdown
Member Author

@dotnet-bot test Ubuntu x64 Checked Build and Test

@Maoni0
Copy link
Copy Markdown
Member

Maoni0 commented Aug 31, 2017

no, I was not aware this test was failing. Is this run with other tests? 'cause it's not supposed to. I am not sure if some test config has changed... @swgillespie do you know anything about this?

@swgillespie
Copy link
Copy Markdown

swgillespie commented Aug 31, 2017 via email

@erozenfeld
Copy link
Copy Markdown
Member Author

@dotnet-bot test Ubuntu x64 Checked Build and Test

1 similar comment
@erozenfeld
Copy link
Copy Markdown
Member Author

@dotnet-bot test Ubuntu x64 Checked Build and Test

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Sep 1, 2017

@maonis @swgillespie I have opened #13736 on the GC.API.NoGCRegion.NoGC.NoGC test failure

@swgillespie
Copy link
Copy Markdown

@jkotas thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants