Skip to content

Commit 642a705

Browse files
committed
PR feedback
1 parent 511bf30 commit 642a705

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Diff for: compiler/rustc_codegen_llvm/src/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
946946
let trunc = self.trunc(val, dest_ty);
947947
if llvm_util::get_version() >= (19, 0, 0) {
948948
unsafe {
949-
if llvm::LLVMIsATruncInst(trunc).is_some() {
949+
if llvm::LLVMIsAInstruction(trunc).is_some() {
950950
llvm::LLVMSetNUW(trunc, True);
951951
}
952952
}
@@ -958,7 +958,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
958958
let trunc = self.trunc(val, dest_ty);
959959
if llvm_util::get_version() >= (19, 0, 0) {
960960
unsafe {
961-
if llvm::LLVMIsATruncInst(trunc).is_some() {
961+
if llvm::LLVMIsAInstruction(trunc).is_some() {
962962
llvm::LLVMSetNSW(trunc, True);
963963
}
964964
}

Diff for: compiler/rustc_codegen_llvm/src/llvm/ffi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,6 @@ unsafe extern "C" {
11651165

11661166
// Operations on instructions
11671167
pub(crate) fn LLVMIsAInstruction(Val: &Value) -> Option<&Value>;
1168-
pub(crate) fn LLVMIsATruncInst(Val: &Value) -> Option<&Value>;
11691168
pub(crate) fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock;
11701169
pub(crate) fn LLVMGetOperand(Val: &Value, Index: c_uint) -> Option<&Value>;
11711170

Diff for: tests/codegen/unchecked_shifts.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pub unsafe fn unchecked_shl_unsigned_same(a: u32, b: u32) -> u32 {
2424
#[no_mangle]
2525
pub unsafe fn unchecked_shl_unsigned_smaller(a: u16, b: u32) -> u16 {
2626
// CHECK-NOT: assume
27-
// LLVM18-DAG: %[[TRUNC:.+]] = trunc i32 %b to i16
28-
// LLVM19PLUS-DAG: %[[TRUNC:.+]] = trunc nuw i32 %b to i16
29-
// CHECK-DAG: shl i16 %a, %[[TRUNC]]
27+
// LLVM18: %[[TRUNC:.+]] = trunc i32 %b to i16
28+
// LLVM19PLUS: %[[TRUNC:.+]] = trunc nuw i32 %b to i16
29+
// CHECK: shl i16 %a, %[[TRUNC]]
3030
a.unchecked_shl(b)
3131
}
3232

0 commit comments

Comments
 (0)