Skip to content

Commit d547a11

Browse files
committed
---
yaml --- r: 311293 b: refs/heads/tensorflow-merge c: 3da2822 h: refs/heads/master i: 311291: 43dc3f4
1 parent 125bbaf commit d547a11

File tree

7 files changed

+439
-340
lines changed

7 files changed

+439
-340
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ refs/heads/chase-my-tail: 8bb91443a9e81bbfac92a2621a0af887a1da8dbf
13791379
refs/heads/consider-outer-alternatives: 708bac749ec60a22a79e2eefbe734f9488a7370d
13801380
refs/heads/revert-25740-oops-i-linked-it-again: fdd41aeb682fc488572bdc1cf71b2ff6997ba576
13811381
refs/heads/swift-5.1-branch-06-12-2019: e63b7b2d3b93c48232d386099d0ec525d21d8f8d
1382-
refs/heads/tensorflow-merge: 5b55ab10b6ba44265ec2652a018303a37bf0e070
1382+
refs/heads/tensorflow-merge: 3da28223a7f04660946a1849b3c48c49e5854894
13831383
refs/heads/update-checkout-sha-info: 5832743c5c2a842976c42a508a4c6dcceefb0aef
13841384
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-12-a: 228f0448d9bb909aacbba4afcb7c600a405d15da
13851385
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-14-a: 922861a77b5fc2bf46bc917da70ceb15eef76836

branches/tensorflow-merge/include/swift/SIL/SILConstants.h

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class SerializedSILLoader;
2929
struct APIntSymbolicValue;
3030
struct APFloatSymbolicValue;
3131
struct StringSymbolicValue;
32-
struct AddressSymbolicValue;
3332
struct AggregateSymbolicValue;
3433

