[flang-commits] [flang] 67e19e5 - [flang] Set isSigned=true for negative constant (NFC)

Nikita Popov via flang-commits flang-commits at lists.llvm.org
Thu Sep 5 06:25:30 PDT 2024


Author: Nikita Popov
Date: 2024-09-05T15:25:05+02:00
New Revision: 67e19e5bb11d8ed2f1b5a0b8145331c8bf4522e9

URL: https://github.com/llvm/llvm-project/commit/67e19e5bb11d8ed2f1b5a0b8145331c8bf4522e9
DIFF: https://github.com/llvm/llvm-project/commit/67e19e5bb11d8ed2f1b5a0b8145331c8bf4522e9.diff

LOG: [flang] Set isSigned=true for negative constant (NFC)

We're providing this as a negative signed value, so set the flag.
Currently doesn't make a difference, but will assert in the future.

Split out of https://github.com/llvm/llvm-project/pull/80309.

Added: 
    

Modified: 
    flang/lib/Optimizer/CodeGen/CodeGen.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index eb91969236ae0b..ac521ae95df39c 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -1262,7 +1262,7 @@ struct EmboxCommonConversion : public fir::FIROpConversion<OP> {
       } else {
         auto maskAttr = mlir::IntegerAttr::get(
             rewriter.getIntegerType(8, /*isSigned=*/false),
-            llvm::APInt(8, (uint64_t)~_CFI_ADDENDUM_FLAG, /*isSigned=*/false));
+            llvm::APInt(8, (uint64_t)~_CFI_ADDENDUM_FLAG, /*isSigned=*/true));
         mlir::LLVM::ConstantOp mask = rewriter.create<mlir::LLVM::ConstantOp>(
             loc, rewriter.getI8Type(), maskAttr);
         extraField = rewriter.create<mlir::LLVM::AndOp>(loc, extraField, mask);


        


More information about the flang-commits mailing list