diff --git a/ptx/src/pass/insert_implicit_conversions2.rs b/ptx/src/pass/insert_implicit_conversions2.rs index 9f8b01c..5189664 100644 --- a/ptx/src/pass/insert_implicit_conversions2.rs +++ b/ptx/src/pass/insert_implicit_conversions2.rs @@ -138,10 +138,7 @@ pub(crate) fn default_implicit_conversion( } } if instruction_space != operand_space { - default_implicit_conversion_space( - (operand_space, operand_type), - (instruction_space, instruction_type), - ) + default_implicit_conversion_space((operand_space, operand_type), instruction_space) } else if instruction_type != operand_type { default_implicit_conversion_type(instruction_space, operand_type, instruction_type) } else { @@ -167,7 +164,7 @@ fn is_addressable(this: ast::StateSpace) -> bool { // Space is different fn default_implicit_conversion_space( (operand_space, operand_type): (ast::StateSpace, &ast::Type), - (instruction_space, instruction_type): (ast::StateSpace, &ast::Type), + instruction_space: ast::StateSpace, ) -> Result, TranslateError> { if (instruction_space == ast::StateSpace::Generic && coerces_to_generic(operand_space)) || (operand_space == ast::StateSpace::Generic && coerces_to_generic(instruction_space)) @@ -175,15 +172,6 @@ fn default_implicit_conversion_space( Ok(Some(ConversionKind::PtrToPtr)) } else if operand_space == ast::StateSpace::Reg { match operand_type { - ast::Type::Pointer(operand_ptr_type, operand_ptr_space) - if *operand_ptr_space == instruction_space => - { - if instruction_type != &ast::Type::Scalar(*operand_ptr_type) { - Ok(Some(ConversionKind::PtrToPtr)) - } else { - Ok(None) - } - } // TODO: 32 bit ast::Type::Scalar(ast::ScalarType::B64) | ast::Type::Scalar(ast::ScalarType::U64) @@ -205,19 +193,6 @@ fn default_implicit_conversion_space( }, _ => Err(error_mismatched_type()), } - } else if instruction_space == ast::StateSpace::Reg { - match instruction_type { - ast::Type::Pointer(instruction_ptr_type, instruction_ptr_space) - if operand_space == *instruction_ptr_space => - { - if operand_type != &ast::Type::Scalar(*instruction_ptr_type) { - Ok(Some(ConversionKind::PtrToPtr)) - } else { - Ok(None) - } - } - _ => Err(error_mismatched_type()), - } } else { Err(error_mismatched_type()) } diff --git a/ptx/src/pass/llvm/emit.rs b/ptx/src/pass/llvm/emit.rs index f7aafaa..e9226dc 100644 --- a/ptx/src/pass/llvm/emit.rs +++ b/ptx/src/pass/llvm/emit.rs @@ -2600,7 +2600,6 @@ fn get_type(context: LLVMContextRef, type_: &ast::Type) -> Result get_pointer_type(context, *space)?, }) } diff --git a/ptx_parser/src/ast.rs b/ptx_parser/src/ast.rs index 53c7fa5..dee15ce 100644 --- a/ptx_parser/src/ast.rs +++ b/ptx_parser/src/ast.rs @@ -831,7 +831,6 @@ pub enum Type { Vector(u8, ScalarType), // .param.b32 foo[4]; Array(Option, ScalarType, Vec), - Pointer(ScalarType, StateSpace), } impl Type { @@ -882,7 +881,6 @@ impl Type { ) } } - Type::Pointer(..) => Layout::new::(), } } }