3534
/// When we fail to constant fold a value, this captures a reason why,
@@ -97,12 +96,6 @@ class SymbolicValue {
9796
/// representing a UTF-8 encoded string.
9897
RK_String,
9998

100-
/// This value is a pointer to a tracked memory location, along with zero
101-
/// or more indices (tuple indices, struct field indices, etc) into the
102-
/// value if it is an aggregate.
103-
///
104-
RK_Address,
105-
10699
/// This value is an array, struct, or tuple of constants. This is
107100
/// tracked by the "aggregate" member of the value union. Note that we
108101
/// cheat and represent single-element structs as the value of their
@@ -143,10 +136,6 @@ class SymbolicValue {
143136
/// information about the StringRef value it holds.
144137
StringSymbolicValue *string;
145138

146-
/// When this SymbolicValue is of "Address" kind, this pointer stores
147-
/// info about the base and the indices for the address.
148-
AddressSymbolicValue *address;
149-
150139
/// When this SymbolicValue is of "Aggregate" kind, this pointer stores
151140
/// information about the array elements, count, and element type.
152141
AggregateSymbolicValue *aggregate;
@@ -196,7 +185,6 @@ class SymbolicValue {
196185

197186
/// These values are generally only seen internally to the system, external
198187
/// clients shouldn't have to deal with them.
199-
Address,
200188
UninitMemory
201189
};
202190

@@ -218,6 +206,10 @@ class SymbolicValue {
218206
return result;
219207
}
220208

209+
bool isUnknown() const {
210+
return getKind() == Unknown;
211+
}
212+
221213
/// Return information about an unknown result, including the SIL node that
222214
/// is a problem, and the reason it is an issue.
223215
std::pair<SILNode *, UnknownReason> getUnknownValue() const {
@@ -303,22 +295,6 @@ class SymbolicValue {
303295
/// Returns the UTF-8 encoded string underlying a SymbolicValue.
304296
StringRef getStringValue() const;
305297

306-
/// Get a SymbolicValue corresponding to a memory object with an optional
307-
/// list of indices into it. This is used by (e.g.) a struct_element_addr
308-
/// of a stack_alloc.
309-
static SymbolicValue getAddress(SILValue base,
310-
ArrayRef<unsigned> indices,
311-
llvm::BumpPtrAllocator &allocator);
312-
313-
/// Accessors for Address SymbolicValue's.
314-
bool isAddress() const {
315-
return getKind() == Address;
316-
}
317-
318-
SILValue getAddressBase() const;
319-
ArrayRef<unsigned> getAddressIndices() const;
320-
321-
322298
/// This returns an aggregate value with the specified elements in it. This
323299
/// copies the elements into the specified allocator.
324300
static SymbolicValue getAggregate(ArrayRef<SymbolicValue> elements,

branches/tensorflow-merge/lib/SIL/SILConstants.cpp

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ void SymbolicValue::print(llvm::raw_ostream &os, unsigned indent) const {
7070
case RK_String:
7171
os << "string: \"" << getStringValue() << "\"\n";
7272
return;
73-
case RK_Address: {
74-
os << "address indices = [";
75-
interleave(getAddressIndices(), [&](unsigned idx) { os << idx; },
76-
[&]() { os << ", "; });
77-
os << "]: " << getAddressBase();
78-
return;
79-
}
8073
case RK_Aggregate: {
8174
ArrayRef<SymbolicValue> elements = getAggregateValue();
8275
if (elements.empty()) {
@@ -109,7 +102,6 @@ SymbolicValue::Kind SymbolicValue::getKind() const {
109102
case RK_Unknown: return Unknown;
110103
case RK_Metatype: return Metatype;
111104
case RK_Function: return Function;
112-
case RK_Address: return Address;
113105
case RK_Aggregate: return Aggregate;
114106
case RK_Integer: return Integer;
115107
case RK_Float: return Float;
@@ -336,74 +328,6 @@ StringRef SymbolicValue::getStringValue() const {
336328
return cast<StringLiteralInst>(value.inst)->getValue();
337329
}
338330

339-
//===----------------------------------------------------------------------===//
340-
// Addresses
341-
//===----------------------------------------------------------------------===//
342-
343-
namespace swift {
344-
/// This is a representation of an address value, stored as a base pointer plus
345-
/// trailing array of indices. Elements of this value are bump-pointer
346-
/// allocated.
347-
struct alignas(SILValue) AddressSymbolicValue final
348-
: private llvm::TrailingObjects<AddressSymbolicValue, unsigned> {
349-
friend class llvm::TrailingObjects<AddressSymbolicValue, unsigned>;
350-
351-
/// The number of words in the trailing array and # bits of the value.
352-
const SILValue base;
353-
const unsigned numIndices;
354-
355-
static AddressSymbolicValue *create(SILValue base, ArrayRef<unsigned> indices,
356-
llvm::BumpPtrAllocator &allocator) {
357-
auto byteSize =
358-
AddressSymbolicValue::totalSizeToAlloc<unsigned>(indices.size());
359-
auto rawMem = allocator.Allocate(byteSize, alignof(AddressSymbolicValue));
360-
361-
// Placement initialize the AddressSymbolicValue.
362-
auto alv = ::new (rawMem) AddressSymbolicValue(base, indices.size());
363-
std::uninitialized_copy(indices.begin(), indices.end(),
364-
alv->getTrailingObjects<unsigned>());
365-
return alv;
366-
}
367-
368-
ArrayRef<unsigned> getIndices() const {
369-
return { getTrailingObjects<unsigned>(), numIndices };
370-
}
371-
372-
// This is used by the llvm::TrailingObjects base class.
373-
size_t numTrailingObjects(OverloadToken<unsigned>) const {
374-
return numIndices;
375-
}
376-
private:
377-
AddressSymbolicValue() = delete;
378-
AddressSymbolicValue(const AddressSymbolicValue &) = delete;
379-
AddressSymbolicValue(SILValue base, unsigned numIndices)
380-
: base(base), numIndices(numIndices) {}
381-
};
382-
} // end namespace swift
383-
384-
385-
SymbolicValue
386-
SymbolicValue::getAddress(SILValue base, ArrayRef<unsigned> indices,
387-
llvm::BumpPtrAllocator &allocator) {
388-
auto alv = AddressSymbolicValue::create(base, indices, allocator);
389-
assert(alv && "aggregate value must be present");
390-
SymbolicValue result;
391-
result.representationKind = RK_Address;
392-
result.value.address = alv;
393-
return result;
394-
}
395-
396-
SILValue SymbolicValue::getAddressBase() const {
397-
assert(representationKind == RK_Address);
398-
return value.address->base;
399-
}
400-
401-
ArrayRef<unsigned> SymbolicValue::getAddressIndices() const {
402-
assert(representationKind == RK_Address);
403-
return value.address->getIndices();
404-
}
405-
406-
407331
//===----------------------------------------------------------------------===//
408332
// Aggregates
409333
//===----------------------------------------------------------------------===//

branches/tensorflow-merge/lib/SIL/SILPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,6 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
12271227
*this << "]";
12281228
return;
12291229
case SymbolicValue::Function:
1230-
case SymbolicValue::Address:
12311230
case SymbolicValue::UninitMemory:
12321231
case SymbolicValue::Unknown:
12331232
llvm_unreachable("Unimplemented SymbolicValue case");

0 commit comments

Comments
 (0)