Skip to content

Commit dff88f9

Browse files
authored
Merge pull request #79317 from eeckstein/remove-alloc-vector
Remove the experimental FixedArray
2 parents 30bd7d9 + 45a78e6 commit dff88f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+6
-1605
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/AllocVectorLowering.swift

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

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
88

99
swift_compiler_sources(Optimizer
10-
AllocVectorLowering.swift
1110
AssumeSingleThreaded.swift
1211
AsyncDemotion.swift
1312
BooleanLiteralFolding.swift

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBuiltin.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ extension BuiltinInst : OnoneSimplifiable {
4747
.AssignCopyArrayFrontToBack,
4848
.AssignCopyArrayBackToFront,
4949
.AssignTakeArray,
50-
.AllocVector,
5150
.IsPOD:
5251
optimizeArgumentToThinMetatype(argument: 0, context)
5352
case .ICMP_EQ:

SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ private func registerSwiftPasses() {
6868
registerPass(stackProtection, { stackProtection.run($0) })
6969

7070
// Function passes
71-
registerPass(allocVectorLowering, { allocVectorLowering.run($0) })
7271
registerPass(asyncDemotion, { asyncDemotion.run($0) })
7372
registerPass(booleanLiteralFolding, { booleanLiteralFolding.run($0) })
7473
registerPass(letPropertyLowering, { letPropertyLowering.run($0) })

SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ extension Instruction {
424424
is FloatLiteralInst,
425425
is ObjectInst,
426426
is VectorInst,
427-
is AllocVectorInst,
428427
is UncheckedRefCastInst,
429428
is UpcastInst,
430429
is ValueToBridgeObjectInst,

SwiftCompilerSources/Sources/SIL/Builder.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ public struct Builder {
130130
return notifyNew(dr.getAs(AllocStackInst.self))
131131
}
132132

133-
public func createAllocVector(capacity: Value, elementType: Type) -> AllocVectorInst {
134-
let dr = bridged.createAllocVector(capacity.bridged, elementType.bridged)
135-
return notifyNew(dr.getAs(AllocVectorInst.self))
136-
}
137-
138133
@discardableResult
139134
public func createDeallocStack(_ operand: Value) -> DeallocStackInst {
140135
let dr = bridged.createDeallocStack(operand.bridged)

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,10 +1275,6 @@ final public class AllocStackInst : SingleValueInstruction, Allocation, DebugVar
12751275
}
12761276
}
12771277

1278-
final public class AllocVectorInst : SingleValueInstruction, Allocation, UnaryInstruction {
1279-
public var capacity: Value { operand.value }
1280-
}
1281-
12821278
public class AllocRefInstBase : SingleValueInstruction, Allocation {
12831279
final public var isObjC: Bool { bridged.AllocRefInstBase_isObjc() }
12841280

SwiftCompilerSources/Sources/SIL/Registration.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ public func registerSILClasses() {
226226
register(IsUniqueInst.self)
227227
register(DestroyNotEscapedClosureInst.self)
228228
register(AllocStackInst.self)
229-
register(AllocVectorInst.self)
230229
register(AllocPackInst.self)
231230
register(AllocPackMetadataInst.self)
232231
register(AllocRefInst.self)

docs/SIL/Instructions.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,6 @@ type, use `alloc_box`.
5555

5656
`T` must not be a pack type. To allocate a pack, use `alloc_pack`.
5757

58-
### alloc_vector
59-
60-
```
61-
sil-instruction ::= 'alloc_vector' sil-type, sil-operand
62-
63-
%1 = alloc_vector $T, %0 : $Builtin.Word
64-
// %1 has type $*T
65-
```
66-
67-
Allocates uninitialized memory that is sufficiently aligned on the stack
68-
to contain a vector of values of type `T`. The result of the instruction
69-
is the address of the allocated memory. The number of vector elements is
70-
specified by the operand, which must be a builtin integer value.
71-
72-
`alloc_vector` either allocates memory on the stack or - if contained in
73-
a global variable static initializer list - in the data section.
74-
75-
`alloc_vector` is a stack allocation instruction, unless it's contained
76-
in a global initializer list. See the section above on stack discipline.
77-
The corresponding stack deallocation instruction is `dealloc_stack`.
78-
7958
### alloc_pack
8059

8160
```

include/swift/AST/Builtins.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,6 @@ BUILTIN_MISC_OPERATION(UnprotectedStackAlloc, "unprotectedStackAlloc", "", Speci
638638
/// Builtin.stackAlloc(), is deallocated from the stack.
639639
BUILTIN_MISC_OPERATION(StackDealloc, "stackDealloc", "", Special)
640640

641-
/// allocVector<Element>(Element.Type, Builtin.Word) -> Builtin.RawPointer
642-
BUILTIN_MISC_OPERATION(AllocVector, "allocVector", "", Special)
643-
644641
/// Fence has type () -> ().
645642
BUILTIN_MISC_OPERATION(Fence, "fence", "", None)
646643

0 commit comments

Comments
 (0)