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
Conversation
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this being a legal inbounds
.
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.
The intended semantics for the intrinsics are not really defined in any detail in the upstream docs, but I guess it should be fine.
The 2nd commit adds |
} else if (!passPointer) { | ||
} else if (passPointer) { | ||
// ref/out | ||
attrs.addDereferenceable(loweredDType->size()); |
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.
inbounds
inbounds
and add additional param attributes
Mark most GEPs `inbounds` and add additional param attributes
No description provided.