[flang-commits] [flang] [flang] Use i16 instead of i2 for cmdstat (PR #91647)
Razvan Lupusoru via flang-commits
flang-commits at lists.llvm.org
Thu May 9 12:39:36 PDT 2024
https://github.com/razvanlupusoru created https://github.com/llvm/llvm-project/pull/91647
The code for preparing cmdstat was generating an i2 constant with value 0, casting it, and then storing it into i16 storage. Just generate i16 constant directly.
>From d1c2b0f9d396485e3215098474829de7214ce3db Mon Sep 17 00:00:00 2001
From: Razvan Lupusoru <rlupusoru at nvidia.com>
Date: Thu, 9 May 2024 12:36:53 -0700
Subject: [PATCH] [flang] Use i16 instead of i2 for cmdstat
The code for preparing cmdstat was generating an i2 constant with
value 0, casting it, and then storing it into i16 storage. Just
generate i16 constant directly.
---
flang/lib/Optimizer/Builder/IntrinsicCall.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index 9d72e76e2369d..dcbbc39b84eaa 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -6306,11 +6306,9 @@ void IntrinsicLibrary::genSystem(llvm::ArrayRef<fir::ExtendedValue> args) {
// Create a dummmy cmdstat to prevent EXECUTE_COMMAND_LINE terminate itself
// when cmdstat is assigned with a non-zero value but not present
mlir::Value tempValue =
- builder.createIntegerConstant(loc, builder.getI2Type(), 0);
+ builder.createIntegerConstant(loc, builder.getI16Type(), 0);
mlir::Value temp = builder.createTemporary(loc, builder.getI16Type());
- mlir::Value castVal =
- builder.createConvert(loc, builder.getI16Type(), tempValue);
- builder.create<fir::StoreOp>(loc, castVal, temp);
+ builder.create<fir::StoreOp>(loc, tempValue, temp);
mlir::Value cmdstatBox = builder.createBox(loc, temp);
mlir::Value cmdmsgBox =
More information about the flang-commits
mailing list