Skip to content

Commit

Permalink
Rollup merge of rust-lang#135027 - Flakebi:remove-range-workaround, r…
Browse files Browse the repository at this point in the history
…=compiler-errors

Remove range-metadata amdgpu workaround

Range metadata was disabled for amdgpu due to a backend bug. I did not encounter any problems when removing the workaround to enable range metadata (tried compiling `core` and `alloc`), so I assume this has been fixed in LLVM in the last years.

Remove the workaround to re-enable range metadata.

Tracking issue: rust-lang#135024
  • Loading branch information
matthiaskrgr authored Jan 2, 2025
2 parents c3ffc2d + 56bf673 commit e0cc6f1
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,14 +610,6 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
}

fn range_metadata(&mut self, load: &'ll Value, range: WrappingRange) {
if self.sess().target.arch == "amdgpu" {
// amdgpu/LLVM does something weird and thinks an i64 value is
// split into a v2i32, halving the bitwidth LLVM expects,
// tripping an assertion. So, for now, just disable this
// optimization.
return;
}

if self.cx.sess().opts.optimize == OptLevel::No {
// Don't emit metadata we're not going to use
return;
Expand Down

0 comments on commit e0cc6f1

Please sign in to comment.