comparison gen/tollvm.h @ 1210:3d4581761b4c

Add some alignment info where LLVM might otherwise be more pessimistic. In particular, %.nest_arg is always aligned even though it's bitcast from i8*. Pointers in vtables are also guaranteed to be stored at aligned addresses.
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 12 Apr 2009 21:56:43 +0200
parents 2667e3a145be
children 45aca7e7cc88
comparison
equal deleted inserted replaced
1209:8699c450a1a0 1210:3d4581761b4c
61 LLConstant* DtoConstStringPtr(const char* str, const char* section = 0); 61 LLConstant* DtoConstStringPtr(const char* str, const char* section = 0);
62 LLConstant* DtoConstBool(bool); 62 LLConstant* DtoConstBool(bool);
63 63
64 // llvm wrappers 64 // llvm wrappers
65 LLValue* DtoLoad(LLValue* src, const char* name=0); 65 LLValue* DtoLoad(LLValue* src, const char* name=0);
66 LLValue* DtoAlignedLoad(LLValue* src, const char* name=0);
66 void DtoStore(LLValue* src, LLValue* dst); 67 void DtoStore(LLValue* src, LLValue* dst);
68 void DtoAlignedStore(LLValue* src, LLValue* dst);
67 LLValue* DtoBitCast(LLValue* v, const LLType* t, const char* name=0); 69 LLValue* DtoBitCast(LLValue* v, const LLType* t, const char* name=0);
68 LLConstant* DtoBitCast(LLConstant* v, const LLType* t); 70 LLConstant* DtoBitCast(LLConstant* v, const LLType* t);
69 71
70 // llvm::dyn_cast wrappers 72 // llvm::dyn_cast wrappers
71 const LLPointerType* isaPointer(LLValue* v); 73 const LLPointerType* isaPointer(LLValue* v);
115 /** 117 /**
116 * Generates a call to llvm.memcpy.i32 (or i64 depending on architecture). 118 * Generates a call to llvm.memcpy.i32 (or i64 depending on architecture).
117 * @param dst Destination memory. 119 * @param dst Destination memory.
118 * @param src Source memory. 120 * @param src Source memory.
119 * @param nbytes Number of bytes to copy. 121 * @param nbytes Number of bytes to copy.
122 * @param align The minimum alignment of the source and destination memory.
120 */ 123 */
121 void DtoMemCpy(LLValue* dst, LLValue* src, LLValue* nbytes); 124 void DtoMemCpy(LLValue* dst, LLValue* src, LLValue* nbytes, unsigned align = 0);
122 125
123 /** 126 /**
124 * Generates a call to C memcmp. 127 * Generates a call to C memcmp.
125 */ 128 */
126 LLValue* DtoMemCmp(LLValue* lhs, LLValue* rhs, LLValue* nbytes); 129 LLValue* DtoMemCmp(LLValue* lhs, LLValue* rhs, LLValue* nbytes);