Skip to content

Commit f9d718f

Browse files
committed
codegen: align funclet stubs and likely handling notes
1 parent 12c5bb4 commit f9d718f

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,9 +1825,8 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
18251825
self.declare_func_local_var(self.type_array(self.type_i8(), size.bytes()), align)
18261826
}
18271827

1828-
fn scalable_alloca(&mut self, elt: u64, align: Align, element_ty: Ty<'_>) -> Self::Value {
1829-
let _ = (elt, align, element_ty);
1830-
self.fatal("scalable alloca is not supported in SPIR-V backend")
1828+
fn scalable_alloca(&mut self, _elt: u64, _align: Align, _element_ty: Ty<'_>) -> Self::Value {
1829+
bug!("scalable alloca is not supported in SPIR-V backend")
18311830
}
18321831

18331832
fn load(&mut self, ty: Self::Type, ptr: Self::Value, _align: Align) -> Self::Value {
@@ -3062,15 +3061,15 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
30623061
_parent: Option<Self::Value>,
30633062
_args: &[Self::Value],
30643063
) -> Self::Funclet {
3065-
todo!()
3064+
bug!("Funclets are not supported")
30663065
}
30673066

30683067
fn cleanup_ret(&mut self, _funclet: &Self::Funclet, _unwind: Option<Self::BasicBlock>) {
3069-
todo!()
3068+
bug!("Funclets are not supported")
30703069
}
30713070

30723071
fn catch_pad(&mut self, _parent: Self::Value, _args: &[Self::Value]) -> Self::Funclet {
3073-
todo!()
3072+
bug!("Funclets are not supported")
30743073
}
30753074

30763075
fn catch_switch(
@@ -3079,7 +3078,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
30793078
_unwind: Option<Self::BasicBlock>,
30803079
_handlers: &[Self::BasicBlock],
30813080
) -> Self::Value {
3082-
todo!()
3081+
bug!("Funclets are not supported")
30833082
}
30843083

30853084
fn get_funclet_cleanuppad(&self, _funclet: &Self::Funclet) -> Self::Value {

crates/rustc_codegen_spirv/src/builder/intrinsics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ impl<'a, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'tcx> {
8383
let ret_ty = self.layout_of(sig.output()).spirv_type(self.span(), self);
8484

8585
let value = match name {
86-
_ if name == sym::unlikely || name.as_str() == "likely" => {
87-
// Ignore these for now.
88-
args[0].immediate()
89-
}
86+
// `sym::likely` no longer exists on newer rustc nightlies, but
87+
// the intrinsic name is still `"likely"` in MIR. Ignore both branch
88+
// hint intrinsics for now.
89+
_ if name == sym::unlikely || name.as_str() == "likely" => args[0].immediate(),
9090

9191
sym::breakpoint => {
9292
self.abort();

0 commit comments

Comments
 (0)