From 0c69f272033088d47402a0f082b0780ce403df31 Mon Sep 17 00:00:00 2001 From: Peter Steinfeld Date: Thu, 22 Jul 2021 12:59:43 -0700 Subject: [PATCH] [flang] Remove an unneeded call to createBox In processing the UNPACK intrinsic, my implementation had an unneeded extra call to createBox(). This change removes it. --- flang/lib/Lower/IntrinsicCall.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flang/lib/Lower/IntrinsicCall.cpp b/flang/lib/Lower/IntrinsicCall.cpp index 65c2fd587ee15..df05436993f7c 100644 --- a/flang/lib/Lower/IntrinsicCall.cpp +++ b/flang/lib/Lower/IntrinsicCall.cpp @@ -2977,9 +2977,9 @@ IntrinsicLibrary::genUnpack(mlir::Type resultType, fir::BoxValue vectorTmp = builder.createBox(loc, args[0]); // Handle required mask argument - auto mask = builder.createBox(loc, args[1]); - fir::BoxValue maskTmp = builder.createBox(loc, args[1]); - auto maskRank = maskTmp.rank(); + fir::BoxValue maskBox = builder.createBox(loc, args[1]); + auto mask = fir::getBase(maskBox); + auto maskRank = maskBox.rank(); // Handle required field argument auto field = builder.createBox(loc, args[2]);