Skip to content

Commit 5446525

Browse files
authored
Merge branch 'main' into hgh/libcxx/P2255R2-A_type_trait_to_detect_reference_binding_to_temporary
2 parents 8cf7d8a + c11e3da commit 5446525

File tree

15 files changed

+51
-91
lines changed

15 files changed

+51
-91
lines changed

llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,11 @@ llvm::createAArch64AsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS,
549549
return new AArch64TargetAsmStreamer(S, OS);
550550
}
551551

552-
MCELFStreamer *
553-
llvm::createAArch64ELFStreamer(MCContext &Context,
554-
std::unique_ptr<MCAsmBackend> TAB,
555-
std::unique_ptr<MCObjectWriter> OW,
556-
std::unique_ptr<MCCodeEmitter> Emitter) {
557-
AArch64ELFStreamer *S = new AArch64ELFStreamer(
558-
Context, std::move(TAB), std::move(OW), std::move(Emitter));
559-
return S;
552+
MCStreamer *
553+
llvm::createAArch64ELFStreamer(const Triple &, MCContext &Context,
554+
std::unique_ptr<MCAsmBackend> &&TAB,
555+
std::unique_ptr<MCObjectWriter> &&OW,
556+
std::unique_ptr<MCCodeEmitter> &&Emitter) {
557+
return new AArch64ELFStreamer(Context, std::move(TAB), std::move(OW),
558+
std::move(Emitter));
560559
}

llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
namespace llvm {
1919

20-
MCELFStreamer *createAArch64ELFStreamer(MCContext &Context,
21-
std::unique_ptr<MCAsmBackend> TAB,
22-
std::unique_ptr<MCObjectWriter> OW,
23-
std::unique_ptr<MCCodeEmitter> Emitter);
20+
MCStreamer *createAArch64ELFStreamer(const Triple &, MCContext &Context,
21+
std::unique_ptr<MCAsmBackend> &&TAB,
22+
std::unique_ptr<MCObjectWriter> &&OW,
23+
std::unique_ptr<MCCodeEmitter> &&Emitter);
2424
}
2525

2626
#endif

llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,6 @@ static MCInstPrinter *createAArch64MCInstPrinter(const Triple &T,
378378
return nullptr;
379379
}
380380

381-
static MCStreamer *createELFStreamer(const Triple &T, MCContext &Ctx,
382-
std::unique_ptr<MCAsmBackend> &&TAB,
383-
std::unique_ptr<MCObjectWriter> &&OW,
384-
std::unique_ptr<MCCodeEmitter> &&Emitter) {
385-
return createAArch64ELFStreamer(Ctx, std::move(TAB), std::move(OW),
386-
std::move(Emitter));
387-
}
388-
389381
static MCStreamer *
390382
createMachOStreamer(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
391383
std::unique_ptr<MCObjectWriter> &&OW,
@@ -395,14 +387,6 @@ createMachOStreamer(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
395387
/*LabelSections*/ true);
396388
}
397389

398-
static MCStreamer *
399-
createWinCOFFStreamer(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
400-
std::unique_ptr<MCObjectWriter> &&OW,
401-
std::unique_ptr<MCCodeEmitter> &&Emitter) {
402-
return createAArch64WinCOFFStreamer(Ctx, std::move(TAB), std::move(OW),
403-
std::move(Emitter));
404-
}
405-
406390
namespace {
407391

408392
class AArch64MCInstrAnalysis : public MCInstrAnalysis {
@@ -542,9 +526,9 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64TargetMC() {
542526
TargetRegistry::RegisterMCCodeEmitter(*T, createAArch64MCCodeEmitter);
543527

544528
// Register the obj streamers.
545-
TargetRegistry::RegisterELFStreamer(*T, createELFStreamer);
529+
TargetRegistry::RegisterELFStreamer(*T, createAArch64ELFStreamer);
546530
TargetRegistry::RegisterMachOStreamer(*T, createMachOStreamer);
547-
TargetRegistry::RegisterCOFFStreamer(*T, createWinCOFFStreamer);
531+
TargetRegistry::RegisterCOFFStreamer(*T, createAArch64WinCOFFStreamer);
548532

549533
// Register the obj target streamer.
550534
TargetRegistry::RegisterObjectTargetStreamer(

llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ void AArch64TargetWinCOFFStreamer::emitARM64WinCFISaveAnyRegQPX(unsigned Reg,
284284
emitARM64WinUnwindCode(Win64EH::UOP_SaveAnyRegQPX, Reg, Offset);
285285
}
286286

287-
MCWinCOFFStreamer *
287+
MCStreamer *
288288
llvm::createAArch64WinCOFFStreamer(MCContext &Context,
289-
std::unique_ptr<MCAsmBackend> MAB,
290-
std::unique_ptr<MCObjectWriter> OW,
291-
std::unique_ptr<MCCodeEmitter> Emitter) {
289+
std::unique_ptr<MCAsmBackend> &&MAB,
290+
std::unique_ptr<MCObjectWriter> &&OW,
291+
std::unique_ptr<MCCodeEmitter> &&Emitter) {
292292
return new AArch64WinCOFFStreamer(Context, std::move(MAB), std::move(Emitter),
293293
std::move(OW));
294294
}

llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818

1919
namespace llvm {
2020

21-
MCWinCOFFStreamer *createAArch64WinCOFFStreamer(
22-
MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
23-
std::unique_ptr<MCObjectWriter> OW, std::unique_ptr<MCCodeEmitter> Emitter);
21+
MCStreamer *
22+
createAArch64WinCOFFStreamer(MCContext &Context,
23+
std::unique_ptr<MCAsmBackend> &&TAB,
24+
std::unique_ptr<MCObjectWriter> &&OW,
25+
std::unique_ptr<MCCodeEmitter> &&Emitter);
2426
} // end llvm namespace
2527

2628
#endif

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ InstructionCost RISCVTTIImpl::getIntImmCostInst(unsigned Opcode, unsigned Idx,
207207
if (Imm == UINT64_C(0xffff) && ST->hasStdExtZbb())
208208
return TTI::TCC_Free;
209209
// zext.w
210-
if (Imm == UINT64_C(0xffffffff) && ST->hasStdExtZba())
210+
if (Imm == UINT64_C(0xffffffff) &&
211+
((ST->hasStdExtZba() && ST->isRV64()) || ST->isRV32()))
211212
return TTI::TCC_Free;
212213
// bclri
213214
if (ST->hasStdExtZbs() && (~Imm).isPowerOf2())

llvm/test/Transforms/ConstantHoisting/RISCV/immediates.ll

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: opt -mtriple=riscv32-unknown-elf -S -passes=consthoist < %s | FileCheck %s
2-
; RUN: opt -mtriple=riscv64-unknown-elf -S -passes=consthoist < %s | FileCheck %s
1+
; RUN: opt -mtriple=riscv32-unknown-elf -S -passes=consthoist < %s | FileCheck %s -check-prefixes=CHECK,RV32I
2+
; RUN: opt -mtriple=riscv64-unknown-elf -S -passes=consthoist < %s | FileCheck %s -check-prefixes=CHECK,RV64I
33

44
; Check that we don't hoist immediates with small values.
55
define i64 @test1(i64 %a) nounwind {
@@ -55,16 +55,21 @@ define i32 @test6(i32 %a) nounwind "target-features"="+zbb" {
5555
ret i32 %2
5656
}
5757

58-
; Check that we hoist zext.w without Zba.
58+
; Check that we hoist zext.w without Zba on RV64.
59+
; Check that we don't hoist on RV32.
5960
define i64 @test7(i64 %a) nounwind {
60-
; CHECK-LABEL: test7
61-
; CHECK: %const = bitcast i64 4294967295 to i64
61+
; RV32I-LABEL: test7
62+
; RV32I: and i64 %a, 4294967295
63+
64+
; RV64I-LABEL: test7
65+
; RV64I: %const = bitcast i64 4294967295 to i64
6266
%1 = and i64 %a, 4294967295
6367
%2 = and i64 %1, 4294967295
6468
ret i64 %2
6569
}
6670

67-
; Check that we don't hoist zext.w with Zba.
71+
; Check that we don't hoist zext.w with Zba on RV64.
72+
; Check that we don't hoist on RV32.
6873
define i64 @test8(i64 %a) nounwind "target-features"="+zba" {
6974
; CHECK-LABEL: test8
7075
; CHECK: and i64 %a, 4294967295

mlir/include/mlir/Dialect/MLProgram/Transforms/Passes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ namespace ml_program {
2323
// Registration
2424
//===----------------------------------------------------------------------===//
2525

26-
std::unique_ptr<OperationPass<ModuleOp>> createMLProgramPipelineGlobalsPass();
27-
2826
/// Generate the code for registering passes.
2927
#define GEN_PASS_REGISTRATION
3028
#include "mlir/Dialect/MLProgram/Transforms/Passes.h.inc"

mlir/include/mlir/Dialect/MLProgram/Transforms/Passes.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
include "mlir/Pass/PassBase.td"
1313

14-
def MLProgramPipelineGlobals : Pass<"mlprogram-pipeline-globals", "ModuleOp"> {
14+
def MLProgramPipelineGlobalsPass
15+
: Pass<"mlprogram-pipeline-globals", "ModuleOp"> {
1516
let summary = "Optimize `ml_program` global operations for read and store";
1617
let description = [{
1718
`ml_program`'s load and store operations can be optimized for
@@ -21,7 +22,6 @@ def MLProgramPipelineGlobals : Pass<"mlprogram-pipeline-globals", "ModuleOp"> {
2122
The pass is designed to handle both nested regions and function calls
2223
safely.
2324
}];
24-
let constructor = "mlir::ml_program::createMLProgramPipelineGlobalsPass()";
2525
}
2626

2727
#endif // MLIR_DIALECT_MLPROGRAM_TRANSFORMS_PASSES

mlir/include/mlir/Dialect/Shape/Transforms/Passes.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ namespace mlir {
3030
#define GEN_PASS_DECL
3131
#include "mlir/Dialect/Shape/Transforms/Passes.h.inc"
3232

33-
/// Creates an instance of the ShapeToShapeLowering pass that legalizes Shape
34-
/// dialect to be convertible to Arith. For example, `shape.num_elements` get
35-
/// transformed to `shape.reduce`, which can be lowered to SCF and Arith.
36-
std::unique_ptr<Pass> createShapeToShapeLowering();
37-
3833
/// Collects a set of patterns to rewrite ops within the Shape dialect.
3934
void populateShapeRewritePatterns(RewritePatternSet &patterns);
4035

@@ -45,11 +40,6 @@ void populateShapeRewritePatterns(RewritePatternSet &patterns);
4540
//
4641
// After this pass, no cstr_ operations exist.
4742
void populateRemoveShapeConstraintsPatterns(RewritePatternSet &patterns);
48-
std::unique_ptr<OperationPass<func::FuncOp>> createRemoveShapeConstraintsPass();
49-
50-
/// Outline the shape computation part by adding shape.func and populate
51-
/// conrresponding mapping infomation into ShapeMappingAnalysis.
52-
std::unique_ptr<OperationPass<ModuleOp>> createOutlineShapeComputationPass();
5343

5444
//===----------------------------------------------------------------------===//
5545
// Registration

0 commit comments

Comments
 (0)