Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
1e54aa0
Intrinsify Unsafe.Read/Write, handle struct BitCast
MichalPetryka Apr 29, 2023
5e78c9c
Fix broken rebase
MichalPetryka Apr 29, 2023
93399c2
Handle small type extension
MichalPetryka Apr 29, 2023
8987b69
Fix formatting
MichalPetryka Apr 29, 2023
858f39c
Fix swapped operands
MichalPetryka Apr 30, 2023
a193350
Use right helper
MichalPetryka Apr 30, 2023
db54e97
Don't loose indir flags
MichalPetryka Apr 30, 2023
9c2ee9e
Fix build
MichalPetryka Apr 30, 2023
3e5003f
Fix missed deref
MichalPetryka Apr 30, 2023
b3e7e97
Also mask indir flags
MichalPetryka Apr 30, 2023
66f111b
Rename variables, fix structs
MichalPetryka Apr 30, 2023
a5bb60b
Fix build
MichalPetryka Apr 30, 2023
0922ea6
Merge upstream
MichalPetryka May 3, 2023
36ab91d
Update importer.cpp
MichalPetryka May 3, 2023
84a3edc
Resolve conflicts
MichalPetryka May 6, 2023
b911984
Fix 32bit bug, simplify code
MichalPetryka May 6, 2023
2982fd4
Fix merge
MichalPetryka May 6, 2023
feb0acc
Simplify code
MichalPetryka May 6, 2023
08e9ece
Update importercalls.cpp
MichalPetryka May 6, 2023
9204f80
Update importer.cpp
MichalPetryka May 6, 2023
36eecf9
Remove redundant nullchecks
MichalPetryka May 6, 2023
3ed32ad
Format code
MichalPetryka May 6, 2023
6cbaa45
Mark the local as having new uses
MichalPetryka May 8, 2023
6c758ee
Update targetosarch.h
MichalPetryka May 8, 2023
13ece70
Reword comments
MichalPetryka May 8, 2023
d68aed9
Update targetosarch.h
MichalPetryka May 8, 2023
873a914
Handle small types
MichalPetryka May 9, 2023
c9b274c
Reformat code
MichalPetryka May 9, 2023
290bf27
Commit missed changes
MichalPetryka May 9, 2023
3d77bb0
Fix check
MichalPetryka May 9, 2023
15aa641
Merge branch 'main' into bitcast-indir
MichalPetryka May 9, 2023
4ab78a0
Format code
MichalPetryka May 9, 2023
e1911ee
Add tests for small types and misalignment
MichalPetryka May 10, 2023
38f10fc
Fix a typo, add more tests
MichalPetryka May 10, 2023
b69aaa7
Adjust small type handling
MichalPetryka May 11, 2023
46c45cc
Fix typo
MichalPetryka May 11, 2023
0c245fb
Fix warning
MichalPetryka May 11, 2023
6ca55ac
Format code
MichalPetryka May 11, 2023
1d4191d
Merge branch 'main' into bitcast-indir
MichalPetryka May 15, 2023
455b468
Merge branch 'main' into bitcast-indir
MichalPetryka May 18, 2023
7544cff
Merge upstream
MichalPetryka Jun 5, 2023
3aed08b
Fix merge
MichalPetryka Jun 5, 2023
f68aec0
Fix merge
MichalPetryka Jun 5, 2023
23e48d2
Rename variables
MichalPetryka Jun 5, 2023
964ab38
Fix typo
MichalPetryka Jun 5, 2023
7253d9e
Format code
MichalPetryka Jun 5, 2023
81fd3c7
Merge upstream
MichalPetryka Jun 7, 2023
e653348
Add missing free
MichalPetryka Jun 7, 2023
86ff6d4
Merge upstream
MichalPetryka Jun 13, 2023
5111f6e
Add IL tests
MichalPetryka Jun 14, 2023
8174abd
Update BitCast.il
MichalPetryka Jun 14, 2023
b9160be
Fix IL test
MichalPetryka Jun 14, 2023
d864688
Intrinsify Copy too
MichalPetryka Jun 14, 2023
588d55e
Update UnsafeTests.cs
MichalPetryka Jul 10, 2023
674d605
Update UnsafeTests.cs
MichalPetryka Jul 10, 2023
43ebe78
Update UnsafeTests.cs
MichalPetryka Jul 10, 2023
8e52b2f
Update src/tests/JIT/Intrinsics/BitCast.il
MichalPetryka Jul 10, 2023
300951c
Add struct copy tests
MichalPetryka Jul 13, 2023
7b9afe4
Merge branch 'dotnet:main' into bitcast-indir
MichalPetryka Jul 13, 2023
ac25690
Merge branch 'dotnet:main' into bitcast-indir
MichalPetryka Jul 14, 2023
add3666
Merge branch 'dotnet:main' into bitcast-indir
MichalPetryka Jul 15, 2023
5754b95
Merge branch 'dotnet:main' into bitcast-indir
MichalPetryka Jul 15, 2023
88e8829
Merge branch 'dotnet:main' into bitcast-indir
MichalPetryka Jul 18, 2023
87950df
Merge branch 'dotnet:main' into bitcast-indir
MichalPetryka Jul 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix build
  • Loading branch information
