mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
ef5e4688df
For comparison, with this code sample: PointerUnion<int *, char *> Data; PointerUnion<int *, char *> foo1() { Data = new int; return new int; } PointerUnion<int *, char *> foo2() { Data = new char; return new char; } Before this patch we would get: define i64 @_Z4foo1v() uwtable ssp { %1 = tail call noalias i8* @_Znwm(i64 4) %2 = ptrtoint i8* %1 to i64 %3 = load i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8 %4 = and i64 %3, 1 %.masked.i = and i64 %2, -3 %5 = or i64 %4, %.masked.i store i64 %5, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8 %6 = tail call noalias i8* @_Znwm(i64 4) %7 = ptrtoint i8* %6 to i64 %8 = and i64 %7, -3 ret i64 %8 } define i64 @_Z4foo2v() uwtable ssp { %1 = tail call noalias i8* @_Znwm(i64 1) %2 = ptrtoint i8* %1 to i64 %3 = load i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8 %4 = and i64 %3, 1 %5 = or i64 %2, %4 %6 = or i64 %5, 2 store i64 %6, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8 %7 = tail call noalias i8* @_Znwm(i64 1) %8 = ptrtoint i8* %7 to i64 %9 = or i64 %8, 2 ret i64 %9 } After the patch: define i64 @_Z4foo1v() uwtable ssp { %1 = tail call noalias i8* @_Znwm(i64 4) %2 = ptrtoint i8* %1 to i64 store i64 %2, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8 %3 = tail call noalias i8* @_Znwm(i64 4) %4 = ptrtoint i8* %3 to i64 ret i64 %4 } declare noalias i8* @_Znwm(i64) define i64 @_Z4foo2v() uwtable ssp { %1 = tail call noalias i8* @_Znwm(i64 1) %2 = ptrtoint i8* %1 to i64 %3 = or i64 %2, 2 store i64 %3, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8 %4 = tail call noalias i8* @_Znwm(i64 1) %5 = ptrtoint i8* %4 to i64 %6 = or i64 %5, 2 ret i64 %6 } llvm-svn: 169147 |
||
---|---|---|
.. | ||
APFloat.h | ||
APInt.h | ||
APSInt.h | ||
ArrayRef.h | ||
BitVector.h | ||
DAGDeltaAlgorithm.h | ||
DeltaAlgorithm.h | ||
DenseMap.h | ||
DenseMapInfo.h | ||
DenseSet.h | ||
DepthFirstIterator.h | ||
edit_distance.h | ||
EquivalenceClasses.h | ||
FoldingSet.h | ||
GraphTraits.h | ||
Hashing.h | ||
ilist_node.h | ||
ilist.h | ||
ImmutableIntervalMap.h | ||
ImmutableList.h | ||
ImmutableMap.h | ||
ImmutableSet.h | ||
IndexedMap.h | ||
InMemoryStruct.h | ||
IntEqClasses.h | ||
IntervalMap.h | ||
IntrusiveRefCntPtr.h | ||
MapVector.h | ||
NullablePtr.h | ||
Optional.h | ||
OwningPtr.h | ||
PackedVector.h | ||
PointerIntPair.h | ||
PointerUnion.h | ||
PostOrderIterator.h | ||
PriorityQueue.h | ||
SCCIterator.h | ||
ScopedHashTable.h | ||
SetOperations.h | ||
SetVector.h | ||
SmallBitVector.h | ||
SmallPtrSet.h | ||
SmallSet.h | ||
SmallString.h | ||
SmallVector.h | ||
SparseBitVector.h | ||
SparseSet.h | ||
Statistic.h | ||
STLExtras.h | ||
StringExtras.h | ||
StringMap.h | ||
StringRef.h | ||
StringSet.h | ||
StringSwitch.h | ||
TinyPtrVector.h | ||
Triple.h | ||
Twine.h | ||
UniqueVector.h | ||
ValueMap.h | ||
VariadicFunction.h |