-
Notifications
You must be signed in to change notification settings - Fork 114
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
initializes attribute for pointers not supported #1125
Comments
I should add that I find the language describing this attribute in LangRef to be vague. do we have to initialize it to something definite, or can we store poison there? or freeze poison? this language might also be troublesome for us? "This attribute only holds for the memory accessed via this pointer parameter. Other arbitrary accesses to the same memory via other pointers are allowed." ugh. |
I added preliminary support, which can already check if loads are ok or not.
|
failing test in LLVM test suite (missing support for function calls): define i16 @p1_write_only_caller() {
%ptr = alloca i64 2, align 2
store i16 0, ptr %ptr, align 2
call void @p1_write_only(nocapture noread noundef dead_on_unwind initializes((0, 2)) ptr %ptr)
%l = load i16, ptr %ptr, align 2
ret i16 %l
}
=>
declare void @p1_write_only(nocapture noread noundef dead_on_unwind initializes((0, 2)) ptr)
define i16 @p1_write_only_caller() {
%ptr = alloca i64 2, align 2
call void @p1_write_only(nocapture noread noundef dead_on_unwind initializes((0, 2)) ptr %ptr)
%l = load i16, ptr %ptr, align 2
ret i16 %l
} |
excellent-- I'm running into an issue with this pair (the same problem occurs in regular or assembly mode): define dso_local void @f(ptr nocapture %0, i32 zeroext %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, ptr %0, i64 1000000000000
store i8 %3, ptr %4, align 1
ret void
} and tgt: define void @f(ptr initializes((1000000000000, 1000000000001)) %0, i32 zeroext %1) {
arm_tv_entry:
%a7_3 = trunc i32 %1 to i8
%2 = getelementptr i8, ptr %0, i64 1000000000000
store i8 %a7_3, ptr %2, align 1
ret void
} here I'm getting a refinement failure that goes away if I remove the |
Fixed. Remaining task:
|
I'm getting pervasive arm-tv unit test failures because the middle end is inserting the
initializes
attribute like this:if the job here is to parse and ignore this attribute, then I can produce a patch. on the other hand, if we want to obligate the function to actually initialize that byte range, then the necessary changes are probably beyond my understanding of the memory model.
The text was updated successfully, but these errors were encountered: