Skip to content

Commit 19e1502

Browse files
committed
[rebase] apply fir-dev formatting changes lost in rebase
1 parent d67ef8c commit 19e1502

File tree

6 files changed

+196
-198
lines changed

6 files changed

+196
-198
lines changed

flang/include/flang/Optimizer/Analysis/IteratedDominanceFrontier.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,31 @@ namespace fir {
4545
template <class NodeTy, bool IsPostDom>
4646
class IDFCalculator {
4747
public:
48-
IDFCalculator(mlir::DominanceInfo &DT) : DT(DT), useLiveIn(false) {}
48+
IDFCalculator(mlir::DominanceInfo &dt) : dt(dt), useLiveIn(false) {}
4949

5050
/// Give the IDF calculator the set of blocks in which the value is
5151
/// defined. This is equivalent to the set of starting blocks it should be
5252
/// calculating the IDF for (though later gets pruned based on liveness).
5353
///
5454
/// Note: This set *must* live for the entire lifetime of the IDF calculator.
55-
void setDefiningBlocks(const llvm::SmallPtrSetImpl<NodeTy *> &Blocks) {
56-
DefBlocks = &Blocks;
55+
void setDefiningBlocks(const llvm::SmallPtrSetImpl<NodeTy *> &blocks) {
56+
defBlocks = &blocks;
5757
}
5858

5959
/// Give the IDF calculator the set of blocks in which the value is
6060
/// live on entry to the block. This is used to prune the IDF calculation to
6161
/// not include blocks where any phi insertion would be dead.
6262
///
6363
/// Note: This set *must* live for the entire lifetime of the IDF calculator.
64-
void setLiveInBlocks(const llvm::SmallPtrSetImpl<NodeTy *> &Blocks) {
65-
LiveInBlocks = &Blocks;
64+
void setLiveInBlocks(const llvm::SmallPtrSetImpl<NodeTy *> &blocks) {
65+
liveInBlocks = &blocks;
6666
useLiveIn = true;
6767
}
6868

6969
/// Reset the live-in block set to be empty, and tell the IDF
7070
/// calculator to not use liveness anymore.
7171
void resetLiveInBlocks() {
72-
LiveInBlocks = nullptr;
72+
liveInBlocks = nullptr;
7373
useLiveIn = false;
7474
}
7575

@@ -79,13 +79,13 @@ class IDFCalculator {
7979
/// the file-level comment. It performs DF->IDF pruning using the live-in
8080
/// set, to avoid computing the IDF for blocks where an inserted PHI node
8181
/// would be dead.
82-
void calculate(llvm::SmallVectorImpl<NodeTy *> &IDFBlocks);
82+
void calculate(llvm::SmallVectorImpl<NodeTy *> &idfBlocks);
8383

8484
private:
85-
mlir::DominanceInfo &DT;
85+
mlir::DominanceInfo &dt;
8686
bool useLiveIn;
87-
const llvm::SmallPtrSetImpl<NodeTy *> *LiveInBlocks;
88-
const llvm::SmallPtrSetImpl<NodeTy *> *DefBlocks;
87+
const llvm::SmallPtrSetImpl<NodeTy *> *liveInBlocks;
88+
const llvm::SmallPtrSetImpl<NodeTy *> *defBlocks;
8989
};
9090

9191
typedef IDFCalculator<mlir::Block, false> ForwardIDFCalculator;

flang/include/flang/Optimizer/Builder/BoxValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ class ExtendedValue : public details::matcher<ExtendedValue> {
413413
template <typename A, typename = std::enable_if_t<
414414
!std::is_same_v<std::decay_t<A>, ExtendedValue>>>
415415
constexpr ExtendedValue(A &&a) : box{std::forward<A>(a)} {
416-
if (auto b = getUnboxed()) {
416+
if (const auto *b = getUnboxed()) {
417417
if (*b) {
418418
auto type = b->getType();
419419
if (type.template isa<fir::BoxCharType>())

flang/include/flang/Optimizer/CodeGen/CodeGen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ using LLVMIRLoweringPrinter =
4444
std::unique_ptr<mlir::Pass> createLLVMDialectToLLVMPass(
4545
llvm::raw_ostream &output,
4646
LLVMIRLoweringPrinter printer =
47-
[](llvm::Module &M, llvm::raw_ostream &out) { M.print(out, nullptr); });
47+
[](llvm::Module &m, llvm::raw_ostream &out) { m.print(out, nullptr); });
4848

4949
// declarative passes
5050
#define GEN_PASS_REGISTRATION

flang/lib/Optimizer/Builder/FIRBuilder.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,21 @@ mlir::Value
9292
fir::FirOpBuilder::createRealConstant(mlir::Location loc, mlir::Type fltTy,
9393
llvm::APFloat::integerPart val) {
9494
auto apf = [&]() -> llvm::APFloat {
95-
if (auto ty = fltTy.dyn_cast<fir::RealType>()) {
95+
if (auto ty = fltTy.dyn_cast<fir::RealType>())
9696
return llvm::APFloat(kindMap.getFloatSemantics(ty.getFKind()), val);
97-
} else {
98-
if (fltTy.isF16())
99-
return llvm::APFloat(llvm::APFloat::IEEEhalf(), val);
100-
if (fltTy.isBF16())
101-
return llvm::APFloat(llvm::APFloat::BFloat(), val);
102-
if (fltTy.isF32())
103-
return llvm::APFloat(llvm::APFloat::IEEEsingle(), val);
104-
if (fltTy.isF64())
105-
return llvm::APFloat(llvm::APFloat::IEEEdouble(), val);
106-
if (fltTy.isF80())
107-
return llvm::APFloat(llvm::APFloat::x87DoubleExtended(), val);
108-
if (fltTy.isF128())
109-
return llvm::APFloat(llvm::APFloat::IEEEquad(), val);
110-
llvm_unreachable("unhandled MLIR floating-point type");
111-
}
97+
if (fltTy.isF16())
98+
return llvm::APFloat(llvm::APFloat::IEEEhalf(), val);
99+
if (fltTy.isBF16())
100+
return llvm::APFloat(llvm::APFloat::BFloat(), val);
101+
if (fltTy.isF32())
102+
return llvm::APFloat(llvm::APFloat::IEEEsingle(), val);
103+
if (fltTy.isF64())
104+
return llvm::APFloat(llvm::APFloat::IEEEdouble(), val);
105+
if (fltTy.isF80())
106+
return llvm::APFloat(llvm::APFloat::x87DoubleExtended(), val);
107+
if (fltTy.isF128())
108+
return llvm::APFloat(llvm::APFloat::IEEEquad(), val);
109+
llvm_unreachable("unhandled MLIR floating-point type");
112110
};
113111
return createRealConstant(loc, fltTy, apf());
114112
}

flang/lib/Optimizer/Dialect/FIRAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include "flang/Optimizer/Dialect/FIRDialect.h"
1515
#include "flang/Optimizer/Support/KindMapping.h"
1616
#include "mlir/IR/AttributeSupport.h"
17-
#include "mlir/IR/DialectImplementation.h"
1817
#include "mlir/IR/BuiltinTypes.h"
18+
#include "mlir/IR/DialectImplementation.h"
1919
#include "llvm/ADT/SmallString.h"
2020

2121
using namespace fir;

0 commit comments

Comments
 (0)