From 6962cf1700c28d76882e188d8e401486fe051bd4 Mon Sep 17 00:00:00 2001 From: Frederik Harwath Date: Fri, 14 Mar 2025 13:11:45 +0100 Subject: [PATCH] Rename ExpandLargeFpConvertPass to ExpandFpPass (#131128) This is meant as a preparation for PR #130988 "[AMDGPU] Implement IR expansion for frem instruction" which implements the expansion of another instruction in this pass. The more general name seems more appropriate given this change and quite reasonable even without it. --- llvm/docs/WritingAnLLVMPass.rst | 2 +- .../{ExpandLargeFpConvert.h => ExpandFp.h} | 13 +++-- llvm/include/llvm/CodeGen/Passes.h | 2 +- llvm/include/llvm/CodeGen/TargetLowering.h | 13 ++--- llvm/include/llvm/InitializePasses.h | 2 +- llvm/include/llvm/Passes/CodeGenPassBuilder.h | 4 +- .../llvm/Passes/MachinePassRegistry.def | 2 +- llvm/lib/CodeGen/CMakeLists.txt | 2 +- llvm/lib/CodeGen/CodeGen.cpp | 2 +- ...{ExpandLargeFpConvert.cpp => ExpandFp.cpp} | 49 ++++++++++--------- llvm/lib/CodeGen/TargetPassConfig.cpp | 2 +- llvm/lib/Passes/PassBuilder.cpp | 2 +- llvm/lib/Passes/PassRegistry.def | 2 +- llvm/test/CodeGen/AArch64/O0-pipeline.ll | 2 +- llvm/test/CodeGen/AArch64/O3-pipeline.ll | 2 +- llvm/test/CodeGen/AMDGPU/itofp.i128.bf.ll | 2 +- llvm/test/CodeGen/AMDGPU/llc-pipeline.ll | 10 ++-- llvm/test/CodeGen/ARM/O3-pipeline.ll | 2 +- llvm/test/CodeGen/LoongArch/O0-pipeline.ll | 2 +- llvm/test/CodeGen/LoongArch/opt-pipeline.ll | 2 +- llvm/test/CodeGen/M68k/pipeline.ll | 2 +- llvm/test/CodeGen/PowerPC/O0-pipeline.ll | 2 +- llvm/test/CodeGen/PowerPC/O3-pipeline.ll | 2 +- llvm/test/CodeGen/RISCV/O0-pipeline.ll | 2 +- llvm/test/CodeGen/RISCV/O3-pipeline.ll | 2 +- llvm/test/CodeGen/X86/O0-pipeline.ll | 2 +- llvm/test/CodeGen/X86/opt-pipeline.ll | 2 +- .../X86/expand-large-fp-convert-fptosi129.ll | 4 +- .../X86/expand-large-fp-convert-fptoui129.ll | 4 +- .../X86/expand-large-fp-convert-si129tofp.ll | 4 +- .../X86/expand-large-fp-convert-ui129tofp.ll | 4 +- llvm/tools/opt/optdriver.cpp | 4 +- .../gn/secondary/llvm/lib/CodeGen/BUILD.gn | 2 +- 33 files changed, 78 insertions(+), 77 deletions(-) rename llvm/include/llvm/CodeGen/{ExpandLargeFpConvert.h => ExpandFp.h} (57%) rename llvm/lib/CodeGen/{ExpandLargeFpConvert.cpp => ExpandFp.cpp} (95%) diff --git a/llvm/docs/WritingAnLLVMPass.rst b/llvm/docs/WritingAnLLVMPass.rst index 31194e8b0389..484227bac38b 100644 --- a/llvm/docs/WritingAnLLVMPass.rst +++ b/llvm/docs/WritingAnLLVMPass.rst @@ -652,7 +652,7 @@ default optimization pipelines, e.g. (the output has been trimmed): Pre-ISel Intrinsic Lowering FunctionPass Manager Expand large div/rem - Expand large fp convert + Expand fp Expand Atomic instructions SVE intrinsics optimizations FunctionPass Manager diff --git a/llvm/include/llvm/CodeGen/ExpandLargeFpConvert.h b/llvm/include/llvm/CodeGen/ExpandFp.h similarity index 57% rename from llvm/include/llvm/CodeGen/ExpandLargeFpConvert.h rename to llvm/include/llvm/CodeGen/ExpandFp.h index 72e31f04209d..c13119a4238e 100644 --- a/llvm/include/llvm/CodeGen/ExpandLargeFpConvert.h +++ b/llvm/include/llvm/CodeGen/ExpandFp.h @@ -1,4 +1,4 @@ -//===- ExpandLargeFpConvert.h -----------------------------------*- C++ -*-===// +//===- ExpandFp.h -----------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CODEGEN_EXPANDLARGEFPCONVERT_H -#define LLVM_CODEGEN_EXPANDLARGEFPCONVERT_H +#ifndef LLVM_CODEGEN_EXPANDFP_H +#define LLVM_CODEGEN_EXPANDFP_H #include "llvm/IR/PassManager.h" @@ -15,17 +15,16 @@ namespace llvm { class TargetMachine; -class ExpandLargeFpConvertPass - : public PassInfoMixin { +class ExpandFpPass : public PassInfoMixin { private: const TargetMachine *TM; public: - explicit ExpandLargeFpConvertPass(const TargetMachine *TM_) : TM(TM_) {} + explicit ExpandFpPass(const TargetMachine *TM_) : TM(TM_) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); }; } // end namespace llvm -#endif // LLVM_CODEGEN_EXPANDLARGEFPCONVERT_H +#endif // LLVM_CODEGEN_EXPANDFP_H diff --git a/llvm/include/llvm/CodeGen/Passes.h b/llvm/include/llvm/CodeGen/Passes.h index dbd61d6b2b2a..e5cb028b25dd 100644 --- a/llvm/include/llvm/CodeGen/Passes.h +++ b/llvm/include/llvm/CodeGen/Passes.h @@ -529,7 +529,7 @@ namespace llvm { FunctionPass *createExpandLargeDivRemPass(); // Expands large div/rem instructions. - FunctionPass *createExpandLargeFpConvertPass(); + FunctionPass *createExpandFpPass(); // This pass expands memcmp() to load/stores. FunctionPass *createExpandMemCmpLegacyPass(); diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h index 051848b4acc3..a3fb4e9a8513 100644 --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -2148,8 +2148,8 @@ public: return MaxDivRemBitWidthSupported; } - /// Returns the size in bits of the maximum larget fp convert the backend - /// supports. Larger operations will be expanded by ExpandLargeFPConvert. + /// Returns the size in bits of the maximum fp to/from int conversion the + /// backend supports. Larger operations will be expanded by ExpandFp. unsigned getMaxLargeFPConvertBitWidthSupported() const { return MaxLargeFPConvertBitWidthSupported; } @@ -2782,8 +2782,8 @@ protected: MaxDivRemBitWidthSupported = SizeInBits; } - /// Set the size in bits of the maximum fp convert the backend supports. - /// Larger operations will be expanded by ExpandLargeFPConvert. + /// Set the size in bits of the maximum fp to/from int conversion the backend + /// supports. Larger operations will be expanded by ExpandFp. void setMaxLargeFPConvertBitWidthSupported(unsigned SizeInBits) { MaxLargeFPConvertBitWidthSupported = SizeInBits; } @@ -3580,8 +3580,9 @@ private: /// Larger operations will be expanded by ExpandLargeDivRem. unsigned MaxDivRemBitWidthSupported; - /// Size in bits of the maximum larget fp convert size the backend - /// supports. Larger operations will be expanded by ExpandLargeFPConvert. + /// Size in bits of the maximum fp to/from int conversion size the + /// backend supports. Larger operations will be expanded by + /// ExpandFp. unsigned MaxLargeFPConvertBitWidthSupported; /// Size in bits of the minimum cmpxchg or ll/sc operation the diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h index ab7e3a3144a9..47af3c1563dd 100644 --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -105,7 +105,7 @@ void initializeEarlyMachineLICMPass(PassRegistry &); void initializeEarlyTailDuplicateLegacyPass(PassRegistry &); void initializeEdgeBundlesWrapperLegacyPass(PassRegistry &); void initializeEHContGuardTargetsPass(PassRegistry &); -void initializeExpandLargeFpConvertLegacyPassPass(PassRegistry &); +void initializeExpandFpLegacyPassPass(PassRegistry &); void initializeExpandLargeDivRemLegacyPassPass(PassRegistry &); void initializeExpandMemCmpLegacyPassPass(PassRegistry &); void initializeExpandPostRALegacyPass(PassRegistry &); diff --git a/llvm/include/llvm/Passes/CodeGenPassBuilder.h b/llvm/include/llvm/Passes/CodeGenPassBuilder.h index f159f8772c90..85fac37bdc08 100644 --- a/llvm/include/llvm/Passes/CodeGenPassBuilder.h +++ b/llvm/include/llvm/Passes/CodeGenPassBuilder.h @@ -30,8 +30,8 @@ #include "llvm/CodeGen/DetectDeadLanes.h" #include "llvm/CodeGen/DwarfEHPrepare.h" #include "llvm/CodeGen/EarlyIfConversion.h" +#include "llvm/CodeGen/ExpandFp.h" #include "llvm/CodeGen/ExpandLargeDivRem.h" -#include "llvm/CodeGen/ExpandLargeFpConvert.h" #include "llvm/CodeGen/ExpandMemCmp.h" #include "llvm/CodeGen/ExpandPostRAPseudos.h" #include "llvm/CodeGen/ExpandReductions.h" @@ -663,7 +663,7 @@ void CodeGenPassBuilder::addISelPasses( addPass(PreISelIntrinsicLoweringPass(&TM)); addPass(ExpandLargeDivRemPass(&TM)); - addPass(ExpandLargeFpConvertPass(&TM)); + addPass(ExpandFpPass(&TM)); derived().addIRPasses(addPass); derived().addCodeGenPrepare(addPass); diff --git a/llvm/include/llvm/Passes/MachinePassRegistry.def b/llvm/include/llvm/Passes/MachinePassRegistry.def index 8aa0cfe152ca..d007e1e4e98f 100644 --- a/llvm/include/llvm/Passes/MachinePassRegistry.def +++ b/llvm/include/llvm/Passes/MachinePassRegistry.def @@ -52,7 +52,7 @@ FUNCTION_PASS("consthoist", ConstantHoistingPass()) FUNCTION_PASS("dwarf-eh-prepare", DwarfEHPreparePass(TM)) FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass(false)) FUNCTION_PASS("expand-large-div-rem", ExpandLargeDivRemPass(TM)) -FUNCTION_PASS("expand-large-fp-convert", ExpandLargeFpConvertPass(TM)) +FUNCTION_PASS("expand-fp", ExpandFpPass(TM)) FUNCTION_PASS("expand-memcmp", ExpandMemCmpPass(TM)) FUNCTION_PASS("expand-reductions", ExpandReductionsPass()) FUNCTION_PASS("gc-lowering", GCLoweringPass()) diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt index 0c92637a75e7..0e237ba31a8c 100644 --- a/llvm/lib/CodeGen/CMakeLists.txt +++ b/llvm/lib/CodeGen/CMakeLists.txt @@ -57,7 +57,7 @@ add_llvm_component_library(LLVMCodeGen EHContGuardTargets.cpp ExecutionDomainFix.cpp ExpandLargeDivRem.cpp - ExpandLargeFpConvert.cpp + ExpandFp.cpp ExpandMemCmp.cpp ExpandPostRAPseudos.cpp ExpandReductions.cpp diff --git a/llvm/lib/CodeGen/CodeGen.cpp b/llvm/lib/CodeGen/CodeGen.cpp index 53bd025529b0..531476a9db32 100644 --- a/llvm/lib/CodeGen/CodeGen.cpp +++ b/llvm/lib/CodeGen/CodeGen.cpp @@ -40,7 +40,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) { initializeEarlyMachineLICMPass(Registry); initializeEarlyTailDuplicateLegacyPass(Registry); initializeExpandLargeDivRemLegacyPassPass(Registry); - initializeExpandLargeFpConvertLegacyPassPass(Registry); + initializeExpandFpLegacyPassPass(Registry); initializeExpandMemCmpLegacyPassPass(Registry); initializeExpandPostRALegacyPass(Registry); initializeFEntryInserterPass(Registry); diff --git a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp b/llvm/lib/CodeGen/ExpandFp.cpp similarity index 95% rename from llvm/lib/CodeGen/ExpandLargeFpConvert.cpp rename to llvm/lib/CodeGen/ExpandFp.cpp index ee583a25214e..714ec55acb4f 100644 --- a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp +++ b/llvm/lib/CodeGen/ExpandFp.cpp @@ -1,20 +1,20 @@ -//===--- ExpandLargeFpConvert.cpp - Expand large fp convert----------------===// +//===--- ExpandFp.cpp - Expand fp instructions ----------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// +// This pass expands certain floating point instructions at the IR level. // - -// This pass expands ‘fptoui .. to’, ‘fptosi .. to’, ‘uitofp .. to’, -// ‘sitofp .. to’ instructions with a bitwidth above a threshold into -// auto-generated functions. This is useful for targets like x86_64 that cannot -// lower fp convertions with more than 128 bits. +// It expands ‘fptoui .. to’, ‘fptosi .. to’, ‘uitofp .. to’, ‘sitofp +// .. to’ instructions with a bitwidth above a threshold. This is +// useful for targets like x86_64 that cannot lower fp convertions +// with more than 128 bits. // //===----------------------------------------------------------------------===// -#include "llvm/CodeGen/ExpandLargeFpConvert.h" +#include "llvm/CodeGen/ExpandFp.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/GlobalsModRef.h" #include "llvm/CodeGen/Passes.h" @@ -33,9 +33,11 @@ using namespace llvm; static cl::opt ExpandFpConvertBits("expand-fp-convert-bits", cl::Hidden, - cl::init(llvm::IntegerType::MAX_INT_BITS), - cl::desc("fp convert instructions on integers with " - "more than bits are expanded.")); + cl::init(llvm::IntegerType::MAX_INT_BITS), + cl::desc("fp convert instructions on integers with " + "more than bits are expanded.")); + +// clang-format off: preserve formatting of the following example /// Generate code to convert a fp number to integer, replacing FPToS(U)I with /// the generated code. This currently generates code similarly to compiler-rt's @@ -88,6 +90,7 @@ static cl::opt /// /// Replace fp to integer with generated code. static void expandFPToI(Instruction *FPToI) { + // clang-format on IRBuilder<> Builder(FPToI); auto *FloatVal = FPToI->getOperand(0); IntegerType *IntTy = cast(FPToI->getType()); @@ -224,6 +227,8 @@ static void expandFPToI(Instruction *FPToI) { FPToI->eraseFromParent(); } +// clang-format off: preserve formatting of the following example + /// Generate code to convert a fp number to integer, replacing S(U)IToFP with /// the generated code. This currently generates code similarly to compiler-rt's /// implementations. This implementation has an implicit assumption that integer @@ -307,6 +312,7 @@ static void expandFPToI(Instruction *FPToI) { /// /// Replace integer to fp with generated code. static void expandIToFP(Instruction *IToFP) { + // clang-format on IRBuilder<> Builder(IToFP); auto *IntVal = IToFP->getOperand(0); IntegerType *IntTy = cast(IntVal->getType()); @@ -666,13 +672,12 @@ static bool runImpl(Function &F, const TargetLowering &TLI) { } namespace { -class ExpandLargeFpConvertLegacyPass : public FunctionPass { +class ExpandFpLegacyPass : public FunctionPass { public: static char ID; - ExpandLargeFpConvertLegacyPass() : FunctionPass(ID) { - initializeExpandLargeFpConvertLegacyPassPass( - *PassRegistry::getPassRegistry()); + ExpandFpLegacyPass() : FunctionPass(ID) { + initializeExpandFpLegacyPassPass(*PassRegistry::getPassRegistry()); } bool runOnFunction(Function &F) override { @@ -689,19 +694,15 @@ public: }; } // namespace -PreservedAnalyses ExpandLargeFpConvertPass::run(Function &F, - FunctionAnalysisManager &FAM) { +PreservedAnalyses ExpandFpPass::run(Function &F, FunctionAnalysisManager &FAM) { const TargetSubtargetInfo *STI = TM->getSubtargetImpl(F); return runImpl(F, *STI->getTargetLowering()) ? PreservedAnalyses::none() : PreservedAnalyses::all(); } -char ExpandLargeFpConvertLegacyPass::ID = 0; -INITIALIZE_PASS_BEGIN(ExpandLargeFpConvertLegacyPass, "expand-large-fp-convert", - "Expand large fp convert", false, false) -INITIALIZE_PASS_END(ExpandLargeFpConvertLegacyPass, "expand-large-fp-convert", - "Expand large fp convert", false, false) +char ExpandFpLegacyPass::ID = 0; +INITIALIZE_PASS_BEGIN(ExpandFpLegacyPass, "expand-fp", + "Expand certain fp instructions", false, false) +INITIALIZE_PASS_END(ExpandFpLegacyPass, "expand-fp", "Expand fp", false, false) -FunctionPass *llvm::createExpandLargeFpConvertPass() { - return new ExpandLargeFpConvertLegacyPass(); -} +FunctionPass *llvm::createExpandFpPass() { return new ExpandFpLegacyPass(); } diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index ea5e43ff1216..f788ec5ecb15 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -1070,7 +1070,7 @@ bool TargetPassConfig::addISelPasses() { PM->add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis())); addPass(createPreISelIntrinsicLoweringPass()); addPass(createExpandLargeDivRemPass()); - addPass(createExpandLargeFpConvertPass()); + addPass(createExpandFpPass()); addIRPasses(); addCodeGenPrepare(); addPassesToHandleExceptions(); diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 145d11440ce4..3e5fd0bd6c99 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -89,8 +89,8 @@ #include "llvm/CodeGen/DwarfEHPrepare.h" #include "llvm/CodeGen/EarlyIfConversion.h" #include "llvm/CodeGen/EdgeBundles.h" +#include "llvm/CodeGen/ExpandFp.h" #include "llvm/CodeGen/ExpandLargeDivRem.h" -#include "llvm/CodeGen/ExpandLargeFpConvert.h" #include "llvm/CodeGen/ExpandMemCmp.h" #include "llvm/CodeGen/ExpandPostRAPseudos.h" #include "llvm/CodeGen/FinalizeISel.h" diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def index 586d4b7e02fc..81f2ea52c2e8 100644 --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -366,7 +366,7 @@ FUNCTION_PASS("dot-post-dom-only", PostDomOnlyPrinter()) FUNCTION_PASS("dse", DSEPass()) FUNCTION_PASS("dwarf-eh-prepare", DwarfEHPreparePass(TM)) FUNCTION_PASS("expand-large-div-rem", ExpandLargeDivRemPass(TM)) -FUNCTION_PASS("expand-large-fp-convert", ExpandLargeFpConvertPass(TM)) +FUNCTION_PASS("expand-fp", ExpandFpPass(TM)) FUNCTION_PASS("expand-memcmp", ExpandMemCmpPass(TM)) FUNCTION_PASS("extra-vector-passes", ExtraFunctionPassManager()) diff --git a/llvm/test/CodeGen/AArch64/O0-pipeline.ll b/llvm/test/CodeGen/AArch64/O0-pipeline.ll index 0d079881cb90..abc67eec3239 100644 --- a/llvm/test/CodeGen/AArch64/O0-pipeline.ll +++ b/llvm/test/CodeGen/AArch64/O0-pipeline.ll @@ -16,7 +16,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: Module Verifier ; CHECK-NEXT: Lower Garbage Collection Instructions diff --git a/llvm/test/CodeGen/AArch64/O3-pipeline.ll b/llvm/test/CodeGen/AArch64/O3-pipeline.ll index 49a86134411d..e1481667a4ab 100644 --- a/llvm/test/CodeGen/AArch64/O3-pipeline.ll +++ b/llvm/test/CodeGen/AArch64/O3-pipeline.ll @@ -20,7 +20,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: SVE intrinsics optimizations ; CHECK-NEXT: FunctionPass Manager diff --git a/llvm/test/CodeGen/AMDGPU/itofp.i128.bf.ll b/llvm/test/CodeGen/AMDGPU/itofp.i128.bf.ll index 44139fafbfe2..c001df48499c 100644 --- a/llvm/test/CodeGen/AMDGPU/itofp.i128.bf.ll +++ b/llvm/test/CodeGen/AMDGPU/itofp.i128.bf.ll @@ -2,7 +2,7 @@ ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=GCN,SDAG %s ; RUN: not --crash llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s 2>&1 | FileCheck -check-prefix=GISEL %s -; FIXME: GISEL can't handle the "fptrunc float to bfloat" that expand-large-fp-convert emits. +; FIXME: GISEL can't handle the "fptrunc float to bfloat" that expand-fp emits. ; GISEL: unable to translate instruction: fptrunc diff --git a/llvm/test/CodeGen/AMDGPU/llc-pipeline.ll b/llvm/test/CodeGen/AMDGPU/llc-pipeline.ll index 9aca7a5fc741..4b6cc32522f5 100644 --- a/llvm/test/CodeGen/AMDGPU/llc-pipeline.ll +++ b/llvm/test/CodeGen/AMDGPU/llc-pipeline.ll @@ -27,7 +27,7 @@ ; GCN-O0-NEXT: Pre-ISel Intrinsic Lowering ; GCN-O0-NEXT: FunctionPass Manager ; GCN-O0-NEXT: Expand large div/rem -; GCN-O0-NEXT: Expand large fp convert +; GCN-O0-NEXT: Expand fp ; GCN-O0-NEXT: AMDGPU Remove Incompatible Functions ; GCN-O0-NEXT: AMDGPU Printf lowering ; GCN-O0-NEXT: Lower ctors and dtors for AMDGPU @@ -177,7 +177,7 @@ ; GCN-O1-NEXT: Pre-ISel Intrinsic Lowering ; GCN-O1-NEXT: FunctionPass Manager ; GCN-O1-NEXT: Expand large div/rem -; GCN-O1-NEXT: Expand large fp convert +; GCN-O1-NEXT: Expand fp ; GCN-O1-NEXT: AMDGPU Remove Incompatible Functions ; GCN-O1-NEXT: AMDGPU Printf lowering ; GCN-O1-NEXT: Lower ctors and dtors for AMDGPU @@ -462,7 +462,7 @@ ; GCN-O1-OPTS-NEXT: Pre-ISel Intrinsic Lowering ; GCN-O1-OPTS-NEXT: FunctionPass Manager ; GCN-O1-OPTS-NEXT: Expand large div/rem -; GCN-O1-OPTS-NEXT: Expand large fp convert +; GCN-O1-OPTS-NEXT: Expand fp ; GCN-O1-OPTS-NEXT: AMDGPU Remove Incompatible Functions ; GCN-O1-OPTS-NEXT: AMDGPU Printf lowering ; GCN-O1-OPTS-NEXT: Lower ctors and dtors for AMDGPU @@ -775,7 +775,7 @@ ; GCN-O2-NEXT: Pre-ISel Intrinsic Lowering ; GCN-O2-NEXT: FunctionPass Manager ; GCN-O2-NEXT: Expand large div/rem -; GCN-O2-NEXT: Expand large fp convert +; GCN-O2-NEXT: Expand fp ; GCN-O2-NEXT: AMDGPU Remove Incompatible Functions ; GCN-O2-NEXT: AMDGPU Printf lowering ; GCN-O2-NEXT: Lower ctors and dtors for AMDGPU @@ -1094,7 +1094,7 @@ ; GCN-O3-NEXT: Pre-ISel Intrinsic Lowering ; GCN-O3-NEXT: FunctionPass Manager ; GCN-O3-NEXT: Expand large div/rem -; GCN-O3-NEXT: Expand large fp convert +; GCN-O3-NEXT: Expand fp ; GCN-O3-NEXT: AMDGPU Remove Incompatible Functions ; GCN-O3-NEXT: AMDGPU Printf lowering ; GCN-O3-NEXT: Lower ctors and dtors for AMDGPU diff --git a/llvm/test/CodeGen/ARM/O3-pipeline.ll b/llvm/test/CodeGen/ARM/O3-pipeline.ll index 1840b5ce46c6..960d7305e66f 100644 --- a/llvm/test/CodeGen/ARM/O3-pipeline.ll +++ b/llvm/test/CodeGen/ARM/O3-pipeline.ll @@ -6,7 +6,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: Simplify the CFG ; CHECK-NEXT: Dominator Tree Construction diff --git a/llvm/test/CodeGen/LoongArch/O0-pipeline.ll b/llvm/test/CodeGen/LoongArch/O0-pipeline.ll index 24bd4c75a982..d16cb1c15870 100644 --- a/llvm/test/CodeGen/LoongArch/O0-pipeline.ll +++ b/llvm/test/CodeGen/LoongArch/O0-pipeline.ll @@ -20,7 +20,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: Module Verifier ; CHECK-NEXT: Lower Garbage Collection Instructions diff --git a/llvm/test/CodeGen/LoongArch/opt-pipeline.ll b/llvm/test/CodeGen/LoongArch/opt-pipeline.ll index ab76d4e998d2..90d994909264 100644 --- a/llvm/test/CodeGen/LoongArch/opt-pipeline.ll +++ b/llvm/test/CodeGen/LoongArch/opt-pipeline.ll @@ -32,7 +32,7 @@ ; LAXX-NEXT: Pre-ISel Intrinsic Lowering ; LAXX-NEXT: FunctionPass Manager ; LAXX-NEXT: Expand large div/rem -; LAXX-NEXT: Expand large fp convert +; LAXX-NEXT: Expand fp ; LAXX-NEXT: Expand Atomic instructions ; LAXX-NEXT: Module Verifier ; LAXX-NEXT: Dominator Tree Construction diff --git a/llvm/test/CodeGen/M68k/pipeline.ll b/llvm/test/CodeGen/M68k/pipeline.ll index d61e591505e5..deaaffa907eb 100644 --- a/llvm/test/CodeGen/M68k/pipeline.ll +++ b/llvm/test/CodeGen/M68k/pipeline.ll @@ -3,7 +3,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: Module Verifier ; CHECK-NEXT: Dominator Tree Construction diff --git a/llvm/test/CodeGen/PowerPC/O0-pipeline.ll b/llvm/test/CodeGen/PowerPC/O0-pipeline.ll index 5853647bf3b9..38b1074e55d2 100644 --- a/llvm/test/CodeGen/PowerPC/O0-pipeline.ll +++ b/llvm/test/CodeGen/PowerPC/O0-pipeline.ll @@ -17,7 +17,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: PPC Lower MASS Entries ; CHECK-NEXT: FunctionPass Manager diff --git a/llvm/test/CodeGen/PowerPC/O3-pipeline.ll b/llvm/test/CodeGen/PowerPC/O3-pipeline.ll index 3920d75c83ff..7cbb1a1c9887 100644 --- a/llvm/test/CodeGen/PowerPC/O3-pipeline.ll +++ b/llvm/test/CodeGen/PowerPC/O3-pipeline.ll @@ -20,7 +20,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Convert i1 constants to i32/i64 if they are returned ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: PPC Lower MASS Entries diff --git a/llvm/test/CodeGen/RISCV/O0-pipeline.ll b/llvm/test/CodeGen/RISCV/O0-pipeline.ll index f93cb6589721..694662eab168 100644 --- a/llvm/test/CodeGen/RISCV/O0-pipeline.ll +++ b/llvm/test/CodeGen/RISCV/O0-pipeline.ll @@ -20,7 +20,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: RISC-V Zacas ABI fix ; CHECK-NEXT: Module Verifier diff --git a/llvm/test/CodeGen/RISCV/O3-pipeline.ll b/llvm/test/CodeGen/RISCV/O3-pipeline.ll index 976d1ee003a1..beef7a574dc4 100644 --- a/llvm/test/CodeGen/RISCV/O3-pipeline.ll +++ b/llvm/test/CodeGen/RISCV/O3-pipeline.ll @@ -24,7 +24,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: RISC-V Zacas ABI fix ; CHECK-NEXT: Dominator Tree Construction diff --git a/llvm/test/CodeGen/X86/O0-pipeline.ll b/llvm/test/CodeGen/X86/O0-pipeline.ll index 4c99dd830b44..6d824f8b510a 100644 --- a/llvm/test/CodeGen/X86/O0-pipeline.ll +++ b/llvm/test/CodeGen/X86/O0-pipeline.ll @@ -18,7 +18,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: Lower AMX intrinsics ; CHECK-NEXT: Lower AMX type for load/store diff --git a/llvm/test/CodeGen/X86/opt-pipeline.ll b/llvm/test/CodeGen/X86/opt-pipeline.ll index 203be56751d0..d72f517cfb60 100644 --- a/llvm/test/CodeGen/X86/opt-pipeline.ll +++ b/llvm/test/CodeGen/X86/opt-pipeline.ll @@ -28,7 +28,7 @@ ; CHECK-NEXT: Pre-ISel Intrinsic Lowering ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Expand large div/rem -; CHECK-NEXT: Expand large fp convert +; CHECK-NEXT: Expand fp ; CHECK-NEXT: Expand Atomic instructions ; CHECK-NEXT: Lower AMX intrinsics ; CHECK-NEXT: Lower AMX type for load/store diff --git a/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-fptosi129.ll b/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-fptosi129.ll index e058c5bb4aa0..f5bf8bb61a16 100644 --- a/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-fptosi129.ll +++ b/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-fptosi129.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -mtriple=x86_64-- -expand-large-fp-convert < %s | FileCheck %s -; RUN: opt -S -mtriple=x86_64-- -passes=expand-large-fp-convert < %s | FileCheck %s +; RUN: opt -S -mtriple=x86_64-- --expand-fp < %s | FileCheck %s +; RUN: opt -S -mtriple=x86_64-- -passes=expand-fp < %s | FileCheck %s define i129 @halftosi129(half %a) { ; CHECK-LABEL: @halftosi129( diff --git a/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-fptoui129.ll b/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-fptoui129.ll index c699f805754c..94ed32abe46f 100644 --- a/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-fptoui129.ll +++ b/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-fptoui129.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -mtriple=x86_64-- -expand-large-fp-convert < %s | FileCheck %s -; RUN: opt -S -mtriple=x86_64-- -passes=expand-large-fp-convert < %s | FileCheck %s +; RUN: opt -S -mtriple=x86_64-- --expand-fp < %s | FileCheck %s +; RUN: opt -S -mtriple=x86_64-- -passes=expand-fp < %s | FileCheck %s define i129 @halftoui129(half %a) { ; CHECK-LABEL: @halftoui129( diff --git a/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-si129tofp.ll b/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-si129tofp.ll index f70ce2f85f65..8820b873f381 100644 --- a/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-si129tofp.ll +++ b/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-si129tofp.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -mtriple=x86_64-- -expand-large-fp-convert < %s | FileCheck %s -; RUN: opt -S -mtriple=x86_64-- -passes=expand-large-fp-convert < %s | FileCheck %s +; RUN: opt -S -mtriple=x86_64-- --expand-fp < %s | FileCheck %s +; RUN: opt -S -mtriple=x86_64-- -passes=expand-fp < %s | FileCheck %s define half @si129tohalf(i129 %a) { ; CHECK-LABEL: @si129tohalf( diff --git a/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-ui129tofp.ll b/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-ui129tofp.ll index ee54d53e9ba0..b58d88bc02c7 100644 --- a/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-ui129tofp.ll +++ b/llvm/test/Transforms/ExpandLargeFpConvert/X86/expand-large-fp-convert-ui129tofp.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -mtriple=x86_64-- -expand-large-fp-convert < %s | FileCheck %s -; RUN: opt -S -mtriple=x86_64-- -passes=expand-large-fp-convert < %s | FileCheck %s +; RUN: opt -S -mtriple=x86_64-- --expand-fp < %s | FileCheck %s +; RUN: opt -S -mtriple=x86_64-- -passes=expand-fp < %s | FileCheck %s define half @ui129tohalf(i129 %a) { ; CHECK-LABEL: @ui129tohalf( diff --git a/llvm/tools/opt/optdriver.cpp b/llvm/tools/opt/optdriver.cpp index 4759d03ba80d..880f1fc66446 100644 --- a/llvm/tools/opt/optdriver.cpp +++ b/llvm/tools/opt/optdriver.cpp @@ -373,7 +373,7 @@ static bool shouldPinPassToLegacyPM(StringRef Pass) { "expand-large-div-rem", "structurizecfg", "fix-irreducible", - "expand-large-fp-convert", + "expand-fp", "callbrprepare", "scalarizer", }; @@ -425,7 +425,7 @@ extern "C" int optMain( // For codegen passes, only passes that do IR to IR transformation are // supported. initializeExpandLargeDivRemLegacyPassPass(Registry); - initializeExpandLargeFpConvertLegacyPassPass(Registry); + initializeExpandFpLegacyPassPass(Registry); initializeExpandMemCmpLegacyPassPass(Registry); initializeScalarizeMaskedMemIntrinLegacyPassPass(Registry); initializeSelectOptimizePass(Registry); diff --git a/llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn index 548ac41f43e5..b99676b52aea 100644 --- a/llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn @@ -57,7 +57,7 @@ static_library("CodeGen") { "EdgeBundles.cpp", "ExecutionDomainFix.cpp", "ExpandLargeDivRem.cpp", - "ExpandLargeFpConvert.cpp", + "ExpandFp.cpp", "ExpandMemCmp.cpp", "ExpandPostRAPseudos.cpp", "ExpandReductions.cpp",