about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/builder.rs
diff options
context:
space:
mode:
authorTshepang Mbambo <hopsi@tuta.io>2025-06-09 07:19:50 +0200
committerGitHub <noreply@github.com>2025-06-09 07:19:50 +0200
commit4967fd24dec0b178e8766c0d5ce6146d2fd2c152 (patch)
tree84784da83b710a97f9944b753c9d7717e37b631b /compiler/rustc_codegen_llvm/src/builder.rs
parent8290ab531ce162a920da5d3c625889697ff65375 (diff)
parent7565e75591c2ef184bc7a359b3a436a62d45358a (diff)
downloadrust-4967fd24dec0b178e8766c0d5ce6146d2fd2c152.tar.gz
rust-4967fd24dec0b178e8766c0d5ce6146d2fd2c152.zip
Merge pull request #2461 from rust-lang/rustc-pull
Rustc pull update
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/builder.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index 167678c2ff1..ec006b59192 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -1815,8 +1815,11 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
             let typeid_metadata = self.cx.typeid_metadata(typeid).unwrap();
             let dbg_loc = self.get_dbg_loc();
 
-            // Test whether the function pointer is associated with the type identifier.
-            let cond = self.type_test(llfn, typeid_metadata);
+            // Test whether the function pointer is associated with the type identifier using the
+            // llvm.type.test intrinsic. The LowerTypeTests link-time optimization pass replaces
+            // calls to this intrinsic with code to test type membership.
+            let typeid = self.get_metadata_value(typeid_metadata);
+            let cond = self.call_intrinsic("llvm.type.test", &[llfn, typeid]);
             let bb_pass = self.append_sibling_block("type_test.pass");
             let bb_fail = self.append_sibling_block("type_test.fail");
             self.cond_br(cond, bb_pass, bb_fail);