MichalPetryka committed Apr 30, 2023
commit a5bb60b3b9db6fb1bc2de77e98bbca8590fdbdb4
19 changes: 10 additions & 9 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,9 +958,9 @@ GenTree* Compiler::impAssignStruct(GenTree* dest,
srcCall->ShouldHaveRetBufArg() ? WellKnownArg::RetBuffer : WellKnownArg::None;

// TODO: deal with flags
GenTreeFlags indirFlags = GTF_EMPTY;
GenTree* destAddr = impGetNodeAddr(dest, srcCall->gtRetClsHnd, CHECK_SPILL_ALL, &indirFlags);
NewCallArg newArg = NewCallArg::Primitive(destAddr).WellKnown(wellKnownArgType);
GenTreeFlags indirFlags = GTF_EMPTY;
GenTree* destAddr = impGetNodeAddr(dest, srcCall->gtRetClsHnd, CHECK_SPILL_ALL, &indirFlags);
NewCallArg newArg = NewCallArg::Primitive(destAddr).WellKnown(wellKnownArgType);

#if !defined(TARGET_ARM)
// Unmanaged instance methods on Windows or Unix X86 need the retbuf arg after the first (this) parameter
Expand Down Expand Up @@ -1062,8 +1062,8 @@ GenTree* Compiler::impAssignStruct(GenTree* dest,
{
// insert the return value buffer into the argument list as first byref parameter after 'this'
// TODO: deal with flags
GenTreeFlags indirFlags = GTF_EMPTY;
GenTree* destAddr = impGetNodeAddr(dest, call->gtRetClsHnd, CHECK_SPILL_ALL, &indirFlags);
GenTreeFlags indirFlags = GTF_EMPTY;
GenTree* destAddr = impGetNodeAddr(dest, call->gtRetClsHnd, CHECK_SPILL_ALL, &indirFlags);
call->gtArgs.InsertAfterThisOrFirst(this,
NewCallArg::Primitive(destAddr).WellKnown(WellKnownArg::RetBuffer));

Expand All @@ -1080,8 +1080,8 @@ GenTree* Compiler::impAssignStruct(GenTree* dest,
{
// Since we are assigning the result of a GT_MKREFANY, "destAddr" must point to a refany.
// TODO-CQ: we can do this without address-exposing the local on the LHS.
GenTreeFlags indirFlags = GTF_EMPTY;
GenTree* destAddr = impGetNodeAddr(dest, impGetRefAnyClass(), CHECK_SPILL_ALL, &indirFlags);
GenTreeFlags indirFlags = GTF_EMPTY;
GenTree* destAddr = impGetNodeAddr(dest, impGetRefAnyClass(), CHECK_SPILL_ALL, &indirFlags);
GenTree* destAddrClone;
destAddr = impCloneExpr(destAddr, &destAddrClone, NO_CLASS_HANDLE, curLevel,
pAfterStmt DEBUGARG("MKREFANY assignment"));
Expand Down Expand Up @@ -3639,7 +3639,8 @@ void Compiler::impImportAndPushBox(CORINFO_RESOLVED_TOKEN* pResolvedToken)

// TODO: deal with flags
GenTreeFlags indirFlags = GTF_EMPTY;
op1 = gtNewHelperCallNode(boxHelper, TYP_REF, op2, impGetNodeAddr(exprToBox, operCls, CHECK_SPILL_ALL, &indirFlags));
op1 = gtNewHelperCallNode(boxHelper, TYP_REF, op2,
impGetNodeAddr(exprToBox, operCls, CHECK_SPILL_ALL, &indirFlags));
}

/* Push the result back on the stack, */
Expand Down Expand Up @@ -10035,7 +10036,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
// Fetch the type from the correct slot
op1 = gtNewOperNode(GT_ADD, TYP_BYREF, op1,
gtNewIconNode(OFFSETOF__CORINFO_TypedReference__type, TYP_I_IMPL));
op1 = gtNewIndir(TYP_BYREF, op1, flags);
op1 = gtNewIndir(TYP_BYREF, op1, indirFlags);
}

// Convert native TypeHandle to RuntimeTypeHandle.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4416,7 +4416,7 @@ GenTree* Compiler::impSRCSUnsafeIntrinsic(NamedIntrinsic intrinsic,
ClassLayout* layout = nullptr;
var_types type = TypeHandleToVarType(typeHnd, &layout);
GenTreeFlags flags = intrinsic == NI_SRCS_UNSAFE_WriteUnaligned ? GTF_IND_UNALIGNED : GTF_EMPTY;
GenTree* indir = gtNewLoadValueNode(type, layout, op2, flags);
GenTree* indir = gtNewLoadValueNode(type, layout, op2, flags);

if (varTypeIsStruct(type))
{
Expand Down