Skip to content

Commit dc4d578

Browse files
committed
foramt
Created using spr 1.3.4
2 parents a1558db + a4e87da commit dc4d578

File tree

25 files changed

+907
-399
lines changed

25 files changed

+907
-399
lines changed

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,12 @@ class BinaryContext {
13631363
if (std::optional<uint32_t> Size = MIB->getSize(Inst))
13641364
return *Size;
13651365

1366+
if (MIB->isPseudo(Inst))
1367+
return 0;
1368+
1369+
if (std::optional<uint32_t> Size = MIB->getInstructionSize(Inst))
1370+
return *Size;
1371+
13661372
if (!Emitter)
13671373
Emitter = this->MCE.get();
13681374
SmallString<256> Code;

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,11 @@ class MCPlusBuilder {
12041204
/// Get instruction size specified via annotation.
12051205
std::optional<uint32_t> getSize(const MCInst &Inst) const;
12061206

1207+
/// Get target-specific instruction size.
1208+
virtual std::optional<uint32_t> getInstructionSize(const MCInst &Inst) const {
1209+
return std::nullopt;
1210+
}
1211+
12071212
/// Set instruction size.
12081213
void setSize(MCInst &Inst, uint32_t Size) const;
12091214

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,6 +1792,11 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
17921792
}
17931793

17941794
uint16_t getMinFunctionAlignment() const override { return 4; }
1795+
1796+
std::optional<uint32_t>
1797+
getInstructionSize(const MCInst &Inst) const override {
1798+
return 4;
1799+
}
17951800
};
17961801

17971802
} // end anonymous namespace

flang/include/flang/Optimizer/Builder/HLFIRTools.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,6 @@ genTypeAndKindConvert(mlir::Location loc, fir::FirOpBuilder &builder,
513513
Entity loadElementAt(mlir::Location loc, fir::FirOpBuilder &builder,
514514
Entity entity, mlir::ValueRange oneBasedIndices);
515515

516-
/// Return a vector of extents for the given entity.
517-
/// The function creates new operations, but tries to clean-up
518-
/// after itself.
519-
llvm::SmallVector<mlir::Value>
520-
genExtentsVector(mlir::Location loc, fir::FirOpBuilder &builder, Entity entity);
521-
522516
} // namespace hlfir
523517

524518
#endif // FORTRAN_OPTIMIZER_BUILDER_HLFIRTOOLS_H

flang/lib/Optimizer/Builder/HLFIRTools.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,15 +1421,3 @@ hlfir::Entity hlfir::loadElementAt(mlir::Location loc,
14211421
return loadTrivialScalar(loc, builder,
14221422
getElementAt(loc, builder, entity, oneBasedIndices));
14231423
}
1424-
1425-
llvm::SmallVector<mlir::Value>
1426-
hlfir::genExtentsVector(mlir::Location loc, fir::FirOpBuilder &builder,
1427-
hlfir::Entity entity) {
1428-
entity = hlfir::derefPointersAndAllocatables(loc, builder, entity);
1429-
mlir::Value shape = hlfir::genShape(loc, builder, entity);
1430-
llvm::SmallVector<mlir::Value, Fortran::common::maxRank> extents =
1431-
hlfir::getExplicitExtentsFromShape(shape, builder);
1432-
if (shape.getUses().empty())
1433-
shape.getDefiningOp()->erase();
1434-
return extents;
1435-
}

flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp

Lines changed: 115 additions & 164 deletions
Large diffs are not rendered by default.

flang/test/HLFIR/simplify-hlfir-intrinsics-dotproduct.fir

Lines changed: 0 additions & 144 deletions
This file was deleted.

libc/include/__llvm-libc-common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
#define _Thread_local thread_local
4040

4141
#undef __NOEXCEPT
42+
#if __cplusplus >= 201103L
4243
#define __NOEXCEPT noexcept
44+
#else
45+
#define __NOEXCEPT throw()
46+
#endif
4347

4448
#else // not __cplusplus
4549

libc/test/src/unistd/getopt_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct LlvmLibcGetoptTest : public LIBC_NAMESPACE::testing::Test {
7979

8080
// This is safe because getopt doesn't currently permute argv like GNU's getopt
8181
// does so this just helps silence warnings.
82-
char *operator"" _c(const char *c, size_t) { return const_cast<char *>(c); }
82+
char *operator""_c(const char *c, size_t) { return const_cast<char *>(c); }
8383

8484
TEST_F(LlvmLibcGetoptTest, NoMatch) {
8585
array<char *, 3> argv{"prog"_c, "arg1"_c, nullptr};

libc/utils/hdrgen/function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(
2222

2323
def __str__(self):
2424
attributes_str = " ".join(self.attributes)
25-
arguments_str = ", ".join(self.arguments)
25+
arguments_str = ", ".join(self.arguments) if self.arguments else "void"
2626
if attributes_str == "":
2727
result = f"{self.return_type} {self.name}({arguments_str})"
2828
else:

0 commit comments

Comments
 (0)