Skip to content

Commit

Permalink
Remove range-metadata amdgpu workaround
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Flakebi committed Jan 2, 2025
1 parent bf6f8a4 commit 56bf673
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 56bf673

Please sign in to comment.