mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
PR feedback
This commit is contained in:
@@ -946,7 +946,7 @@ fn unchecked_utrunc(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Valu
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -958,7 +958,7 @@ fn unchecked_strunc(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Valu
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1165,7 +1165,6 @@ pub(crate) fn LLVMAppendBasicBlockInContext<'a>(
|
||||
|
||||
// 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>;
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user