@@ -908,10 +908,19 @@ impl<'ll> CodegenCx<'ll, '_> {
908908 ifn ! ( "llvm.lifetime.start.p0i8" , fn ( t_i64, ptr) -> void) ;
909909 ifn ! ( "llvm.lifetime.end.p0i8" , fn ( t_i64, ptr) -> void) ;
910910
911- // Defining only the `ptr` variant of this overloaded intrinsic means
912- // we can call this on any type we want (that doesn't ICE), but at the
913- // slight cost of needing to write `addr_of!` everywhere.
914- ifn ! ( "llvm.is.constant.ptr" , fn ( ptr) -> i1) ;
911+ // FIXME: This is an infinitesimally small portion of the types you can
912+ // pass to this intrinsic, if we can ever lazily register intrinsics we
913+ // should register these when they're used, that way any type can be
914+ // passed.
915+ ifn ! ( "llvm.is.constant.i1" , fn ( i1) -> i1) ;
916+ ifn ! ( "llvm.is.constant.i8" , fn ( t_i8) -> i1) ;
917+ ifn ! ( "llvm.is.constant.i16" , fn ( t_i16) -> i1) ;
918+ ifn ! ( "llvm.is.constant.i32" , fn ( t_i32) -> i1) ;
919+ ifn ! ( "llvm.is.constant.i64" , fn ( t_i64) -> i1) ;
920+ ifn ! ( "llvm.is.constant.i128" , fn ( t_i128) -> i1) ;
921+ ifn ! ( "llvm.is.constant.isize" , fn ( t_isize) -> i1) ;
922+ ifn ! ( "llvm.is.constant.f32" , fn ( t_f32) -> i1) ;
923+ ifn ! ( "llvm.is.constant.f64" , fn ( t_f64) -> i1) ;
915924
916925 ifn ! ( "llvm.expect.i1" , fn ( i1, i1) -> i1) ;
917926 ifn ! ( "llvm.eh.typeid.for" , fn ( ptr) -> t_i32) ;
0 commit comments