@@ -56,20 +56,19 @@ TritonGPUTypeConverter::TritonGPUTypeConverter(MLIRContext *context,
5656 // This will create newArg, and map(origArg, newArg)
5757 addArgumentMaterialization ([&](OpBuilder &builder,
5858 RankedTensorType tensorType, ValueRange inputs,
59- Location loc) -> std::optional< Value> {
59+ Location loc) -> Value {
6060 llvm_unreachable (" Argument rematerialization should not happen in Triton "
6161 " -> TritonGPU conversion" );
62- return std:: nullopt ;
62+ return {} ;
6363 });
6464
6565 // If the origValue still has live user(s), use this to
6666 // convert origValue to newValue
6767 addSourceMaterialization ([&](OpBuilder &builder, RankedTensorType tensorType,
68- ValueRange inputs,
69- Location loc) -> std::optional<Value> {
68+ ValueRange inputs, Location loc) -> Value {
7069 llvm_unreachable (" Source rematerialization should not happen in Triton -> "
7170 " TritonGPU Conversion" );
72- return std:: nullopt ;
71+ return {} ;
7372 });
7473
7574 // This will be called when (desiredType != newOperandType)
@@ -79,7 +78,7 @@ TritonGPUTypeConverter::TritonGPUTypeConverter(MLIRContext *context,
7978 ValueRange inputs, Location loc) {
8079 auto cast =
8180 builder.create <triton::gpu::ConvertLayoutOp>(loc, tensorType, inputs);
82- return std::optional<Value>( cast.getResult () );
81+ return cast.getResult ();
8382 });
8483}
8584
0 commit comments