Skip to content

Commit 6629a40

Browse files
committed
PR feedback
1 parent 79891a0 commit 6629a40

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
@@ -902,7 +902,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
902902
let trunc = self.trunc(val, dest_ty);
903903
if llvm_util::get_version() >= (19, 0, 0) {
904904
unsafe {
905-
if llvm::LLVMIsATruncInst(trunc).is_some() {
905+
if llvm::LLVMIsAInstruction(trunc).is_some() {
906906
llvm::LLVMSetNUW(trunc, True);
907907
}
908908
}
@@ -914,7 +914,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
914914
let trunc = self.trunc(val, dest_ty);
915915
if llvm_util::get_version() >= (19, 0, 0) {
916916
unsafe {
917-
if llvm::LLVMIsATruncInst(trunc).is_some() {
917+
if llvm::LLVMIsAInstruction(trunc).is_some() {
918918
llvm::LLVMSetNSW(trunc, True);
919919
}
920920
}

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)