@@ -1485,11 +1485,6 @@ CallArg* CallArgs::GetThisArg()
1485
1485
// convention it is passed in x8 (see `CallArgs::GetCustomRegister` for the
1486
1486
// exact conditions).
1487
1487
//
1488
- // Some jit helpers may have "out buffers" that are _not_ classified as the
1489
- // ret buffer. These are normal arguments that function similarly to ret
1490
- // buffers, but they do not have the special ABI treatment of ret buffers.
1491
- // See `GenTreeCall::TreatAsShouldHaveRetBufArg` for more details.
1492
- //
1493
1488
CallArg* CallArgs::GetRetBufferArg()
1494
1489
{
1495
1490
if (!HasRetBuffer())
@@ -2402,56 +2397,6 @@ int GenTreeCall::GetNonStandardAddedArgCount(Compiler* compiler) const
2402
2397
return 0;
2403
2398
}
2404
2399
2405
- //-------------------------------------------------------------------------
2406
- // TreatAsShouldHaveRetBufArg:
2407
- //
2408
- // Return Value:
2409
- // Returns true if we treat the call as if it has a retBuf argument
2410
- // This method may actually have a retBuf argument
2411
- // or it could be a JIT helper that we are still transforming during
2412
- // the importer phase.
2413
- //
2414
- // Notes:
2415
- // On ARM64 marking the method with the GTF_CALL_M_RETBUFFARG flag
2416
- // will make HasRetBufArg() return true, but will also force the
2417
- // use of register x8 to pass the RetBuf argument.
2418
- //
2419
- // These two Jit Helpers that we handle here by returning true
2420
- // aren't actually defined to return a struct, so they don't expect
2421
- // their RetBuf to be passed in x8, instead they expect it in x0.
2422
- //
2423
- bool GenTreeCall::TreatAsShouldHaveRetBufArg() const
2424
- {
2425
- if (ShouldHaveRetBufArg())
2426
- {
2427
- return true;
2428
- }
2429
-
2430
- // If we see a Jit helper call that returns a TYP_STRUCT we may
2431
- // transform it as if it has a Return Buffer Argument
2432
- //
2433
- if (IsHelperCall() && (gtReturnType == TYP_STRUCT))
2434
- {
2435
- // There are two helpers that return structs through an argument,
2436
- // ignoring the ABI, but where we want to handle them during import as
2437
- // if they have return buffers:
2438
- // - CORINFO_HELP_GETFIELDSTRUCT
2439
- // - CORINFO_HELP_UNBOX_NULLABLE
2440
- //
2441
- // Other TYP_STRUCT returning helpers follow the ABI normally and
2442
- // should return true for `ShouldHaveRetBufArg` if they need a retbuf
2443
- // arg, so when we get here, those cases never need retbufs. They
2444
- // include:
2445
- // - CORINFO_HELP_PINVOKE_CALLI
2446
- // - CORINFO_HELP_DISPATCH_INDIRECT_CALL
2447
- //
2448
- CorInfoHelpFunc helpFunc = Compiler::eeGetHelperNum(gtCallMethHnd);
2449
-
2450
- return (helpFunc == CORINFO_HELP_GETFIELDSTRUCT) || (helpFunc == CORINFO_HELP_UNBOX_NULLABLE);
2451
- }
2452
- return false;
2453
- }
2454
-
2455
2400
//-------------------------------------------------------------------------
2456
2401
// IsHelperCall: Determine if this GT_CALL node is a specific helper call.
2457
2402
//
@@ -16548,14 +16493,7 @@ GenTree* Compiler::gtNewRefCOMfield(GenTree* objPtr,
16548
16493
if (access & CORINFO_ACCESS_SET)
16549
16494
{
16550
16495
assert(value != nullptr);
16551
- // helper needs pointer to struct, not struct itself
16552
- if (pFieldInfo->helper == CORINFO_HELP_SETFIELDSTRUCT)
16553
- {
16554
- // TODO-Bug?: verify if flags matter here
16555
- GenTreeFlags indirFlags = GTF_EMPTY;
16556
- value = impGetNodeAddr(value, CHECK_SPILL_ALL, &indirFlags);
16557
- }
16558
- else if (lclTyp == TYP_DOUBLE && value->TypeGet() == TYP_FLOAT)
16496
+ if ((lclTyp == TYP_DOUBLE) && (value->TypeGet() == TYP_FLOAT))
16559
16497
{
16560
16498
value = gtNewCastNode(TYP_DOUBLE, value, false, TYP_DOUBLE);
16561
16499
}
@@ -16570,22 +16508,9 @@ GenTree* Compiler::gtNewRefCOMfield(GenTree* objPtr,
16570
16508
else if (access & CORINFO_ACCESS_GET)
16571
16509
{
16572
16510
helperType = lclTyp;
16573
-
16574
- // The calling convention for the helper does not take into
16575
- // account optimization of primitive structs.
16576
- if ((pFieldInfo->helper == CORINFO_HELP_GETFIELDSTRUCT) && !varTypeIsStruct(lclTyp))
16577
- {
16578
- helperType = TYP_STRUCT;
16579
- }
16580
16511
}
16581
16512
}
16582
16513
16583
- if (pFieldInfo->helper == CORINFO_HELP_GETFIELDSTRUCT || pFieldInfo->helper == CORINFO_HELP_SETFIELDSTRUCT)
16584
- {
16585
- assert(pFieldInfo->structType != nullptr);
16586
- args[nArgs++] = gtNewIconEmbClsHndNode(pFieldInfo->structType);
16587
- }
16588
-
16589
16514
GenTree* fieldHnd = impTokenToHandle(pResolvedToken);
16590
16515
if (fieldHnd == nullptr)
16591
16516
{ // compDonotInline()
@@ -16622,23 +16547,10 @@ GenTree* Compiler::gtNewRefCOMfield(GenTree* objPtr,
16622
16547
16623
16548
if (pFieldInfo->fieldAccessor == CORINFO_FIELD_INSTANCE_HELPER)
16624
16549
{
16625
- if (access & CORINFO_ACCESS_GET)
16550
+ if ((( access & CORINFO_ACCESS_GET) != 0) && varTypeIsSmall(lclTyp) )
16626
16551
{
16627
- if (pFieldInfo->helper == CORINFO_HELP_GETFIELDSTRUCT)
16628
- {
16629
- if (!varTypeIsStruct(lclTyp))
16630
- {
16631
- // get the result as primitive type
16632
- GenTreeFlags indirFlags = GTF_EMPTY;
16633
- result = impGetNodeAddr(result, CHECK_SPILL_ALL, &indirFlags);
16634
- result = gtNewIndir(lclTyp, result, indirFlags);
16635
- }
16636
- }
16637
- else if (varTypeIsSmall(lclTyp))
16638
- {
16639
- // The helper does not extend the small return types.
16640
- result = gtNewCastNode(genActualType(lclTyp), result, false, lclTyp);
16641
- }
16552
+ // The helper does not extend the small return types.
16553
+ result = gtNewCastNode(genActualType(lclTyp), result, false, lclTyp);
16642
16554
}
16643
16555
}
16644
16556
else if ((access & CORINFO_ACCESS_ADDRESS) == 0) // OK, now do the indirection
0 commit comments