Repository navigation
[CodeGen] Merge ExpandLargeDivRem into ExpandFp - #172680
frederik-h merged 1 commit into
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@llvm/pr-subscribers-backend-loongarch @llvm/pr-subscribers-backend-x86 Author: Frederik Harwath (frederik-h) ChangesBoth passes expand instructions at the IR level. Patch is 52.19 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/172680.diff 37 Files Affected:
diff --git a/llvm/docs/WritingAnLLVMPass.rst b/llvm/docs/WritingAnLLVMPass.rst
index eec9887d08ede..f475676e15367 100644
--- a/llvm/docs/WritingAnLLVMPass.rst
+++ b/llvm/docs/WritingAnLLVMPass.rst
@@ -673,7 +673,6 @@ default optimization pipelines, e.g. (the output has been trimmed):
ModulePass Manager
Pre-ISel Intrinsic Lowering
FunctionPass Manager
- Expand large div/rem
Expand fp
Expand Atomic instructions
SVE intrinsics optimizations
diff --git a/llvm/include/llvm/CodeGen/ExpandLargeDivRem.h b/llvm/include/llvm/CodeGen/ExpandLargeDivRem.h
deleted file mode 100644
index b73a382e93b5a..0000000000000
--- a/llvm/include/llvm/CodeGen/ExpandLargeDivRem.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//===- ExpandLargeDivRem.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.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_EXPANDLARGEDIVREM_H
-#define LLVM_CODEGEN_EXPANDLARGEDIVREM_H
-
-#include "llvm/IR/PassManager.h"
-
-namespace llvm {
-
-class TargetMachine;
-
-class ExpandLargeDivRemPass : public PassInfoMixin<ExpandLargeDivRemPass> {
-private:
- const TargetMachine *TM;
-
-public:
- explicit ExpandLargeDivRemPass(const TargetMachine &TM_) : TM(&TM_) {}
-
- PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
-};
-
-} // end namespace llvm
-
-#endif // LLVM_CODEGEN_EXPANDLARGEDIVREM_H
diff --git a/llvm/include/llvm/CodeGen/Passes.h b/llvm/include/llvm/CodeGen/Passes.h
index 2bf83cfa655b6..08dabd69a48e9 100644
--- a/llvm/include/llvm/CodeGen/Passes.h
+++ b/llvm/include/llvm/CodeGen/Passes.h
@@ -546,9 +546,6 @@ LLVM_ABI FunctionPass *createExpandReductionsPass();
// the corresponding function in a vector library (e.g., SVML, libmvec).
LLVM_ABI FunctionPass *createReplaceWithVeclibLegacyPass();
-// Expands large div/rem instructions.
-LLVM_ABI FunctionPass *createExpandLargeDivRemPass();
-
// Expands large div/rem instructions.
LLVM_ABI FunctionPass *createExpandFpPass();
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 50dcac6c7d438..06bc5caefd063 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -2220,7 +2220,7 @@ class LLVM_ABI TargetLoweringBase {
}
/// Returns the size in bits of the maximum div/rem the backend supports.
- /// Larger operations will be expanded by ExpandLargeDivRem.
+ /// Larger operations will be expanded by ExpandFp.
unsigned getMaxDivRemBitWidthSupported() const {
return MaxDivRemBitWidthSupported;
}
@@ -2886,7 +2886,7 @@ class LLVM_ABI TargetLoweringBase {
}
/// Set the size in bits of the maximum div/rem the backend supports.
- /// Larger operations will be expanded by ExpandLargeDivRem.
+ /// Larger operations will be expanded by ExpandFp.
void setMaxDivRemBitWidthSupported(unsigned SizeInBits) {
MaxDivRemBitWidthSupported = SizeInBits;
}
@@ -3743,7 +3743,7 @@ class LLVM_ABI TargetLoweringBase {
unsigned MaxAtomicSizeInBitsSupported;
/// Size in bits of the maximum div/rem size the backend supports.
- /// Larger operations will be expanded by ExpandLargeDivRem.
+ /// Larger operations will be expanded by ExpandFp.
unsigned MaxDivRemBitWidthSupported;
/// Size in bits of the maximum fp to/from int conversion size the
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index a5491e68bbe52..b4f96674bea9e 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -113,7 +113,6 @@ LLVM_ABI void initializeEarlyTailDuplicateLegacyPass(PassRegistry &);
LLVM_ABI void initializeEdgeBundlesWrapperLegacyPass(PassRegistry &);
LLVM_ABI void initializeEHContGuardTargetsPass(PassRegistry &);
LLVM_ABI void initializeExpandFpLegacyPassPass(PassRegistry &);
-LLVM_ABI void initializeExpandLargeDivRemLegacyPassPass(PassRegistry &);
LLVM_ABI void initializeExpandMemCmpLegacyPassPass(PassRegistry &);
LLVM_ABI void initializeExpandPostRALegacyPass(PassRegistry &);
LLVM_ABI void initializeExpandReductionsPass(PassRegistry &);
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index 630bdf96c18df..612e57b52644f 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -128,7 +128,6 @@ struct ForcePassLinking {
(void)llvm::createGVNPass();
(void)llvm::createPostDomTree();
(void)llvm::createMergeICmpsLegacyPass();
- (void)llvm::createExpandLargeDivRemPass();
(void)llvm::createExpandMemCmpLegacyPass();
std::string buf;
llvm::raw_string_ostream os(buf);
diff --git a/llvm/include/llvm/Passes/CodeGenPassBuilder.h b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
index f47537d109671..0462adb835d89 100644
--- a/llvm/include/llvm/Passes/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
@@ -33,7 +33,6 @@
#include "llvm/CodeGen/DwarfEHPrepare.h"
#include "llvm/CodeGen/EarlyIfConversion.h"
#include "llvm/CodeGen/ExpandFp.h"
-#include "llvm/CodeGen/ExpandLargeDivRem.h"
#include "llvm/CodeGen/ExpandMemCmp.h"
#include "llvm/CodeGen/ExpandPostRAPseudos.h"
#include "llvm/CodeGen/ExpandReductions.h"
@@ -678,7 +677,6 @@ void CodeGenPassBuilder<Derived, TargetMachineT>::addISelPasses(
addModulePass(LowerEmuTLSPass(), PMW);
addModulePass(PreISelIntrinsicLoweringPass(&TM), PMW);
- addFunctionPass(ExpandLargeDivRemPass(TM), PMW);
addFunctionPass(ExpandFpPass(TM, getOptLevel()), PMW);
derived().addIRPasses(PMW);
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index 30237e66ed0ec..8c9b172c0da65 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -57,7 +57,6 @@ add_llvm_component_library(LLVMCodeGen
EdgeBundles.cpp
EHContGuardTargets.cpp
ExecutionDomainFix.cpp
- ExpandLargeDivRem.cpp
ExpandFp.cpp
ExpandMemCmp.cpp
ExpandPostRAPseudos.cpp
diff --git a/llvm/lib/CodeGen/CodeGen.cpp b/llvm/lib/CodeGen/CodeGen.cpp
index fe293c63fa762..47633f89b70e9 100644
--- a/llvm/lib/CodeGen/CodeGen.cpp
+++ b/llvm/lib/CodeGen/CodeGen.cpp
@@ -39,7 +39,6 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeEarlyIfPredicatorPass(Registry);
initializeEarlyMachineLICMPass(Registry);
initializeEarlyTailDuplicateLegacyPass(Registry);
- initializeExpandLargeDivRemLegacyPassPass(Registry);
initializeExpandFpLegacyPassPass(Registry);
initializeExpandMemCmpLegacyPassPass(Registry);
initializeExpandPostRALegacyPass(Registry);
diff --git a/llvm/lib/CodeGen/ExpandFp.cpp b/llvm/lib/CodeGen/ExpandFp.cpp
index 2b48bdfe723a0..395fef19a13b9 100644
--- a/llvm/lib/CodeGen/ExpandFp.cpp
+++ b/llvm/lib/CodeGen/ExpandFp.cpp
@@ -12,6 +12,12 @@
// useful for targets like x86_64 that cannot lower fp convertions
// with more than 128 bits.
//
+// This pass also expands div/rem instructions with a bitwidth above a
+// threshold into a call to auto-generated functions. This is useful
+// for targets like x86_64 that cannot lower divisions with more than
+// 128 bits or targets like x86_32 that cannot lower divisions with
+// more than 64 bits.
+//
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/ExpandFp.h"
@@ -35,6 +41,8 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
+#include "llvm/Transforms/Utils/IntegerDivision.h"
+#include <llvm/Support/Casting.h>
#include <optional>
#define DEBUG_TYPE "expand-fp"
@@ -47,7 +55,28 @@ static cl::opt<unsigned>
cl::desc("fp convert instructions on integers with "
"more than <N> bits are expanded."));
+static cl::opt<unsigned>
+ ExpandDivRemBits("expand-div-rem-bits", cl::Hidden,
+ cl::init(llvm::IntegerType::MAX_INT_BITS),
+ cl::desc("div and rem instructions on integers with "
+ "more than <N> bits are expanded."));
+
namespace {
+bool isConstantPowerOfTwo(llvm::Value *V, bool SignedOp) {
+ auto *C = dyn_cast<ConstantInt>(V);
+ if (!C)
+ return false;
+
+ APInt Val = C->getValue();
+ if (SignedOp && Val.isNegative())
+ Val = -Val;
+ return Val.isPowerOf2();
+}
+
+bool isSigned(unsigned int Opcode) {
+ return Opcode == Instruction::SDiv || Opcode == Instruction::SRem;
+}
+
/// This class implements a precise expansion of the frem instruction.
/// The generated code is based on the fmod implementation in the AMD device
/// libs.
@@ -995,11 +1024,17 @@ static bool runImpl(Function &F, const TargetLowering &TLI,
if (ExpandFpConvertBits != llvm::IntegerType::MAX_INT_BITS)
MaxLegalFpConvertBitWidth = ExpandFpConvertBits;
+ unsigned MaxLegalDivRemBitWidth = TLI.getMaxDivRemBitWidthSupported();
+ if (ExpandDivRemBits != llvm::IntegerType::MAX_INT_BITS)
+ MaxLegalDivRemBitWidth = ExpandDivRemBits;
+
bool DisableExpandLargeFp =
MaxLegalFpConvertBitWidth >= llvm::IntegerType::MAX_INT_BITS;
+ bool DisableExpandLargeDivRem =
+ MaxLegalDivRemBitWidth >= llvm::IntegerType::MAX_INT_BITS;
bool DisableFrem = !FRemExpander::shouldExpandAnyFremType(TLI);
- if (DisableExpandLargeFp && DisableFrem)
+ if (DisableExpandLargeFp && DisableFrem && DisableExpandLargeDivRem)
return false;
auto ShouldHandleInst = [&](Instruction &I) {
@@ -1021,6 +1056,16 @@ static bool runImpl(Function &F, const TargetLowering &TLI,
return !DisableExpandLargeFp &&
cast<IntegerType>(I.getOperand(0)->getType()->getScalarType())
->getIntegerBitWidth() > MaxLegalFpConvertBitWidth;
+ case Instruction::UDiv:
+ case Instruction::SDiv:
+ case Instruction::URem:
+ case Instruction::SRem:
+ return !DisableExpandLargeDivRem &&
+ cast<IntegerType>(Ty->getScalarType())->getIntegerBitWidth() >
+ MaxLegalDivRemBitWidth
+ // The backend has peephole optimizations for powers of two.
+ // TODO: We don't consider vectors here.
+ && !isConstantPowerOfTwo(I.getOperand(1), isSigned(I.getOpcode()));
}
return false;
@@ -1064,6 +1109,15 @@ static bool runImpl(Function &F, const TargetLowering &TLI,
case Instruction::SIToFP:
expandIToFP(I);
break;
+
+ case Instruction::UDiv:
+ case Instruction::SDiv:
+ expandDivision(cast<BinaryOperator>(I));
+ break;
+ case Instruction::URem:
+ case Instruction::SRem:
+ expandRemainder(cast<BinaryOperator>(I));
+ break;
}
}
diff --git a/llvm/lib/CodeGen/ExpandLargeDivRem.cpp b/llvm/lib/CodeGen/ExpandLargeDivRem.cpp
deleted file mode 100644
index 98b77e9c254ae..0000000000000
--- a/llvm/lib/CodeGen/ExpandLargeDivRem.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-//===--- ExpandLargeDivRem.cpp - Expand large div/rem ---------------------===//
-//
-// 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 div/rem instructions with a bitwidth above a threshold
-// into a call to auto-generated functions.
-// This is useful for targets like x86_64 that cannot lower divisions
-// with more than 128 bits or targets like x86_32 that cannot lower divisions
-// with more than 64 bits.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/ExpandLargeDivRem.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Analysis/GlobalsModRef.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/TargetLowering.h"
-#include "llvm/CodeGen/TargetPassConfig.h"
-#include "llvm/CodeGen/TargetSubtargetInfo.h"
-#include "llvm/IR/IRBuilder.h"
-#include "llvm/IR/InstIterator.h"
-#include "llvm/IR/PassManager.h"
-#include "llvm/InitializePasses.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Transforms/Utils/IntegerDivision.h"
-
-using namespace llvm;
-
-static cl::opt<unsigned>
- ExpandDivRemBits("expand-div-rem-bits", cl::Hidden,
- cl::init(llvm::IntegerType::MAX_INT_BITS),
- cl::desc("div and rem instructions on integers with "
- "more than <N> bits are expanded."));
-
-static bool isConstantPowerOfTwo(llvm::Value *V, bool SignedOp) {
- auto *C = dyn_cast<ConstantInt>(V);
- if (!C)
- return false;
-
- APInt Val = C->getValue();
- if (SignedOp && Val.isNegative())
- Val = -Val;
- return Val.isPowerOf2();
-}
-
-static bool isSigned(unsigned int Opcode) {
- return Opcode == Instruction::SDiv || Opcode == Instruction::SRem;
-}
-
-static void scalarize(BinaryOperator *BO,
- SmallVectorImpl<BinaryOperator *> &Replace) {
- VectorType *VTy = cast<FixedVectorType>(BO->getType());
-
- IRBuilder<> Builder(BO);
-
- unsigned NumElements = VTy->getElementCount().getFixedValue();
- Value *Result = PoisonValue::get(VTy);
- for (unsigned Idx = 0; Idx < NumElements; ++Idx) {
- Value *LHS = Builder.CreateExtractElement(BO->getOperand(0), Idx);
- Value *RHS = Builder.CreateExtractElement(BO->getOperand(1), Idx);
- Value *Op = Builder.CreateBinOp(BO->getOpcode(), LHS, RHS);
- Result = Builder.CreateInsertElement(Result, Op, Idx);
- if (auto *NewBO = dyn_cast<BinaryOperator>(Op)) {
- NewBO->copyIRFlags(Op, true);
- Replace.push_back(NewBO);
- }
- }
- BO->replaceAllUsesWith(Result);
- BO->dropAllReferences();
- BO->eraseFromParent();
-}
-
-static bool runImpl(Function &F, const TargetLowering &TLI) {
- SmallVector<BinaryOperator *, 4> Replace;
- SmallVector<BinaryOperator *, 4> ReplaceVector;
- bool Modified = false;
-
- unsigned MaxLegalDivRemBitWidth = TLI.getMaxDivRemBitWidthSupported();
- if (ExpandDivRemBits != llvm::IntegerType::MAX_INT_BITS)
- MaxLegalDivRemBitWidth = ExpandDivRemBits;
-
- if (MaxLegalDivRemBitWidth >= llvm::IntegerType::MAX_INT_BITS)
- return false;
-
- for (auto &I : instructions(F)) {
- switch (I.getOpcode()) {
- case Instruction::UDiv:
- case Instruction::SDiv:
- case Instruction::URem:
- case Instruction::SRem: {
- // TODO: This pass doesn't handle scalable vectors.
- if (I.getOperand(0)->getType()->isScalableTy())
- continue;
-
- auto *IntTy = dyn_cast<IntegerType>(I.getType()->getScalarType());
- if (!IntTy || IntTy->getIntegerBitWidth() <= MaxLegalDivRemBitWidth)
- continue;
-
- // The backend has peephole optimizations for powers of two.
- // TODO: We don't consider vectors here.
- if (isConstantPowerOfTwo(I.getOperand(1), isSigned(I.getOpcode())))
- continue;
-
- if (I.getOperand(0)->getType()->isVectorTy())
- ReplaceVector.push_back(&cast<BinaryOperator>(I));
- else
- Replace.push_back(&cast<BinaryOperator>(I));
- Modified = true;
- break;
- }
- default:
- break;
- }
- }
-
- while (!ReplaceVector.empty()) {
- BinaryOperator *BO = ReplaceVector.pop_back_val();
- scalarize(BO, Replace);
- }
-
- if (Replace.empty())
- return false;
-
- while (!Replace.empty()) {
- BinaryOperator *I = Replace.pop_back_val();
-
- if (I->getOpcode() == Instruction::UDiv ||
- I->getOpcode() == Instruction::SDiv) {
- expandDivision(I);
- } else {
- expandRemainder(I);
- }
- }
-
- return Modified;
-}
-
-namespace {
-class ExpandLargeDivRemLegacyPass : public FunctionPass {
-public:
- static char ID;
-
- ExpandLargeDivRemLegacyPass() : FunctionPass(ID) {
- initializeExpandLargeDivRemLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &F) override {
- auto *TM = &getAnalysis<TargetPassConfig>().getTM<TargetMachine>();
- auto *TLI = TM->getSubtargetImpl(F)->getTargetLowering();
- return runImpl(F, *TLI);
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.addRequired<TargetPassConfig>();
- AU.addPreserved<AAResultsWrapperPass>();
- AU.addPreserved<GlobalsAAWrapperPass>();
- }
-};
-} // namespace
-
-PreservedAnalyses ExpandLargeDivRemPass::run(Function &F,
- FunctionAnalysisManager &FAM) {
- const TargetSubtargetInfo *STI = TM->getSubtargetImpl(F);
- return runImpl(F, *STI->getTargetLowering()) ? PreservedAnalyses::none()
- : PreservedAnalyses::all();
-}
-
-char ExpandLargeDivRemLegacyPass::ID = 0;
-INITIALIZE_PASS_BEGIN(ExpandLargeDivRemLegacyPass, "expand-large-div-rem",
- "Expand large div/rem", false, false)
-INITIALIZE_PASS_END(ExpandLargeDivRemLegacyPass, "expand-large-div-rem",
- "Expand large div/rem", false, false)
-
-FunctionPass *llvm::createExpandLargeDivRemPass() {
- return new ExpandLargeDivRemLegacyPass();
-}
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index 120343d4b349b..acceb66468409 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -1090,7 +1090,6 @@ bool TargetPassConfig::addISelPasses() {
PM->add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis()));
addPass(createPreISelIntrinsicLoweringPass());
- addPass(createExpandLargeDivRemPass());
addPass(createExpandFpPass(getOptLevel()));
addIRPasses();
addCodeGenPrepare();
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index f5281ea69b512..d639c24664ad1 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -92,7 +92,6 @@
#include "llvm/CodeGen/EarlyIfConversion.h"
#include "llvm/CodeGen/EdgeBundles.h"
#include "llvm/CodeGen/ExpandFp.h"
-#include "llvm/CodeGen/ExpandLargeDivRem.h"
#include "llvm/CodeGen/ExpandMemCmp.h"
#include "llvm/CodeGen/ExpandPostRAPseudos.h"
#include "llvm/CodeGen/ExpandReductions.h"
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index cf998f29ef38c..14215bb32e777 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -433,7 +433,6 @@ FUNCTION_PASS("dot-post-dom", PostDomPrinter())
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-memcmp", ExpandMemCmpPass(*TM))
FUNCTION_PASS("expand-reductions", ExpandReductionsPass())
FUNCTION_PASS("extra-vector-passes",
diff --git a/llvm/test/CodeGen/AArch64/O0-pipeline.ll b/llvm/test/CodeGen/AArch64/O0-pipeline.ll
index 96f5e5a4afb3e..2a1264446c70d 100644
--- a/llvm/test/CodeGen/AArch64/O0-pipeline.ll
+++ b/llvm/test/CodeGen/AArch64/O0-pipeline.ll
@@ -17,7 +17,6 @@
; CHECK-NEXT: ModulePass Manager
; CHECK-NEXT: Pre-ISel Intrinsic Lowering
; CHECK-NEXT: FunctionPass Manager
-; CHECK-NEXT: Expand large div/rem
; CHECK-NEXT: Expand fp
; CHECK-NEXT: Expand Atomic instructions
; CHECK-NEXT: Module Verifier
diff --git a/llvm/test/CodeGen/AArch64/O3-pipeline.ll b/llvm/test/CodeGen/AArch64/O3-pipeline.ll
index e8ea55e027aec..4dc3cd1d6b786 100644
--- a/llvm/test/CodeGen/AArch64/O3-pipeline.ll
+++ b/llvm/test/CodeGen/AArch64/O3-pipeline.ll
@@ -21,7 +21,6 @@
; CHECK-NEXT: ModulePass Manager
; CHECK-NEXT: Pre-ISel Intrinsic Lowering
; CHECK-NEXT: FunctionPass Manager
-; CHECK-NEXT: Expand large div/rem
; CHECK-NEXT: Expand fp
; CHECK-NEXT: Expand Atomic instructions
; CHECK-NEXT: SVE intrinsics optimizations
diff --git a/llvm/test/CodeGen/AMDGPU/llc-pipeline-npm.ll b/llvm/test/CodeGen/AMDGPU/llc-pipeline-npm.ll
index c3dc26f3e10e4..edf4b6f26d08e 100644
--- a/llvm/test/CodeGen/AMDGPU/llc-pipeline-npm.ll
+++ b/llvm/test/CodeGen/AMDGPU/llc-pipeline-npm.ll
@@ -9,11 +9,11 @@
; RUN: | FileCheck -check-prefix=GCN-O3 %s
-; GCN...
[truncated]
|
Merge activity
|
06914a5 to
ac83463
Compare
Both passes expand instructions at the IR level. They use the same kind of instruction visitation logic and contain significant code duplication e.g. for scalarization.
ac83463 to
56d7bb0
Compare
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/128/builds/9529 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/20489 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/18142 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/13679 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/161/builds/9433 Here is the relevant piece of the build log for the reference |
Both passes expand instructions at the IR level. They use the same kind of instruction visitation logic and contain significant code duplication e.g. for scalarization.
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/72/builds/16719 Here is the relevant piece of the build log for the reference |
## Version and Build Flow
- fetch branch / apply local patch -> fetch exact submodule commit with
`git fetch origin "${LLVM_COMMIT}"`
- `LLVM_COMMIT + riscv-jitlink.patch hash` -> `LLVM_COMMIT` cache key
- apply `riscv-jitlink.patch` -> no patch; current LLVM already has the fix
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: `nanobind` /
`nanobind==2.4.*` -> `nanobind>=2.9,<3.0` / `nanobind==2.9.*`
## Python Bindings
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PybindAdaptors.h` -> `NanobindAdaptors.h`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PYBIND11_MODULE` -> `NB_MODULE`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: manual
pybind/nanobind CMake setup -> `mlir_configure_python_dev_packages()`
## MLIR API
- [#162167](llvm/llvm-project#162167) / ea291d0e8c93:
`vector::SplatOp` -> `vector::BroadcastOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::InsertElementOp` -> `vector::InsertOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::ExtractElementOp` -> `vector::ExtractOp`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`ValueRange{std::nullopt}` -> `ValueRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`TypeRange(std::nullopt)` -> `TypeRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c: empty
`scf.yield` with null operands -> empty `scf.yield`
- [#196082](llvm/llvm-project#196082) / dd57b0c9728a:
`computeConstantBound(..., /*closedUB=*/true)` ->
`computeConstantBound(..., ValueBoundsOptions{/*closedUB=*/true})`
- [#182715](llvm/llvm-project#182715) / 72f5050ae765:
`applyPatternsAndFoldGreedily(...)` -> `applyPatternsGreedily(...)`
## GPU and AMX
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`launchOp.getWorkgroupAttributions()` ->
`launchOp.getWorkgroupAttributionBBArgs()`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea: manual
`gpu.kernel` attr -> `outlinedFunc.setKernel(true)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`setAttr(getKnown*AttrName(), ...)` ->
`setKnownBlockSizeAttr(...)` / `setKnownGridSizeAttr(...)`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir/Dialect/AMX/AMXDialect.h` -> `mlir/Dialect/X86/X86Dialect.h`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir::amx::AMXDialect` -> `mlir::x86::X86Dialect`
## LLVM Source Lists
- [#167271](llvm/llvm-project#167271) / 2345b7d98f75:
`InlineSizeEstimatorAnalysis.cpp` -> removed upstream; no Buddy source-list
entry needed
- [#172680](llvm/llvm-project#172680) / 71760f324ff9:
`ExpandLargeDivRem.cpp` -> merged into `ExpandFp.cpp`
- [#172681](llvm/llvm-project#172681) / 5c05824d2bd3:
`ExpandFp.cpp` / merged `ExpandLargeDivRem.cpp` -> `ExpandIRInsts.cpp`
- [#77370](llvm/llvm-project#77370) / 5e0a06b34d09:
`ExpandMemCmp.cpp` in CodeGen -> moved to `Transforms/Scalar`
- [#181547](llvm/llvm-project#181547) / 9a0d65cdfd0d:
`CallBrPrepare.cpp` -> `InlineAsmPrepare.cpp`
- [#160454](llvm/llvm-project#160454) / aa6a33ae6556:
`EVLIndVarSimplify.cpp` -> removed upstream; no Buddy source-list entry needed
- [#192635](llvm/llvm-project#192635) / 680a9908194e:
`VPlanSLP.cpp` -> removed upstream; no Buddy source-list entry needed
## RISC-V Backend
- local Buddy `M0`-`M7` definitions -> upstream RISC-V `M0`-`M7` definitions
- Buddy `MatrixReg` using local mask regs -> `MatrixReg` using upstream mask regs
- IME `*N` instructions in disassembler tables -> mark affected instructions
`isCodeGenOnly = 1`
## Tool API and Link Libraries
- [#156715](llvm/llvm-project#156715) / dfbd76bda01e:
`Expected<std::unique_ptr<ToolOutputFile>>` from
`setupLLVMOptimizationRemarks` -> `Expected<LLVMRemarkFileHandle>`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, F)` ->
`codegen::setFunctionAttributes(F, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M)` ->
`codegen::setFunctionAttributes(*M, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#87226](llvm/llvm-project#87226) / d0e72ccc54df:
`TargetMachine::buildCodeGenPipeline(MPM, OS, DwoOut, FileType, Opt, PIC)` ->
pass `MAM` and `MMI.getContext()`
- [#170846](llvm/llvm-project#170846) / cd806d7e7689: `buddy-llc`
without `Plugins` -> link LLVM `Plugins`
- [#150805](llvm/llvm-project#150805) / ace42cf063a5,
[#151150](llvm/llvm-project#151150) / e68a20e0b762: implicit MLIR
register-all symbols -> link `MLIRRegisterAllDialects`,
`MLIRRegisterAllExtensions`, `MLIRRegisterAllPasses`
- fetch branch / apply local patch -> fetch exact submodule commit with
`git fetch origin "${LLVM_COMMIT}"`
- `LLVM_COMMIT + riscv-jitlink.patch hash` -> `LLVM_COMMIT` cache key
- apply `riscv-jitlink.patch` -> no patch; current LLVM already has the fix
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: `nanobind` /
`nanobind==2.4.*` -> `nanobind>=2.9,<3.0` / `nanobind==2.9.*`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PybindAdaptors.h` -> `NanobindAdaptors.h`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PYBIND11_MODULE` -> `NB_MODULE`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: manual
pybind/nanobind CMake setup -> `mlir_configure_python_dev_packages()`
- [#162167](llvm/llvm-project#162167) / ea291d0e8c93:
`vector::SplatOp` -> `vector::BroadcastOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::InsertElementOp` -> `vector::InsertOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::ExtractElementOp` -> `vector::ExtractOp`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`ValueRange{std::nullopt}` -> `ValueRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`TypeRange(std::nullopt)` -> `TypeRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c: empty
`scf.yield` with null operands -> empty `scf.yield`
- [#196082](llvm/llvm-project#196082) / dd57b0c9728a:
`computeConstantBound(..., /*closedUB=*/true)` ->
`computeConstantBound(..., ValueBoundsOptions{/*closedUB=*/true})`
- [#182715](llvm/llvm-project#182715) / 72f5050ae765:
`applyPatternsAndFoldGreedily(...)` -> `applyPatternsGreedily(...)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`launchOp.getWorkgroupAttributions()` ->
`launchOp.getWorkgroupAttributionBBArgs()`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea: manual
`gpu.kernel` attr -> `outlinedFunc.setKernel(true)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`setAttr(getKnown*AttrName(), ...)` ->
`setKnownBlockSizeAttr(...)` / `setKnownGridSizeAttr(...)`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir/Dialect/AMX/AMXDialect.h` -> `mlir/Dialect/X86/X86Dialect.h`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir::amx::AMXDialect` -> `mlir::x86::X86Dialect`
- [#167271](llvm/llvm-project#167271) / 2345b7d98f75:
`InlineSizeEstimatorAnalysis.cpp` -> removed upstream; no Buddy source-list
entry needed
- [#172680](llvm/llvm-project#172680) / 71760f324ff9:
`ExpandLargeDivRem.cpp` -> merged into `ExpandFp.cpp`
- [#172681](llvm/llvm-project#172681) / 5c05824d2bd3:
`ExpandFp.cpp` / merged `ExpandLargeDivRem.cpp` -> `ExpandIRInsts.cpp`
- [#77370](llvm/llvm-project#77370) / 5e0a06b34d09:
`ExpandMemCmp.cpp` in CodeGen -> moved to `Transforms/Scalar`
- [#181547](llvm/llvm-project#181547) / 9a0d65cdfd0d:
`CallBrPrepare.cpp` -> `InlineAsmPrepare.cpp`
- [#160454](llvm/llvm-project#160454) / aa6a33ae6556:
`EVLIndVarSimplify.cpp` -> removed upstream; no Buddy source-list entry needed
- [#192635](llvm/llvm-project#192635) / 680a9908194e:
`VPlanSLP.cpp` -> removed upstream; no Buddy source-list entry needed
- local Buddy `M0`-`M7` definitions -> upstream RISC-V `M0`-`M7` definitions
- Buddy `MatrixReg` using local mask regs -> `MatrixReg` using upstream mask regs
- IME `*N` instructions in disassembler tables -> mark affected instructions
`isCodeGenOnly = 1`
- [#156715](llvm/llvm-project#156715) / dfbd76bda01e:
`Expected<std::unique_ptr<ToolOutputFile>>` from
`setupLLVMOptimizationRemarks` -> `Expected<LLVMRemarkFileHandle>`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, F)` ->
`codegen::setFunctionAttributes(F, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M)` ->
`codegen::setFunctionAttributes(*M, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#87226](llvm/llvm-project#87226) / d0e72ccc54df:
`TargetMachine::buildCodeGenPipeline(MPM, OS, DwoOut, FileType, Opt, PIC)` ->
pass `MAM` and `MMI.getContext()`
- [#170846](llvm/llvm-project#170846) / cd806d7e7689: `buddy-llc`
without `Plugins` -> link LLVM `Plugins`
- [#150805](llvm/llvm-project#150805) / ace42cf063a5,
[#151150](llvm/llvm-project#151150) / e68a20e0b762: implicit MLIR
register-all symbols -> link `MLIRRegisterAllDialects`,
`MLIRRegisterAllExtensions`, `MLIRRegisterAllPasses`
- fetch branch / apply local patch -> fetch exact submodule commit with
`git fetch origin "${LLVM_COMMIT}"`
- `LLVM_COMMIT + riscv-jitlink.patch hash` -> `LLVM_COMMIT` cache key
- apply `riscv-jitlink.patch` -> no patch; current LLVM already has the fix
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: `nanobind` /
`nanobind==2.4.*` -> `nanobind>=2.9,<3.0` / `nanobind==2.9.*`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PybindAdaptors.h` -> `NanobindAdaptors.h`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PYBIND11_MODULE` -> `NB_MODULE`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: manual
pybind/nanobind CMake setup -> `mlir_configure_python_dev_packages()`
- [#162167](llvm/llvm-project#162167) / ea291d0e8c93:
`vector::SplatOp` -> `vector::BroadcastOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::InsertElementOp` -> `vector::InsertOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::ExtractElementOp` -> `vector::ExtractOp`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`ValueRange{std::nullopt}` -> `ValueRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`TypeRange(std::nullopt)` -> `TypeRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c: empty
`scf.yield` with null operands -> empty `scf.yield`
- [#196082](llvm/llvm-project#196082) / dd57b0c9728a:
`computeConstantBound(..., /*closedUB=*/true)` ->
`computeConstantBound(..., ValueBoundsOptions{/*closedUB=*/true})`
- [#182715](llvm/llvm-project#182715) / 72f5050ae765:
`applyPatternsAndFoldGreedily(...)` -> `applyPatternsGreedily(...)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`launchOp.getWorkgroupAttributions()` ->
`launchOp.getWorkgroupAttributionBBArgs()`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea: manual
`gpu.kernel` attr -> `outlinedFunc.setKernel(true)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`setAttr(getKnown*AttrName(), ...)` ->
`setKnownBlockSizeAttr(...)` / `setKnownGridSizeAttr(...)`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir/Dialect/AMX/AMXDialect.h` -> `mlir/Dialect/X86/X86Dialect.h`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir::amx::AMXDialect` -> `mlir::x86::X86Dialect`
- [#167271](llvm/llvm-project#167271) / 2345b7d98f75:
`InlineSizeEstimatorAnalysis.cpp` -> removed upstream; no Buddy source-list
entry needed
- [#172680](llvm/llvm-project#172680) / 71760f324ff9:
`ExpandLargeDivRem.cpp` -> merged into `ExpandFp.cpp`
- [#172681](llvm/llvm-project#172681) / 5c05824d2bd3:
`ExpandFp.cpp` / merged `ExpandLargeDivRem.cpp` -> `ExpandIRInsts.cpp`
- [#77370](llvm/llvm-project#77370) / 5e0a06b34d09:
`ExpandMemCmp.cpp` in CodeGen -> moved to `Transforms/Scalar`
- [#181547](llvm/llvm-project#181547) / 9a0d65cdfd0d:
`CallBrPrepare.cpp` -> `InlineAsmPrepare.cpp`
- [#160454](llvm/llvm-project#160454) / aa6a33ae6556:
`EVLIndVarSimplify.cpp` -> removed upstream; no Buddy source-list entry needed
- [#192635](llvm/llvm-project#192635) / 680a9908194e:
`VPlanSLP.cpp` -> removed upstream; no Buddy source-list entry needed
- local Buddy `M0`-`M7` definitions -> upstream RISC-V `M0`-`M7` definitions
- Buddy `MatrixReg` using local mask regs -> `MatrixReg` using upstream mask regs
- IME `*N` instructions in disassembler tables -> mark affected instructions
`isCodeGenOnly = 1`
- [#156715](llvm/llvm-project#156715) / dfbd76bda01e:
`Expected<std::unique_ptr<ToolOutputFile>>` from
`setupLLVMOptimizationRemarks` -> `Expected<LLVMRemarkFileHandle>`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, F)` ->
`codegen::setFunctionAttributes(F, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M)` ->
`codegen::setFunctionAttributes(*M, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#87226](llvm/llvm-project#87226) / d0e72ccc54df:
`TargetMachine::buildCodeGenPipeline(MPM, OS, DwoOut, FileType, Opt, PIC)` ->
pass `MAM` and `MMI.getContext()`
- [#170846](llvm/llvm-project#170846) / cd806d7e7689: `buddy-llc`
without `Plugins` -> link LLVM `Plugins`
- [#150805](llvm/llvm-project#150805) / ace42cf063a5,
[#151150](llvm/llvm-project#151150) / e68a20e0b762: implicit MLIR
register-all symbols -> link `MLIRRegisterAllDialects`,
`MLIRRegisterAllExtensions`, `MLIRRegisterAllPasses`
- fetch branch / apply local patch -> fetch exact submodule commit with
`git fetch origin "${LLVM_COMMIT}"`
- `LLVM_COMMIT + riscv-jitlink.patch hash` -> `LLVM_COMMIT` cache key
- apply `riscv-jitlink.patch` -> no patch; current LLVM already has the fix
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: `nanobind` /
`nanobind==2.4.*` -> `nanobind>=2.9,<3.0` / `nanobind==2.9.*`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PybindAdaptors.h` -> `NanobindAdaptors.h`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97:
`PYBIND11_MODULE` -> `NB_MODULE`
- [#172581](llvm/llvm-project#172581) / 3d7018c70b97: manual
pybind/nanobind CMake setup -> `mlir_configure_python_dev_packages()`
- [#162167](llvm/llvm-project#162167) / ea291d0e8c93:
`vector::SplatOp` -> `vector::BroadcastOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::InsertElementOp` -> `vector::InsertOp`
- [#149603](llvm/llvm-project#149603) / 33465bb2bb75:
`vector::ExtractElementOp` -> `vector::ExtractOp`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`ValueRange{std::nullopt}` -> `ValueRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c:
`TypeRange(std::nullopt)` -> `TypeRange{}`
- [#145445](llvm/llvm-project#145445) / 63f30d7d820c: empty
`scf.yield` with null operands -> empty `scf.yield`
- [#196082](llvm/llvm-project#196082) / dd57b0c9728a:
`computeConstantBound(..., /*closedUB=*/true)` ->
`computeConstantBound(..., ValueBoundsOptions{/*closedUB=*/true})`
- [#182715](llvm/llvm-project#182715) / 72f5050ae765:
`applyPatternsAndFoldGreedily(...)` -> `applyPatternsGreedily(...)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`launchOp.getWorkgroupAttributions()` ->
`launchOp.getWorkgroupAttributionBBArgs()`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea: manual
`gpu.kernel` attr -> `outlinedFunc.setKernel(true)`
- [#188905](llvm/llvm-project#188905) / c1cff89bdcea:
`setAttr(getKnown*AttrName(), ...)` ->
`setKnownBlockSizeAttr(...)` / `setKnownGridSizeAttr(...)`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir/Dialect/AMX/AMXDialect.h` -> `mlir/Dialect/X86/X86Dialect.h`
- [#111197](llvm/llvm-project#111197) / 2f743ac52e94:
`mlir::amx::AMXDialect` -> `mlir::x86::X86Dialect`
- [#167271](llvm/llvm-project#167271) / 2345b7d98f75:
`InlineSizeEstimatorAnalysis.cpp` -> removed upstream; no Buddy source-list
entry needed
- [#172680](llvm/llvm-project#172680) / 71760f324ff9:
`ExpandLargeDivRem.cpp` -> merged into `ExpandFp.cpp`
- [#172681](llvm/llvm-project#172681) / 5c05824d2bd3:
`ExpandFp.cpp` / merged `ExpandLargeDivRem.cpp` -> `ExpandIRInsts.cpp`
- [#77370](llvm/llvm-project#77370) / 5e0a06b34d09:
`ExpandMemCmp.cpp` in CodeGen -> moved to `Transforms/Scalar`
- [#181547](llvm/llvm-project#181547) / 9a0d65cdfd0d:
`CallBrPrepare.cpp` -> `InlineAsmPrepare.cpp`
- [#160454](llvm/llvm-project#160454) / aa6a33ae6556:
`EVLIndVarSimplify.cpp` -> removed upstream; no Buddy source-list entry needed
- [#192635](llvm/llvm-project#192635) / 680a9908194e:
`VPlanSLP.cpp` -> removed upstream; no Buddy source-list entry needed
- local Buddy `M0`-`M7` definitions -> upstream RISC-V `M0`-`M7` definitions
- Buddy `MatrixReg` using local mask regs -> `MatrixReg` using upstream mask regs
- IME `*N` instructions in disassembler tables -> mark affected instructions
`isCodeGenOnly = 1`
- [#156715](llvm/llvm-project#156715) / dfbd76bda01e:
`Expected<std::unique_ptr<ToolOutputFile>>` from
`setupLLVMOptimizationRemarks` -> `Expected<LLVMRemarkFileHandle>`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, F)` ->
`codegen::setFunctionAttributes(F, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#186998](llvm/llvm-project#186998) / 69cd746bd2f1:
`codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M)` ->
`codegen::setFunctionAttributes(*M, CPUStr, FeaturesStr[, TuneCPUStr])`
- [#87226](llvm/llvm-project#87226) / d0e72ccc54df:
`TargetMachine::buildCodeGenPipeline(MPM, OS, DwoOut, FileType, Opt, PIC)` ->
pass `MAM` and `MMI.getContext()`
- [#170846](llvm/llvm-project#170846) / cd806d7e7689: `buddy-llc`
without `Plugins` -> link LLVM `Plugins`
- [#150805](llvm/llvm-project#150805) / ace42cf063a5,
[#151150](llvm/llvm-project#151150) / e68a20e0b762: implicit MLIR
register-all symbols -> link `MLIRRegisterAllDialects`,
`MLIRRegisterAllExtensions`, `MLIRRegisterAllPasses`

Both passes expand instructions at the IR level.
They use the same kind of instruction visitation
logic and contain significant code duplication e.g.
for scalarization.