-
Notifications
You must be signed in to change notification settings - Fork 14.3k
llvm-reduce: Fix overly conservative operands-to-args user restriction #133854
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
llvm-reduce: Fix overly conservative operands-to-args user restriction #133854
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@@ -96,7 +96,7 @@ declare void @ptr_user(ptr) | |||
|
|||
; INTERESTING-LABEL: define void @calls_and_passes_func( | |||
; REDUCED-LABEL: define void @calls_and_passes_func(ptr %has_callee_and_arg_user) { | |||
; REDUCED: call void @has_callee_and_arg_user(ptr %has_callee_and_arg_user) | |||
; REDUCED: call void @has_callee_and_arg_user(ptr %has_callee_and_arg_user, ptr null) |
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.
why do we pass null
here now, should we not ideally introduce a new argument?
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.
Whenever this this does anything, the call sites are adjusted to pass the default type value to the new argument
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.
with this we start replacing functions that have indirect references so we may break indirect calls, but I think that's fine
return false; | ||
}); | ||
static bool canReplaceFunction(const Function &F) { | ||
// TODO: Add controls to avoid ABI breaks (e.g. don't break main) |
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.
IMO llvm-reduce should be reducing main
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.
I'd just remove this
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.
It shoul, but it would be useful to have a mode to opt out and avoid breaking anything needed to execute the function (bugpoint has a more primitive version of the option than the one I would like)
ReduceArguments already does that (though eventually I think we need an option to preserve executability) |
I assume this was a leftover from typed pointers. It's easier to replace the non-callee uses, they are just replacable pointer values.
83ba71f
to
e3463ee
Compare
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.
ping
llvm#133854) I assume this was a leftover from typed pointers. It's easier to replace the non-callee uses, they are just replacable pointer values.
llvm#133854) I assume this was a leftover from typed pointers. It's easier to replace the non-callee uses, they are just replacable pointer values.
I assume this was a leftover from typed pointers. It's easier to replace
the non-callee uses, they are just replacable pointer values.