Skip to content

Commit

Permalink
Feat: update nightly to 2021-12-04 in anticipation for 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RDambrosio016 committed Dec 5, 2021
1 parent 93d9057 commit c0059c3
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 180 deletions.
8 changes: 7 additions & 1 deletion crates/cuda_std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@
#![cfg_attr(
target_os = "cuda",
no_std,
feature(register_attr, alloc_error_handler, asm, link_llvm_intrinsics),
feature(
register_attr,
alloc_error_handler,
asm,
asm_experimental_arch,
link_llvm_intrinsics
),
register_attr(nvvm_internal)
)]

Expand Down
18 changes: 6 additions & 12 deletions crates/rustc_codegen_nvvm/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,7 @@ impl LlvmType for CastTarget {
let mut args: Vec<_> = self
.prefix
.iter()
.flat_map(|option_kind| {
option_kind.map(|kind| {
Reg {
kind,
size: self.prefix_chunk_size,
}
.llvm_type(cx)
})
})
.flat_map(|option_reg| option_reg.map(|reg| reg.llvm_type(cx)))
.chain((0..rest_count).map(|_| rest_ll_unit))
.collect();

Expand Down Expand Up @@ -538,16 +530,18 @@ impl<'a, 'll, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
fn_abi.apply_attrs_callsite(self, callsite)
}

fn get_param(&self, index: usize) -> Self::Value {
fn get_param(&mut self, index: usize) -> Self::Value {
let val = llvm::get_param(self.llfn(), index as c_uint);
trace!("Get param `{:?}`", val);
unsafe {
let llfnty = LLVMRustGetFunctionType(self.llfn());
let map = self.remapped_integer_args.borrow();
// destructure so rustc doesnt complain in the call to transmute_llval
let Self { cx, llbuilder } = self;
let map = cx.remapped_integer_args.borrow();
if let Some((_, key)) = map.get(llfnty) {
if let Some((_, new_ty)) = key.iter().find(|t| t.0 == index) {
trace!("Casting irregular param {:?} to {:?}", val, new_ty);
return transmute_llval(*self.llbuilder.lock().unwrap(), self.cx, val, *new_ty);
return transmute_llval(llbuilder, cx, val, *new_ty);
}
}
val
Expand Down
3 changes: 2 additions & 1 deletion crates/rustc_codegen_nvvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rustc_codegen_ssa::{
};
use rustc_hash::FxHashMap;
use rustc_hir::LlvmInlineAsmInner;
use rustc_middle::span_bug;
use rustc_middle::{span_bug, ty::Instance};
use rustc_span::{Pos, Span};
use rustc_target::asm::{InlineAsmRegClass, InlineAsmRegOrRegClass, NvptxInlineAsmRegClass};

Expand Down Expand Up @@ -118,6 +118,7 @@ impl<'a, 'll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
operands: &[InlineAsmOperandRef<'tcx, Self>],
options: rustc_ast::InlineAsmOptions,
line_spans: &[Span],
_inst: Instance,
) {
// Collect the types of output operands
let mut constraints = vec![];
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_nvvm/src/back.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol) -> (ModuleCodegen
tcx,
cgu_name,
module_codegen,
dep_graph::hash_result,
Some(dep_graph::hash_result),
);

fn module_codegen(tcx: TyCtxt<'_>, cgu_name: Symbol) -> ModuleCodegen<LlvmMod> {
Expand Down
Loading

0 comments on commit c0059c3

Please sign in to comment.