-
-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark most GEPs inbounds
and add additional param attributes
#1232
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -531,7 +531,7 @@ bool DtoLowerMagicIntrinsic(IRState *p, FuncDeclaration *fndecl, CallExp *e, | |
assert(bitmask == 31 || bitmask == 63); | ||
// auto q = cast(size_t*)ptr + (bitnum >> (64bit ? 6 : 5)); | ||
LLValue *q = DtoBitCast(ptr, DtoSize_t()->getPointerTo()); | ||
q = DtoGEP1(q, p->ir->CreateLShr(bitnum, bitmask == 63 ? 6 : 5), "bitop.q"); | ||
q = DtoGEP1(q, p->ir->CreateLShr(bitnum, bitmask == 63 ? 6 : 5), true, "bitop.q"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about this being a legal There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The intended semantics for the intrinsics are not really defined in any detail in the upstream docs, but I guess it should be fine. |
||
|
||
// auto mask = 1 << (bitnum & bitmask); | ||
LLValue *mask = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -373,7 +373,7 @@ llvm::GlobalVariable *IrAggr::getInterfaceVtbl(BaseClass *b, bool new_instance, | |
: 1]; | ||
LLType *targetThisType = thisArg->getType(); | ||
thisArg = DtoBitCast(thisArg, getVoidPtrType()); | ||
thisArg = DtoGEP1(thisArg, DtoConstInt(-b->offset)); | ||
thisArg = DtoGEP1(thisArg, DtoConstInt(-b->offset), true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about this one either. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be fine, this is semantically the same as http://llvm.org/docs/LangRef.html#prefix-data, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, looks similar. The docs also state that the base pointer ( |
||
thisArg = DtoBitCast(thisArg, targetThisType); | ||
|
||
// call the real vtbl function. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getTypeAllocSize(DtoType(loweredDType))
doesn't work here as some LL types seem opaque (forward-declared).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's strange, but I guess we'll roll with it for now.