Skip to content

Commit 66e8e19

Browse files
Fix an AMDGPU related load bit range metadata assertion.
1 parent bfddede commit 66e8e19

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
@@ -496,6 +496,14 @@ impl Builder<'a, 'll, 'tcx> {
496496

497497

498498
pub fn range_metadata(&self, load: &'ll Value, range: Range<u128>) {
499+
if self.sess().target.target.arch == "amdgpu" {
500+
// amdgpu/LLVM does something weird and thinks a i64 value is
501+
// split into a v2i32, halving the bitwidth LLVM expects,
502+
// tripping an assertion. So, for now, just disable this
503+
// optimization.
504+
return;
505+
}
506+
499507
unsafe {
500508
let llty = val_ty(load);
501509
let v = [

0 commit comments

Comments
 (0)