diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index e2a7f8a55111e..4caa44b32dfa9 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -902,7 +902,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { let trunc = self.trunc(val, dest_ty); if llvm_util::get_version() >= (19, 0, 0) { unsafe { - if llvm::LLVMIsATruncInst(trunc).is_some() { + if llvm::LLVMIsAInstruction(trunc).is_some() { llvm::LLVMSetNUW(trunc, True); } } @@ -914,7 +914,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { let trunc = self.trunc(val, dest_ty); if llvm_util::get_version() >= (19, 0, 0) { unsafe { - if llvm::LLVMIsATruncInst(trunc).is_some() { + if llvm::LLVMIsAInstruction(trunc).is_some() { llvm::LLVMSetNSW(trunc, True); } } diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 1e105e86189f1..3b0187b9d37b1 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -1165,7 +1165,6 @@ unsafe extern "C" { // Operations on instructions pub(crate) fn LLVMIsAInstruction(Val: &Value) -> Option<&Value>; - pub(crate) fn LLVMIsATruncInst(Val: &Value) -> Option<&Value>; pub(crate) fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock; pub(crate) fn LLVMGetOperand(Val: &Value, Index: c_uint) -> Option<&Value>; diff --git a/tests/codegen/unchecked_shifts.rs b/tests/codegen/unchecked_shifts.rs index a0d8990d29fd1..9fccaf2252e01 100644 --- a/tests/codegen/unchecked_shifts.rs +++ b/tests/codegen/unchecked_shifts.rs @@ -24,9 +24,9 @@ pub unsafe fn unchecked_shl_unsigned_same(a: u32, b: u32) -> u32 { #[no_mangle] pub unsafe fn unchecked_shl_unsigned_smaller(a: u16, b: u32) -> u16 { // CHECK-NOT: assume - // LLVM18-DAG: %[[TRUNC:.+]] = trunc i32 %b to i16 - // LLVM19PLUS-DAG: %[[TRUNC:.+]] = trunc nuw i32 %b to i16 - // CHECK-DAG: shl i16 %a, %[[TRUNC]] + // LLVM18: %[[TRUNC:.+]] = trunc i32 %b to i16 + // LLVM19PLUS: %[[TRUNC:.+]] = trunc nuw i32 %b to i16 + // CHECK: shl i16 %a, %[[TRUNC]] a.unchecked_shl(b) }