Skip to content

Commit

Permalink
Fix an AMDGPU related load bit range metadata assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondLovesYou committed Aug 23, 2018
1 parent bfddede commit 66e8e19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/librustc_codegen_llvm/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,14 @@ impl Builder<'a, 'll, 'tcx> {


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

unsafe {
let llty = val_ty(load);
let v = [
Expand Down

0 comments on commit 66e8e19

Please sign in to comment.