Skip to content

Commit d992a94

Browse files
Fix an AMDGPU related load bit range metadata assertion.
1 parent 3170507 commit d992a94

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustc_codegen_llvm/builder.rs

+8
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
564564

565565

566566
pub fn range_metadata(&self, load: ValueRef, range: Range<u128>) {
567+
if self.sess().target.target.arch == "amdgpu" {
568+
// amdgpu/LLVM does something weird and thinks a i64 value is
569+
// split into a v2i32, halving the bitwidth LLVM expects,
570+
// tripping an assertion. So, for now, just disable this
571+
// optimization.
572+
return;
573+
}
574+
567575
unsafe {
568576
let llty = val_ty(load);
569577
let v = [

0 commit comments

Comments
 (0)