Skip to content

Commit 29da947

Browse files
committed
[6.0] Revert "Merge pull request #72708 from aschwaighofer/c_array_heuristic_6.0"
This reverts commit 0e350d8, reversing changes made to 1e5659e. It triggered a bug that needs to be tracked down. rdar://128019015
1 parent c9e109e commit 29da947

File tree

3 files changed

+3
-68
lines changed

3 files changed

+3
-68
lines changed

lib/IRGen/LoadableByAddress.cpp

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
//===----------------------------------------------------------------------===//
1818

1919
#define DEBUG_TYPE "loadable-address"
20-
#include "Explosion.h"
2120
#include "FixedTypeInfo.h"
2221
#include "IRGenMangler.h"
2322
#include "IRGenModule.h"
@@ -3432,29 +3431,6 @@ class AddressAssignment {
34323431
toDeleteBlockArg.push_back(std::make_pair(b, argIdx));
34333432
}
34343433

3435-
bool isPotentiallyCArray(SILType ty) {
3436-
if (ty.isAddress() || ty.isClassOrClassMetatype()) {
3437-
return false;
3438-
}
3439-
3440-
auto canType = ty.getASTType();
3441-
if (canType->hasTypeParameter()) {
3442-
assert(genEnv && "Expected a GenericEnv");
3443-
canType = genEnv->mapTypeIntoContext(canType)->getCanonicalType();
3444-
}
3445-
3446-
if (canType.getAnyGeneric() || isa<TupleType>(canType)) {
3447-
assert(ty.isObject() &&
3448-
"Expected only two categories: address and object");
3449-
assert(!canType->hasTypeParameter());
3450-
const TypeInfo &TI = irgenModule->getTypeInfoForLowered(canType);
3451-
auto explosionSchema = TI.getSchema();
3452-
if (explosionSchema.size() > 15)
3453-
return true;
3454-
}
3455-
return false;
3456-
}
3457-
34583434
bool isLargeLoadableType(SILType ty) {
34593435
if (ty.isAddress() || ty.isClassOrClassMetatype()) {
34603436
return false;
@@ -3472,11 +3448,7 @@ class AddressAssignment {
34723448
assert(!canType->hasTypeParameter());
34733449
const TypeInfo &TI = irgenModule->getTypeInfoForLowered(canType);
34743450
auto &nativeSchemaOrigParam = TI.nativeParameterValueSchema(*irgenModule);
3475-
if (nativeSchemaOrigParam.size() > 15)
3476-
return true;
3477-
auto explosionSchema = TI.getSchema();
3478-
if (explosionSchema.size() > 15)
3479-
return true;
3451+
return nativeSchemaOrigParam.size() > 15;
34803452
}
34813453
return false;
34823454
}
@@ -3793,7 +3765,7 @@ class AssignAddressToDef : SILInstructionVisitor<AssignAddressToDef> {
37933765
builder.createStore(bc->getLoc(), bc->getOperand(), opdAddr,
37943766
StoreOwnershipQualifier::Unqualified);
37953767
assignment.mapValueToAddress(origValue, addr);
3796-
assignment.markForDeletion(bc);
3768+
37973769
return;
37983770
}
37993771
auto opdAddr = assignment.getAddressForValue(bc->getOperand());
@@ -3955,9 +3927,7 @@ class RewriteUser : SILInstructionVisitor<RewriteUser> {
39553927
}
39563928

39573929
void visitDebugValueInst(DebugValueInst *dbg) {
3958-
if (!dbg->hasAddrVal() &&
3959-
(assignment.isPotentiallyCArray(dbg->getOperand()->getType()) ||
3960-
overlapsWithOnStackDebugLoc(dbg->getOperand()))) {
3930+
if (!dbg->hasAddrVal() && overlapsWithOnStackDebugLoc(dbg->getOperand())) {
39613931
assignment.markForDeletion(dbg);
39623932
return;
39633933
}

test/IRGen/Inputs/large_union.h

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/IRGen/large_union.swift

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)