Skip to content
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

Add a -Z flag for LLVM align attributes on arguments #49122

Merged
merged 1 commit into from
Mar 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"set the MIR optimization level (0-3, default: 1)"),
mutable_noalias: bool = (false, parse_bool, [UNTRACKED],
"emit noalias metadata for mutable references"),
arg_align_attributes: bool = (false, parse_bool, [UNTRACKED],
"emit align metadata for reference arguments"),
dump_mir: Option<String> = (None, parse_opt_string, [UNTRACKED],
"dump MIR state at various points in translation"),
dump_mir_dir: String = (String::from("mir_dump"), parse_string, [UNTRACKED],
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ impl<'a, 'tcx> FnType<'tcx> {

// HACK(eddyb) LLVM inserts `llvm.assume` calls when inlining functions
// with align attributes, and those calls later block optimizations.
if !is_return {
if !is_return && !cx.tcx.sess.opts.debugging_opts.arg_align_attributes {
attrs.pointee_align = None;
}

Expand Down