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 |
||
---|---|---|
.. | ||
ADT | ||
Analysis | ||
Assembly | ||
Bitcode | ||
CodeGen | ||
Config | ||
DebugInfo | ||
ExecutionEngine | ||
MC | ||
Object | ||
Support | ||
TableGen | ||
Target | ||
Transforms | ||
AddressingMode.h | ||
Argument.h | ||
Attributes.h | ||
AutoUpgrade.h | ||
BasicBlock.h | ||
CallGraphSCCPass.h | ||
CallingConv.h | ||
CMakeLists.txt | ||
Constant.h | ||
Constants.h | ||
DataLayout.h | ||
DebugInfo.h | ||
DefaultPasses.h | ||
DerivedTypes.h | ||
DIBuilder.h | ||
Function.h | ||
GlobalAlias.h | ||
GlobalValue.h | ||
GlobalVariable.h | ||
GVMaterializer.h | ||
InitializePasses.h | ||
InlineAsm.h | ||
InstrTypes.h | ||
Instruction.def | ||
Instruction.h | ||
Instructions.h | ||
InstVisitor.h | ||
IntrinsicInst.h | ||
Intrinsics.h | ||
Intrinsics.td | ||
IntrinsicsARM.td | ||
IntrinsicsHexagon.td | ||
IntrinsicsMips.td | ||
IntrinsicsNVVM.td | ||
IntrinsicsPowerPC.td | ||
IntrinsicsX86.td | ||
IntrinsicsXCore.td | ||
IRBuilder.h | ||
LinkAllPasses.h | ||
LinkAllVMCore.h | ||
Linker.h | ||
LLVMContext.h | ||
MDBuilder.h | ||
Metadata.h | ||
Module.h | ||
OperandTraits.h | ||
Operator.h | ||
Pass.h | ||
PassAnalysisSupport.h | ||
PassManager.h | ||
PassManagers.h | ||
PassRegistry.h | ||
PassSupport.h | ||
SymbolTableListTraits.h | ||
TargetTransformInfo.h | ||
Type.h | ||
TypeBuilder.h | ||
TypeFinder.h | ||
Use.h | ||
User.h | ||
Value.h | ||
ValueSymbolTable.h |