summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLone_Wolf2023-03-17 21:47:13 +0100
committerLone_Wolf2023-03-17 21:47:13 +0100
commitb1c5b4009aa8ba5f70547e23f310b7d9e60fcebf (patch)
treed36d74af0409d0a0fcd205055ab90a84fb306115
parent71645fe011faac8533af89d9abbc2c521b546e5b (diff)
downloadaur-b1c5b4009aa8ba5f70547e23f310b7d9e60fcebf.tar.gz
5 more reverts
-rw-r--r--.SRCINFO21
-rw-r--r--0009-ConstExpr-Remove-select-constant-expression.patch1021
-rw-r--r--0010-docs-Mention-removal-of-legacy-optimization-pipeline.patch36
-rw-r--r--0011-Fix-LLVM-Sphinx-build.patch27
-rw-r--r--0012-Passes-Remove-some-legacy-passes.patch487
-rw-r--r--0013-opt-Rename-enable-new-pm-bugpoint-enable-legacy-pm.patch176
-rw-r--r--PKGBUILD26
7 files changed, 1788 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9072d3ac3a0d..94897b15f411 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
pkgbase = llvm-minimal-git
- pkgver = 17.0.0_r454521.e4ea2d59191c
+ pkgver = 17.0.0_r455043.b1e9baea3a2c
pkgrel = 1
url = https://llvm.org/
arch = x86_64
@@ -29,6 +29,11 @@ pkgbase = llvm-minimal-git
source = 0006-llvm-c-Remove-pointee-support-from-LLVMGetElementTyp.patch
source = 0007-Passes-Remove-some-legacy-passes.patch
source = 0008-PassManagerBuilder-Remove-PassManagerBuilder.patch
+ source = 0009-ConstExpr-Remove-select-constant-expression.patch
+ source = 0010-docs-Mention-removal-of-legacy-optimization-pipeline.patch
+ source = 0011-Fix-LLVM-Sphinx-build.patch
+ source = 0012-Passes-Remove-some-legacy-passes.patch
+ source = 0013-opt-Rename-enable-new-pm-bugpoint-enable-legacy-pm.patch
md5sums = SKIP
md5sums = 295c343dcd457dc534662f011d7cff1a
md5sums = SKIP
@@ -40,6 +45,11 @@ pkgbase = llvm-minimal-git
md5sums = a4604d7858e1536af63f52dcbc47fbb8
md5sums = a09eda7d75c717aeb882fdfa67b028c3
md5sums = 6f07ebda99c0c0cab5bb2ff063e05152
+ md5sums = b43ad443cb817e1e341d25f0de6ba248
+ md5sums = 161e703a83b93d6266c47b9883e55541
+ md5sums = 8ce50e0f42ed9f4d26fff1233d21c055
+ md5sums = 5ae64f8df9f04ecba27765d2401b58b0
+ md5sums = ff35711ebdb2833fc084f077c3cdc40f
sha512sums = SKIP
sha512sums = 75e743dea28b280943b3cc7f8bbb871b57d110a7f2b9da2e6845c1c36bf170dd883fca54e463f5f49e0c3effe07fbd0db0f8cf5a12a2469d3f792af21a73fcdd
sha512sums = SKIP
@@ -51,10 +61,15 @@ pkgbase = llvm-minimal-git
sha512sums = 2f227060ab56e04bf3e74fbb785c2edf9fc55121c936ba17ac62275cacdacfb9cb84bfda0e6637e11e744e26212bbfa861fa320084502afb4b7fd247d832993b
sha512sums = 6d77c23ad97c057898d97fd08af9714ff18c43026e082ad5e654b736caffb1ba814de0ebb9a7e169de9475d819df3cd0058805e4a0f020c55ce3b2272181802a
sha512sums = 4e006cb70005a4116e8637d9dabf7d3f1668e5ad21429254b641fa9ee716c2822cc718cc91c58e29451e4ffde96d25abfd31813322b82b91f896656c05be1210
+ sha512sums = af7ee9560ac9346a9424706c1f5e7536f985c7fae74d6342429a8d865bfee529d694f6b835c5dc76952d45392f077c2d756f55d41a28075d8c999f847c5242a6
+ sha512sums = ed6ac398f3d7c141d789a700880a23ee0f7f82de87462a44941ede6ef9fea426138ce587077ded0265577c2a31b4de9ef7dfa4446be145bce8c1088092e6902b
+ sha512sums = 55036920d244f97d9e03de34558f6c20af57e26652acdb1db9f1ee5022c09984d2db2e2d71178b5440d46145ff8ff33c7fbc657195073f630a17a6e6bce42b82
+ sha512sums = 852b52175aab6eb6193e0a6a1f8a6e0031061c73158a292472b20a7ac99f00e04d4c8ac266e99c1c2d7e91d8d071dd4d6ad1737a4a2ecc31085153c44f09f9d7
+ sha512sums = 3e37d9449d74477c0fc2a6c3af37e06aba6555cc8cef83c71e74cb34e5a6ae3b6a5bc6c3fbb6b88c9cd0684e2e40ae066e1eb56337f8980a4729780bc7f9bdd3
pkgname = llvm-minimal-git
pkgdesc = Collection of modular and reusable compiler and toolchain technologies
- depends = llvm-libs-minimal-git=17.0.0_r454521.e4ea2d59191c-1
+ depends = llvm-libs-minimal-git=17.0.0_r455043.b1e9baea3a2c-1
depends = perl
optdepends = python: for using lit (LLVM Integrated Tester)
optdepends = python-setuptools: for using lit
@@ -78,7 +93,7 @@ pkgname = llvm-libs-minimal-git
pkgname = spirv-llvm-translator-minimal-git
pkgdesc = Tool and a library for bi-directional translation between SPIR-V and LLVM IR, trunk version
- depends = llvm-minimal-git=17.0.0_r454521.e4ea2d59191c-1
+ depends = llvm-minimal-git=17.0.0_r455043.b1e9baea3a2c-1
depends = spirv-tools-git
provides = spirv-llvm-translator
conflicts = spirv-llvm-translator
diff --git a/0009-ConstExpr-Remove-select-constant-expression.patch b/0009-ConstExpr-Remove-select-constant-expression.patch
new file mode 100644
index 000000000000..1ec5cbdf21de
--- /dev/null
+++ b/0009-ConstExpr-Remove-select-constant-expression.patch
@@ -0,0 +1,1021 @@
+From bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e Mon Sep 17 00:00:00 2001
+From: Nikita Popov <npopov@redhat.com>
+Date: Mon, 6 Mar 2023 10:46:22 +0100
+Subject: [PATCH] [ConstExpr] Remove select constant expression
+
+This removes the select constant expression, as part of
+https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179.
+Uses of this expressions have already been removed in advance,
+so this just removes related infrastructure and updates tests.
+
+Differential Revision: https://reviews.llvm.org/D145382
+---
+ llvm/bindings/ocaml/llvm/llvm.ml | 2 -
+ llvm/bindings/ocaml/llvm/llvm.mli | 5 --
+ llvm/bindings/ocaml/llvm/llvm_ocaml.c | 7 ---
+ llvm/docs/ReleaseNotes.rst | 11 ++++
+ llvm/include/llvm-c/Core.h | 3 -
+ llvm/include/llvm/IR/Constants.h | 6 --
+ llvm/lib/AsmParser/LLParser.cpp | 12 +---
+ llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 11 ++--
+ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 6 --
+ llvm/lib/IR/ConstantFold.cpp | 11 ----
+ llvm/lib/IR/Constants.cpp | 23 --------
+ llvm/lib/IR/ConstantsContext.h | 33 -----------
+ llvm/lib/IR/Core.cpp | 8 ---
+ .../Transforms/Scalar/InferAddressSpaces.cpp | 12 ----
+ .../ScalarEvolution/logical-operations.ll | 7 ++-
+ llvm/test/Assembler/ConstantExprFoldSelect.ll | 8 +--
+ llvm/test/Bindings/OCaml/core.ml | 5 --
+ llvm/test/Bitcode/select.ll | 18 ------
+ ...thinlto-function-summary-callgraph-cast.ll | 4 +-
+ llvm/test/Bitcode/vscale-round-trip.ll | 8 +--
+ .../GlobalISel/irtranslator-constantexpr.ll | 37 ------------
+ llvm/test/CodeGen/Generic/pr33094.ll | 6 +-
+ .../CodeGen/PowerPC/ext-bool-trunc-repl.ll | 23 +++++---
+ llvm/test/CodeGen/PowerPC/pr24636.ll | 15 ++++-
+ llvm/test/CodeGen/WebAssembly/call.ll | 7 ++-
+ .../CodeGen/X86/2008-09-19-RegAllocBug.ll | 9 +--
+ llvm/test/CodeGen/X86/no-plt.ll | 3 +-
+ llvm/test/CodeGen/X86/pr44749.ll | 10 ++--
+ .../ThinLTO/X86/funcattrs-prop-unknown.ll | 2 +-
+ .../AMDGPU/infer-address-space.ll | 6 +-
+ .../InferAddressSpaces/AMDGPU/select.ll | 58 -------------------
+ .../InstCombine/2010-03-03-ExtElim.ll | 11 +++-
+ llvm/test/Transforms/InstCombine/cast.ll | 3 +-
+ llvm/test/Transforms/InstCombine/pr28725.ll | 3 +-
+ .../InstSimplify/ConstProp/constant-expr.ll | 9 ---
+ llvm/test/Transforms/InstSimplify/pr28725.ll | 6 +-
+ llvm/unittests/Analysis/ValueTrackingTest.cpp | 5 +-
+ llvm/unittests/IR/ConstantsTest.cpp | 2 -
+ 38 files changed, 108 insertions(+), 307 deletions(-)
+ delete mode 100644 llvm/test/Bitcode/select.ll
+
+diff --git a/llvm/bindings/ocaml/llvm/llvm.ml b/llvm/bindings/ocaml/llvm/llvm.ml
+index 6962dce737d2..77de9a6e46fa 100644
+--- a/llvm/bindings/ocaml/llvm/llvm.ml
++++ b/llvm/bindings/ocaml/llvm/llvm.ml
+@@ -685,8 +685,6 @@ external const_pointercast : llvalue -> lltype -> llvalue
+ external const_intcast : llvalue -> lltype -> is_signed:bool -> llvalue
+ = "llvm_const_intcast"
+ external const_fpcast : llvalue -> lltype -> llvalue = "llvm_const_fpcast"
+-external const_select : llvalue -> llvalue -> llvalue -> llvalue
+- = "llvm_const_select"
+ external const_extractelement : llvalue -> llvalue -> llvalue
+ = "llvm_const_extractelement"
+ external const_insertelement : llvalue -> llvalue -> llvalue -> llvalue
+diff --git a/llvm/bindings/ocaml/llvm/llvm.mli b/llvm/bindings/ocaml/llvm/llvm.mli
+index 59ac5b855130..9c8b3b883e14 100644
+--- a/llvm/bindings/ocaml/llvm/llvm.mli
++++ b/llvm/bindings/ocaml/llvm/llvm.mli
+@@ -1268,11 +1268,6 @@ val const_intcast : llvalue -> lltype -> is_signed:bool -> llvalue
+ See the method [llvm::ConstantExpr::getFPCast]. *)
+ val const_fpcast : llvalue -> lltype -> llvalue
+
+-(** [const_select cond t f] returns the constant conditional which returns value
+- [t] if the boolean constant [cond] is true and the value [f] otherwise.
+- See the method [llvm::ConstantExpr::getSelect]. *)
+-val const_select : llvalue -> llvalue -> llvalue -> llvalue
+-
+ (** [const_extractelement vec i] returns the constant [i]th element of
+ constant vector [vec]. [i] must be a constant [i32] value unsigned less than
+ the size of the vector.
+diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
+index a9d25751fd2c..0154b2f49c25 100644
+--- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c
++++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
+@@ -1385,13 +1385,6 @@ value llvm_const_fpcast(value CV, value T) {
+ return to_val(Value);
+ }
+
+-/* llvalue -> llvalue -> llvalue -> llvalue */
+-value llvm_const_select(value Cond, value IfTrue, value IfFalse) {
+- LLVMValueRef Value =
+- LLVMConstSelect(Value_val(Cond), Value_val(IfTrue), Value_val(IfFalse));
+- return to_val(Value);
+-}
+-
+ /* llvalue -> llvalue -> llvalue */
+ value llvm_const_extractelement(value V, value I) {
+ LLVMValueRef Value = LLVMConstExtractElement(Value_val(V), Value_val(I));
+diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
+index 4cf01ad8e284..56da5be434eb 100644
+--- a/llvm/docs/ReleaseNotes.rst
++++ b/llvm/docs/ReleaseNotes.rst
+@@ -56,6 +56,11 @@ Changes to the LLVM IR
+ * The ``nofpclass`` attribute was introduced. This allows more
+ optimizations around special floating point value comparisons.
+
++* The constant expression variants of the following instructions have been
++ removed:
++
++ * ``select``
++
+ Changes to building LLVM
+ ------------------------
+
+@@ -151,6 +156,12 @@ Changes to the C API
+ These belonged to the no longer supported legacy pass manager.
+ * As part of the opaque pointer transition, ``LLVMGetElementType`` no longer
+ gives the pointee type of a pointer type.
++* The following functions for creating constant expressions have been removed,
++ because the underlying constant expressions are no longer supported. Instead,
++ an instruction should be created using the ``LLVMBuildXYZ`` APIs, which will
++ constant fold the operands if possible and create an instruction otherwise:
++
++ * ``LLVMConstSelect``
+
+ Changes to the FastISel infrastructure
+ --------------------------------------
+diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
+index 5454cc2d96c5..f2959ac8d22d 100644
+--- a/llvm/include/llvm-c/Core.h
++++ b/llvm/include/llvm-c/Core.h
+@@ -2257,9 +2257,6 @@ LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal,
+ LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType,
+ LLVMBool isSigned);
+ LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+-LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
+- LLVMValueRef ConstantIfTrue,
+- LLVMValueRef ConstantIfFalse);
+ LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
+ LLVMValueRef IndexConstant);
+ LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
+diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
+index e82c6a8e1eab..13d5fb218bed 100644
+--- a/llvm/include/llvm/IR/Constants.h
++++ b/llvm/include/llvm/IR/Constants.h
+@@ -1208,12 +1208,6 @@ public:
+ /// Return true if this is a compare constant expression
+ bool isCompare() const;
+
+- /// Select constant expr
+- ///
+- /// \param OnlyIfReducedTy see \a getWithOperands() docs.
+- static Constant *getSelect(Constant *C, Constant *V1, Constant *V2,
+- Type *OnlyIfReducedTy = nullptr);
+-
+ /// get - Return a binary or shift operator constant expression,
+ /// folding if possible.
+ ///
+diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
+index 8b8ba4107e71..8ee1b665c9b7 100644
+--- a/llvm/lib/AsmParser/LLParser.cpp
++++ b/llvm/lib/AsmParser/LLParser.cpp
+@@ -3882,6 +3882,8 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
+ return error(ID.Loc, "frem constexprs are no longer supported");
+ case lltok::kw_fneg:
+ return error(ID.Loc, "fneg constexprs are no longer supported");
++ case lltok::kw_select:
++ return error(ID.Loc, "select constexprs are no longer supported");
+ case lltok::kw_icmp:
+ case lltok::kw_fcmp: {
+ unsigned PredVal, Opc = Lex.getUIntVal();
+@@ -4011,8 +4013,7 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
+ case lltok::kw_getelementptr:
+ case lltok::kw_shufflevector:
+ case lltok::kw_insertelement:
+- case lltok::kw_extractelement:
+- case lltok::kw_select: {
++ case lltok::kw_extractelement: {
+ unsigned Opc = Lex.getUIntVal();
+ SmallVector<Constant*, 16> Elts;
+ bool InBounds = false;
+@@ -4091,13 +4092,6 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
+
+ ID.ConstantVal = ConstantExpr::getGetElementPtr(Ty, Elts[0], Indices,
+ InBounds, InRangeOp);
+- } else if (Opc == Instruction::Select) {
+- if (Elts.size() != 3)
+- return error(ID.Loc, "expected three operands to select");
+- if (const char *Reason = SelectInst::areInvalidOperands(Elts[0], Elts[1],
+- Elts[2]))
+- return error(ID.Loc, Reason);
+- ID.ConstantVal = ConstantExpr::getSelect(Elts[0], Elts[1], Elts[2]);
+ } else if (Opc == Instruction::ShuffleVector) {
+ if (Elts.size() != 3)
+ return error(ID.Loc, "expected three operands to shufflevector");
+diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+index dd75542164d3..64616240d4a3 100644
+--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
++++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+@@ -1417,7 +1417,13 @@ static bool isConstExprSupported(const BitcodeConstant *BC) {
+ if (Opcode == Instruction::GetElementPtr)
+ return ConstantExpr::isSupportedGetElementPtr(BC->SrcElemTy);
+
+- return Opcode != Instruction::FNeg;
++ switch (Opcode) {
++ case Instruction::FNeg:
++ case Instruction::Select:
++ return false;
++ default:
++ return true;
++ }
+ }
+
+ Expected<Value *> BitcodeReader::materializeValue(unsigned StartValID,
+@@ -1549,9 +1555,6 @@ Expected<Value *> BitcodeReader::materializeValue(unsigned StartValID,
+ ArrayRef(ConstOps).drop_front(),
+ BC->Flags, BC->getInRangeIndex());
+ break;
+- case Instruction::Select:
+- C = ConstantExpr::getSelect(ConstOps[0], ConstOps[1], ConstOps[2]);
+- break;
+ case Instruction::ExtractElement:
+ C = ConstantExpr::getExtractElement(ConstOps[0], ConstOps[1]);
+ break;
+diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+index 51756eb8ecb0..a368ac303bd9 100644
+--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
++++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+@@ -2676,12 +2676,6 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal,
+ }
+ break;
+ }
+- case Instruction::Select:
+- Code = bitc::CST_CODE_CE_SELECT;
+- Record.push_back(VE.getValueID(C->getOperand(0)));
+- Record.push_back(VE.getValueID(C->getOperand(1)));
+- Record.push_back(VE.getValueID(C->getOperand(2)));
+- break;
+ case Instruction::ExtractElement:
+ Code = bitc::CST_CODE_CE_EXTRACTELT;
+ Record.push_back(VE.getTypeID(C->getOperand(0)->getType()));
+diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
+index 553bc1e277e3..59131a4264fc 100644
+--- a/llvm/lib/IR/ConstantFold.cpp
++++ b/llvm/lib/IR/ConstantFold.cpp
+@@ -593,17 +593,6 @@ Constant *llvm::ConstantFoldSelectInstruction(Constant *Cond,
+ if (isa<UndefValue>(V1) && NotPoison(V2)) return V2;
+ if (isa<UndefValue>(V2) && NotPoison(V1)) return V1;
+
+- if (ConstantExpr *TrueVal = dyn_cast<ConstantExpr>(V1)) {
+- if (TrueVal->getOpcode() == Instruction::Select)
+- if (TrueVal->getOperand(0) == Cond)
+- return ConstantExpr::getSelect(Cond, TrueVal->getOperand(1), V2);
+- }
+- if (ConstantExpr *FalseVal = dyn_cast<ConstantExpr>(V2)) {
+- if (FalseVal->getOpcode() == Instruction::Select)
+- if (FalseVal->getOperand(0) == Cond)
+- return ConstantExpr::getSelect(Cond, V1, FalseVal->getOperand(2));
+- }
+-
+ return nullptr;
+ }
+
+diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
+index 9348d1af65a4..51ad3a12c488 100644
+--- a/llvm/lib/IR/Constants.cpp
++++ b/llvm/lib/IR/Constants.cpp
+@@ -547,8 +547,6 @@ void llvm::deleteConstant(Constant *C) {
+ delete static_cast<CastConstantExpr *>(C);
+ else if (isa<BinaryConstantExpr>(C))
+ delete static_cast<BinaryConstantExpr *>(C);
+- else if (isa<SelectConstantExpr>(C))
+- delete static_cast<SelectConstantExpr *>(C);
+ else if (isa<ExtractElementConstantExpr>(C))
+ delete static_cast<ExtractElementConstantExpr *>(C);
+ else if (isa<InsertElementConstantExpr>(C))
+@@ -1488,8 +1486,6 @@ Constant *ConstantExpr::getWithOperands(ArrayRef<Constant *> Ops, Type *Ty,
+ case Instruction::BitCast:
+ case Instruction::AddrSpaceCast:
+ return ConstantExpr::getCast(getOpcode(), Ops[0], Ty, OnlyIfReduced);
+- case Instruction::Select:
+- return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2], OnlyIfReducedTy);
+ case Instruction::InsertElement:
+ return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2],
+ OnlyIfReducedTy);
+@@ -2441,23 +2437,6 @@ Constant *ConstantExpr::getCompare(unsigned short Predicate, Constant *C1,
+ }
+ }
+
+-Constant *ConstantExpr::getSelect(Constant *C, Constant *V1, Constant *V2,
+- Type *OnlyIfReducedTy) {
+- assert(!SelectInst::areInvalidOperands(C, V1, V2)&&"Invalid select operands");
+-
+- if (Constant *SC = ConstantFoldSelectInstruction(C, V1, V2))
+- return SC; // Fold common cases
+-
+- if (OnlyIfReducedTy == V1->getType())
+- return nullptr;
+-
+- Constant *ArgVec[] = { C, V1, V2 };
+- ConstantExprKeyType Key(Instruction::Select, ArgVec);
+-
+- LLVMContextImpl *pImpl = C->getContext().pImpl;
+- return pImpl->ExprConstants.getOrCreate(V1->getType(), Key);
+-}
+-
+ Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C,
+ ArrayRef<Value *> Idxs, bool InBounds,
+ std::optional<unsigned> InRangeIndex,
+@@ -3439,8 +3418,6 @@ Instruction *ConstantExpr::getAsInstruction(Instruction *InsertBefore) const {
+ case Instruction::AddrSpaceCast:
+ return CastInst::Create((Instruction::CastOps)getOpcode(), Ops[0],
+ getType(), "", InsertBefore);
+- case Instruction::Select:
+- return SelectInst::Create(Ops[0], Ops[1], Ops[2], "", InsertBefore);
+ case Instruction::InsertElement:
+ return InsertElementInst::Create(Ops[0], Ops[1], Ops[2], "", InsertBefore);
+ case Instruction::ExtractElement:
+diff --git a/llvm/lib/IR/ConstantsContext.h b/llvm/lib/IR/ConstantsContext.h
+index fbda443de7b2..6023216a5070 100644
+--- a/llvm/lib/IR/ConstantsContext.h
++++ b/llvm/lib/IR/ConstantsContext.h
+@@ -90,32 +90,6 @@ public:
+ }
+ };
+
+-/// SelectConstantExpr - This class is private to Constants.cpp, and is used
+-/// behind the scenes to implement select constant exprs.
+-class SelectConstantExpr final : public ConstantExpr {
+-public:
+- SelectConstantExpr(Constant *C1, Constant *C2, Constant *C3)
+- : ConstantExpr(C2->getType(), Instruction::Select, &Op<0>(), 3) {
+- Op<0>() = C1;
+- Op<1>() = C2;
+- Op<2>() = C3;
+- }
+-
+- // allocate space for exactly three operands
+- void *operator new(size_t S) { return User::operator new(S, 3); }
+- void operator delete(void *Ptr) { User::operator delete(Ptr); }
+-
+- /// Transparently provide more efficient getOperand methods.
+- DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+-
+- static bool classof(const ConstantExpr *CE) {
+- return CE->getOpcode() == Instruction::Select;
+- }
+- static bool classof(const Value *V) {
+- return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V));
+- }
+-};
+-
+ /// ExtractElementConstantExpr - This class is private to
+ /// Constants.cpp, and is used behind the scenes to implement
+ /// extractelement constant exprs.
+@@ -279,11 +253,6 @@ struct OperandTraits<BinaryConstantExpr>
+ : public FixedNumOperandTraits<BinaryConstantExpr, 2> {};
+ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryConstantExpr, Value)
+
+-template <>
+-struct OperandTraits<SelectConstantExpr>
+- : public FixedNumOperandTraits<SelectConstantExpr, 3> {};
+-DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectConstantExpr, Value)
+-
+ template <>
+ struct OperandTraits<ExtractElementConstantExpr>
+ : public FixedNumOperandTraits<ExtractElementConstantExpr, 2> {};
+@@ -523,8 +492,6 @@ public:
+ return new BinaryConstantExpr(Opcode, Ops[0], Ops[1],
+ SubclassOptionalData);
+ llvm_unreachable("Invalid ConstantExpr!");
+- case Instruction::Select:
+- return new SelectConstantExpr(Ops[0], Ops[1], Ops[2]);
+ case Instruction::ExtractElement:
+ return new ExtractElementConstantExpr(Ops[0], Ops[1]);
+ case Instruction::InsertElement:
+diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
+index 85b7d17ef56c..283296b639ff 100644
+--- a/llvm/lib/IR/Core.cpp
++++ b/llvm/lib/IR/Core.cpp
+@@ -1799,14 +1799,6 @@ LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
+ unwrap(ToType)));
+ }
+
+-LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
+- LLVMValueRef ConstantIfTrue,
+- LLVMValueRef ConstantIfFalse) {
+- return wrap(ConstantExpr::getSelect(unwrap<Constant>(ConstantCondition),
+- unwrap<Constant>(ConstantIfTrue),
+- unwrap<Constant>(ConstantIfFalse)));
+-}
+-
+ LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
+ LLVMValueRef IndexConstant) {
+ return wrap(ConstantExpr::getExtractElement(unwrap<Constant>(VectorConstant),
+diff --git a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
+index 114738a35fd1..b6713730bfa9 100644
+--- a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
++++ b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
+@@ -694,18 +694,6 @@ static Value *cloneConstantExprWithNewAddressSpace(
+ return ConstantExpr::getAddrSpaceCast(CE, TargetType);
+ }
+
+- if (CE->getOpcode() == Instruction::Select) {
+- Constant *Src0 = CE->getOperand(1);
+- Constant *Src1 = CE->getOperand(2);
+- if (Src0->getType()->getPointerAddressSpace() ==
+- Src1->getType()->getPointerAddressSpace()) {
+-
+- return ConstantExpr::getSelect(
+- CE->getOperand(0), ConstantExpr::getAddrSpaceCast(Src0, TargetType),
+- ConstantExpr::getAddrSpaceCast(Src1, TargetType));
+- }
+- }
+-
+ if (CE->getOpcode() == Instruction::IntToPtr) {
+ assert(isNoopPtrIntCastPair(cast<Operator>(CE), *DL, TTI));
+ Constant *Src = cast<ConstantExpr>(CE->getOperand(0))->getOperand(0);
+diff --git a/llvm/test/Analysis/ScalarEvolution/logical-operations.ll b/llvm/test/Analysis/ScalarEvolution/logical-operations.ll
+index e14f47f0e15a..d557f50326d5 100644
+--- a/llvm/test/Analysis/ScalarEvolution/logical-operations.ll
++++ b/llvm/test/Analysis/ScalarEvolution/logical-operations.ll
+@@ -410,11 +410,14 @@ define ptr @select_between_constantptrs(i1 %c, ptr %x) {
+ define ptr @tautological_select() {
+ ; CHECK-LABEL: 'tautological_select'
+ ; CHECK-NEXT: Classifying expressions for: @tautological_select
+-; CHECK-NEXT: %r = getelementptr i8, ptr @constant, i32 0
++; CHECK-NEXT: %s = select i1 true, ptr @constant, ptr @another_constant
++; CHECK-NEXT: --> @constant U: [0,-3) S: [-9223372036854775808,9223372036854775805)
++; CHECK-NEXT: %r = getelementptr i8, ptr %s
+ ; CHECK-NEXT: --> @constant U: [0,-3) S: [-9223372036854775808,9223372036854775805)
+ ; CHECK-NEXT: Determining loop execution counts for: @tautological_select
+ ;
+- %r = getelementptr i8, ptr select (i1 true, ptr @constant, ptr @another_constant), i32 0
++ %s = select i1 true, ptr @constant, ptr @another_constant
++ %r = getelementptr i8, ptr %s
+ ret ptr %r
+ }
+
+diff --git a/llvm/test/Assembler/ConstantExprFoldSelect.ll b/llvm/test/Assembler/ConstantExprFoldSelect.ll
+index 5d218a9570b9..1ece1f87c340 100644
+--- a/llvm/test/Assembler/ConstantExprFoldSelect.ll
++++ b/llvm/test/Assembler/ConstantExprFoldSelect.ll
+@@ -1,9 +1,9 @@
+-; RUN: llvm-as < %s | llvm-dis | FileCheck %s
++; RUN: opt -S -passes=instsimplify < %s | FileCheck %s
+ ; RUN: verify-uselistorder %s
+ ; PR18319
+
+-define void @function() {
+- %c = trunc <4 x i16> select (<4 x i1> <i1 undef, i1 undef, i1 false, i1 true>, <4 x i16> <i16 undef, i16 2, i16 3, i16 4>, <4 x i16> <i16 -1, i16 -2, i16 -3, i16 -4>) to <4 x i8>
++define <4 x i16> @function() {
++ %s = select <4 x i1> <i1 undef, i1 undef, i1 false, i1 true>, <4 x i16> <i16 undef, i16 2, i16 3, i16 4>, <4 x i16> <i16 -1, i16 -2, i16 -3, i16 -4>
+ ; CHECK: <i16 undef, i16 -2, i16 -3, i16 4>
+- ret void
++ ret <4 x i16> %s
+ }
+diff --git a/llvm/test/Bindings/OCaml/core.ml b/llvm/test/Bindings/OCaml/core.ml
+index 33841deb42cf..d2dd52c07608 100644
+--- a/llvm/test/Bindings/OCaml/core.ml
++++ b/llvm/test/Bindings/OCaml/core.ml
+@@ -333,7 +333,6 @@ let test_constants () =
+ group "misc constants";
+ (* CHECK: const_size_of{{.*}}getelementptr{{.*}}null
+ * CHECK: const_gep{{.*}}getelementptr
+- * CHECK: const_select{{.*}}select
+ * CHECK: const_extractelement{{.*}}extractelement
+ * CHECK: const_insertelement{{.*}}insertelement
+ * CHECK: const_shufflevector = global <4 x i32> <i32 0, i32 1, i32 1, i32 0>
+@@ -341,10 +340,6 @@ let test_constants () =
+ ignore (define_global "const_size_of" (size_of (pointer_type context)) m);
+ ignore (define_global "const_gep" (const_gep i8_type foldbomb_gv [| five |])
+ m);
+- ignore (define_global "const_select" (const_select
+- (const_icmp Icmp.Sle foldbomb five)
+- (const_int i8_type (-1))
+- (const_int i8_type 0)) m);
+ let zero = const_int i32_type 0 in
+ let one = const_int i32_type 1 in
+ ignore (define_global "const_extractelement" (const_extractelement
+diff --git a/llvm/test/Bitcode/select.ll b/llvm/test/Bitcode/select.ll
+deleted file mode 100644
+index 7e62361822a8..000000000000
+--- a/llvm/test/Bitcode/select.ll
++++ /dev/null
+@@ -1,18 +0,0 @@
+-; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+-; RUN: verify-uselistorder < %s
+-
+-define <2 x i32> @main() {
+- ret <2 x i32> select (<2 x i1> <i1 false, i1 undef>, <2 x i32> zeroinitializer, <2 x i32> <i32 0, i32 undef>)
+-}
+-
+-; CHECK: define <2 x i32> @main() {
+-; CHECK: ret <2 x i32> <i32 0, i32 undef>
+-; CHECK: }
+-
+-define <2 x float> @f() {
+- ret <2 x float> select (i1 ptrtoint (<2 x float> ()* @f to i1), <2 x float> <float 1.000000e+00, float 0.000000e+00>, <2 x float> zeroinitializer)
+-}
+-
+-; CHECK: define <2 x float> @f() {
+-; CHECK: ret <2 x float> select (i1 ptrtoint (ptr @f to i1), <2 x float> <float 1.000000e+00, float 0.000000e+00>, <2 x float> zeroinitializer)
+-; CHECK: }
+diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-cast.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-cast.ll
+index 1926603b8b1f..4d52edd6a085 100644
+--- a/llvm/test/Bitcode/thinlto-function-summary-callgraph-cast.ll
++++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-cast.ll
+@@ -9,7 +9,7 @@
+ ; "op7" is a call to "callee" function.
+ ; CHECK-NEXT: <PERMODULE {{.*}} op7=3 op8=[[ALIASID:[0-9]+]]/>
+ ; "another_caller" has only references but no calls.
+-; CHECK-NEXT: <PERMODULE {{.*}} op4=3 {{.*}} op9={{[0-9]+}}/>
++; CHECK-NEXT: <PERMODULE {{.*}}/>
+ ; CHECK-NEXT: <PERMODULE {{.*}} op0=[[ALIASEEID:[0-9]+]]
+ ; CHECK-NEXT: <ALIAS {{.*}} op0=[[ALIASID]] {{.*}} op2=[[ALIASEEID]]/>
+ ; CHECK-NEXT: <BLOCK_COUNT op0=3/>
+@@ -27,7 +27,7 @@ define void @caller() {
+
+ define void @another_caller() {
+ ; Test calls that aren't handled either as direct or indirect.
+- call void select (i1 icmp eq (ptr @global, ptr null), ptr @f, ptr @g)()
++ call void getelementptr (i8, ptr @f, i64 ptrtoint (ptr @g to i64))()
+ ret void
+ }
+
+diff --git a/llvm/test/Bitcode/vscale-round-trip.ll b/llvm/test/Bitcode/vscale-round-trip.ll
+index 62a3479a3724..1962e90fa464 100644
+--- a/llvm/test/Bitcode/vscale-round-trip.ll
++++ b/llvm/test/Bitcode/vscale-round-trip.ll
+@@ -36,14 +36,14 @@ define <vscale x 4 x i32> @non_const_shufflevector(<vscale x 4 x i32> %lhs,
+ }
+
+ ; CHECK-LABEL: define <vscale x 4 x i32> @const_select()
+-; CHECK: <vscale x 4 x i32> select (<vscale x 4 x i1>
++; CHECK: select <vscale x 4 x i1>
+
+ define <vscale x 4 x i32> @const_select() {
+- ret <vscale x 4 x i32> select
+- (<vscale x 4 x i1> insertelement
++ %s = select <vscale x 4 x i1> insertelement
+ (<vscale x 4 x i1> undef,
+ i1 icmp ne (i32* @important_val, i32* null),
+ i32 0),
+ <vscale x 4 x i32> zeroinitializer,
+- <vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 1, i32 0))
++ <vscale x 4 x i32> insertelement (<vscale x 4 x i32> undef, i32 1, i32 0)
++ ret <vscale x 4 x i32> %s
+ }
+diff --git a/llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-constantexpr.ll b/llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-constantexpr.ll
+index 6a0975f7fa72..9f96b1d0d719 100644
+--- a/llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-constantexpr.ll
++++ b/llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-constantexpr.ll
+@@ -20,43 +20,6 @@ define i32 @test() {
+ ret i32 bitcast (<1 x i32> <i32 extractelement (<1 x i32> bitcast (i32 zext (i1 icmp eq (ptr @var, ptr inttoptr (i32 -1 to ptr)) to i32) to <1 x i32>), i64 0)> to i32)
+ }
+
+-@gint = external addrspace(1) global i8, align 4
+-
+-; Technically we should be able to fold away the compare to true, but
+-; currently constexpr doesn't understand null in non-0 address spaces.
+-define amdgpu_kernel void @constantexpr_select_0() {
+- ; CHECK-LABEL: name: constantexpr_select_0
+- ; CHECK: bb.1 (%ir-block.0):
+- ; CHECK-NEXT: [[GV:%[0-9]+]]:_(p1) = G_GLOBAL_VALUE @gint
+- ; CHECK-NEXT: [[C:%[0-9]+]]:_(p1) = G_CONSTANT i64 0
+- ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[GV]](p1), [[C]]
+- ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
+- ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
+- ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[C1]], [[C2]]
+- ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(p1) = G_IMPLICIT_DEF
+- ; CHECK-NEXT: G_STORE [[SELECT]](s32), [[DEF]](p1) :: (store (s32) into `ptr addrspace(1) undef`, addrspace 1)
+- ; CHECK-NEXT: S_ENDPGM 0
+- store i32 select (i1 icmp eq (ptr addrspace(1) @gint, ptr addrspace(1) null), i32 1, i32 0), ptr addrspace(1) undef, align 4
+- ret void
+-}
+-
+-define amdgpu_kernel void @constantexpr_select_1() {
+- ; CHECK-LABEL: name: constantexpr_select_1
+- ; CHECK: bb.1 (%ir-block.0):
+- ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1024
+- ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p1) = G_INTTOPTR [[C]](s64)
+- ; CHECK-NEXT: [[GV:%[0-9]+]]:_(p1) = G_GLOBAL_VALUE @gint
+- ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[INTTOPTR]](p1), [[GV]]
+- ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
+- ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
+- ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[C1]], [[C2]]
+- ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(p1) = G_IMPLICIT_DEF
+- ; CHECK-NEXT: G_STORE [[SELECT]](s32), [[DEF]](p1) :: (store (s32) into `ptr addrspace(1) undef`, addrspace 1)
+- ; CHECK-NEXT: S_ENDPGM 0
+- store i32 select (i1 icmp eq (ptr addrspace(1) @gint, ptr addrspace(1) inttoptr (i64 1024 to ptr addrspace(1))), i32 1, i32 0), ptr addrspace(1) undef, align 4
+- ret void
+-}
+-
+ @a = external global [2 x i32], align 4
+
+ define i32 @test_fcmp_constexpr() {
+diff --git a/llvm/test/CodeGen/Generic/pr33094.ll b/llvm/test/CodeGen/Generic/pr33094.ll
+index f1cf67b0ae63..cd98ec3b139b 100644
+--- a/llvm/test/CodeGen/Generic/pr33094.ll
++++ b/llvm/test/CodeGen/Generic/pr33094.ll
+@@ -12,8 +12,8 @@
+ @B_Inst = global %B zeroinitializer
+
+ define i64 @foo() {
+- %e = extractvalue %Tuple select (i1 icmp eq
+- (ptr @A_Inst, ptr @B_Inst),
+- %Tuple { i64 33 }, %Tuple { i64 42 }), 0
++ %s = select i1 icmp eq (ptr @A_Inst, ptr @B_Inst),
++ %Tuple { i64 33 }, %Tuple { i64 42 }
++ %e = extractvalue %Tuple %s, 0
+ ret i64 %e
+ }
+diff --git a/llvm/test/CodeGen/PowerPC/ext-bool-trunc-repl.ll b/llvm/test/CodeGen/PowerPC/ext-bool-trunc-repl.ll
+index b12414e159a7..a64354222fa7 100644
+--- a/llvm/test/CodeGen/PowerPC/ext-bool-trunc-repl.ll
++++ b/llvm/test/CodeGen/PowerPC/ext-bool-trunc-repl.ll
+@@ -11,26 +11,35 @@ define void @fn2() #0 {
+
+ br i1 undef, label %1, label %10
+
+-; <label>:1: ; preds = %0
++1: ; preds = %0
+ br i1 undef, label %3, label %2
+
+-; <label>:2: ; preds = %2, %1
++2: ; preds = %2, %1
+ br i1 undef, label %3, label %2
+
+-; <label>:3: ; preds = %2, %1
++3: ; preds = %2, %1
+ br i1 undef, label %8, label %4
+
+-; <label>:4: ; preds = %4, %3
++4: ; preds = %4, %3
+ %5 = phi i64 [ %6, %4 ], [ undef, %3 ]
+- %6 = and i64 %5, and (i64 and (i64 and (i64 and (i64 and (i64 and (i64 and (i64 sext (i32 select (i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)) to i64), i64 sext (i32 select (i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)) to i64)), i64 sext (i32 select (i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)) to i64)), i64 sext (i32 select (i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)) to i64)), i64 sext (i32 select (i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)) to i64)), i64 sext (i32 select (i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)) to i64)), i64 sext (i32 select (i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)) to i64)), i64 sext (i32 select (i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)) to i64))
++ %constexpr = select i1 icmp slt (i16 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i16), i16 0), i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 lshr (i32 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), ptr @c) to i32), i32 6)
++ %constexpr1 = sext i32 %constexpr to i64
++ %constexpr2 = and i64 %constexpr1, %constexpr1
++ %constexpr3 = and i64 %constexpr2, %constexpr1
++ %constexpr4 = and i64 %constexpr3, %constexpr1
++ %constexpr5 = and i64 %constexpr4, %constexpr1
++ %constexpr6 = and i64 %constexpr5, %constexpr1
++ %constexpr7 = and i64 %constexpr6, %constexpr1
++ %constexpr8 = and i64 %constexpr7, %constexpr1
++ %6 = and i64 %5, %constexpr8
+ %7 = icmp slt i32 undef, 6
+ br i1 %7, label %4, label %8
+
+-; <label>:8: ; preds = %4, %3
++8: ; preds = %4, %3
+ %9 = phi i64 [ undef, %3 ], [ %6, %4 ]
+ br label %10
+
+-; <label>:10: ; preds = %8, %0
++10: ; preds = %8, %0
+ ret void
+ }
+
+diff --git a/llvm/test/CodeGen/PowerPC/pr24636.ll b/llvm/test/CodeGen/PowerPC/pr24636.ll
+index d423e6a053f0..bb13a7aa6c2d 100644
+--- a/llvm/test/CodeGen/PowerPC/pr24636.ll
++++ b/llvm/test/CodeGen/PowerPC/pr24636.ll
+@@ -2,7 +2,7 @@
+ target datalayout = "e-m:e-i64:64-n32:64"
+ target triple = "powerpc64le-unknown-linux-gnu"
+
+-@c = external global i32, align 4
++@c = external unnamed_addr global i32, align 4
+ @b = external global [1 x i32], align 4
+
+ ; Function Attrs: nounwind
+@@ -25,7 +25,16 @@ define void @fn2() #0 align 4 {
+
+ .lr.ph.split.split: ; preds = %.lr.ph.split.split, %.lr.ph.split
+ %1 = phi i32 [ %2, %.lr.ph.split.split ], [ undef, %.lr.ph.split ]
+- %2 = and i32 %1, and (i32 and (i32 and (i32 and (i32 and (i32 and (i32 and (i32 zext (i1 select (i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false) to i32), i32 zext (i1 select (i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false) to i32)), i32 zext (i1 select (i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false) to i32)), i32 zext (i1 select (i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false) to i32)), i32 zext (i1 select (i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false) to i32)), i32 zext (i1 select (i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false) to i32)), i32 zext (i1 select (i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false) to i32)), i32 zext (i1 select (i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false) to i32))
++ %constexpr = select i1 icmp eq (ptr @c, ptr @b), i1 true, i1 false
++ %constexpr1 = zext i1 %constexpr to i32
++ %constexpr2 = and i32 %constexpr1, %constexpr1
++ %constexpr3 = and i32 %constexpr2, %constexpr1
++ %constexpr4 = and i32 %constexpr3, %constexpr1
++ %constexpr5 = and i32 %constexpr4, %constexpr1
++ %constexpr6 = and i32 %constexpr5, %constexpr1
++ %constexpr7 = and i32 %constexpr6, %constexpr1
++ %constexpr8 = and i32 %constexpr7, %constexpr1
++ %2 = and i32 %1, %constexpr8
+ %3 = icmp slt i32 undef, 4
+ br i1 %3, label %.lr.ph.split.split, label %._crit_edge
+
+@@ -33,7 +42,7 @@ define void @fn2() #0 align 4 {
+ %.lcssa = phi i32 [ undef, %.lr.ph.split ], [ %2, %.lr.ph.split.split ]
+ br label %4
+
+-; <label>:4 ; preds = %._crit_edge, %0
++4: ; preds = %._crit_edge, %0
+ ret void
+ }
+
+diff --git a/llvm/test/CodeGen/WebAssembly/call.ll b/llvm/test/CodeGen/WebAssembly/call.ll
+index 0fcc2bed2463..6e7a97118bc9 100644
+--- a/llvm/test/CodeGen/WebAssembly/call.ll
++++ b/llvm/test/CodeGen/WebAssembly/call.ll
+@@ -216,7 +216,10 @@ define void @coldcc_tail_call_void_nullary() {
+ ; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 2{{$}}
+ ; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, 3{{$}}
+ ; CHECK-NEXT: call .Lvararg_func_bitcast, $pop[[L0]], $pop[[L1]]{{$}}
+-; CHECK-NEXT: call other_void_nullary{{$}}
++; CHECK-NEXT: i32.const $push[[L3:[0-9]+]]=, void_nullary{{$}}
++; CHECK-NEXT: i32.const $push[[L2:[0-9]+]]=, other_void_nullary{{$}}
++; CHECK-NEXT: i32.add $push[[L4:[0-9]+]]=, $pop[[L3]], $pop[[L2]]{{$}}
++; CHECK-NEXT: call_indirect $pop[[L4]]{{$}}
+ ; CHECK-NEXT: call void_nullary{{$}}
+ ; CHECK-NEXT: return{{$}}
+ declare void @vararg_func(...)
+@@ -226,7 +229,7 @@ bb0:
+ call void @vararg_func(i32 2, i32 3)
+ br label %bb1
+ bb1:
+- call void select (i1 0, ptr @void_nullary, ptr @other_void_nullary)()
++ call void getelementptr (i8, ptr @void_nullary, i32 ptrtoint (ptr @other_void_nullary to i32))()
+ br label %bb2
+ bb2:
+ call void inttoptr (i32 ptrtoint (ptr @void_nullary to i32) to ptr)()
+diff --git a/llvm/test/CodeGen/X86/2008-09-19-RegAllocBug.ll b/llvm/test/CodeGen/X86/2008-09-19-RegAllocBug.ll
+index 61b54ee271c2..f027f3aa77d7 100644
+--- a/llvm/test/CodeGen/X86/2008-09-19-RegAllocBug.ll
++++ b/llvm/test/CodeGen/X86/2008-09-19-RegAllocBug.ll
+@@ -9,10 +9,11 @@ entry:
+ %1 = trunc i32 %0 to i8 ; <i8> [#uses=1]
+ %2 = sub i8 1, %1 ; <i8> [#uses=1]
+ %3 = sext i8 %2 to i32 ; <i32> [#uses=1]
+- %.0 = ashr i32 %3, select (i1 icmp ne (i8 zext (i1 icmp ugt (i32 ptrtoint (ptr @func_4 to i32), i32 3) to i8), i8 0), i32 0, i32 ptrtoint (ptr @func_4 to i32)) ; <i32> [#uses=1]
+- %4 = urem i32 %0, %.0 ; <i32> [#uses=1]
+- %5 = icmp eq i32 %4, 0 ; <i1> [#uses=1]
+- br i1 %5, label %return, label %bb4
++ %s = select i1 icmp ne (i8 zext (i1 icmp ugt (i32 ptrtoint (ptr @func_4 to i32), i32 3) to i8), i8 0), i32 0, i32 ptrtoint (ptr @func_4 to i32)
++ %ashr = ashr i32 %3, %s
++ %urem = urem i32 %0, %ashr
++ %cmp = icmp eq i32 %urem, 0
++ br i1 %cmp, label %return, label %bb4
+
+ bb4: ; preds = %entry
+ ret i32 undef
+diff --git a/llvm/test/CodeGen/X86/no-plt.ll b/llvm/test/CodeGen/X86/no-plt.ll
+index d6285a828a3b..807731cea314 100644
+--- a/llvm/test/CodeGen/X86/no-plt.ll
++++ b/llvm/test/CodeGen/X86/no-plt.ll
+@@ -5,7 +5,8 @@
+
+ define i32 @fp_weakfunc() {
+ ; X64: weakfunc@GOTPCREL(%rip)
+- ret i32 select (i1 icmp ne (ptr @weakfunc, ptr null), i32 1, i32 0)
++ %s = select i1 icmp ne (ptr @weakfunc, ptr null), i32 1, i32 0
++ ret i32 %s
+ }
+ declare extern_weak i32 @weakfunc() nonlazybind
+
+diff --git a/llvm/test/CodeGen/X86/pr44749.ll b/llvm/test/CodeGen/X86/pr44749.ll
+index b2c0e17fc668..cc9963dc2d8c 100644
+--- a/llvm/test/CodeGen/X86/pr44749.ll
++++ b/llvm/test/CodeGen/X86/pr44749.ll
+@@ -14,9 +14,9 @@ define i32 @a() {
+ ; CHECK-NEXT: subq $-1, %rax
+ ; CHECK-NEXT: setne %al
+ ; CHECK-NEXT: movzbl %al, %eax
+-; CHECK-NEXT: movl %eax, %ecx
+-; CHECK-NEXT: leaq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %rax
+-; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
++; CHECK-NEXT: cvtsi2sd %eax, %xmm0
++; CHECK-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
++; CHECK-NEXT: subsd %xmm2, %xmm0
+ ; CHECK-NEXT: movsd {{.*#+}} xmm3 = mem[0],zero
+ ; CHECK-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
+ ; CHECK-NEXT: cmplesd %xmm1, %xmm0
+@@ -30,7 +30,9 @@ define i32 @a() {
+ entry:
+ %call = call i32 (...) @b()
+ %conv = sitofp i32 %call to double
+- %fsub = fsub double sitofp (i32 select (i1 icmp ne (ptr getelementptr (i8, ptr @calloc, i64 1), ptr null), i32 1, i32 0) to double), 1.000000e+02
++ %sel = select i1 icmp ne (ptr getelementptr (i8, ptr @calloc, i64 1), ptr null), i32 1, i32 0
++ %sitofp = sitofp i32 %sel to double
++ %fsub = fsub double %sitofp, 1.000000e+02
+ %cmp = fcmp ole double %fsub, %conv
+ %cond = select i1 %cmp, double 1.000000e+00, double 3.140000e+00
+ %conv2 = fptosi double %cond to i32
+diff --git a/llvm/test/ThinLTO/X86/funcattrs-prop-unknown.ll b/llvm/test/ThinLTO/X86/funcattrs-prop-unknown.ll
+index f6f2dc8b1e82..48fa8f6bbffe 100644
+--- a/llvm/test/ThinLTO/X86/funcattrs-prop-unknown.ll
++++ b/llvm/test/ThinLTO/X86/funcattrs-prop-unknown.ll
+@@ -26,7 +26,7 @@ entry:
+ ; CHECK: define void @selectcallee() {
+ define void @selectcallee() {
+ ; Test calls that aren't handled either as direct or indirect.
+- call void select (i1 icmp eq (ptr @global, ptr null), ptr @f, ptr @g)()
++ call void getelementptr (i8, ptr @f, i64 ptrtoint (ptr @g to i64))()
+ ret void
+ }
+
+diff --git a/llvm/test/Transforms/InferAddressSpaces/AMDGPU/infer-address-space.ll b/llvm/test/Transforms/InferAddressSpaces/AMDGPU/infer-address-space.ll
+index 57935cf7df14..72109d0cff43 100644
+--- a/llvm/test/Transforms/InferAddressSpaces/AMDGPU/infer-address-space.ll
++++ b/llvm/test/Transforms/InferAddressSpaces/AMDGPU/infer-address-space.ll
+@@ -166,10 +166,12 @@ exit: ; preds = %loop
+ }
+
+ ; CHECK-LABEL: @select_bug(
+-; CHECK: %add.ptr157 = getelementptr inbounds i64, ptr undef, i64 select (i1 icmp ne (ptr inttoptr (i64 4873 to ptr), ptr null), i64 73, i64 93)
++; CHECK: %sel = select i1 icmp ne (ptr inttoptr (i64 4873 to ptr), ptr null), i64 73, i64 93
++; CHECK: %add.ptr157 = getelementptr inbounds i64, ptr undef, i64 %sel
+ ; CHECK: %cmp169 = icmp uge ptr undef, %add.ptr157
+ define void @select_bug() #0 {
+- %add.ptr157 = getelementptr inbounds i64, ptr undef, i64 select (i1 icmp ne (ptr inttoptr (i64 4873 to ptr), ptr null), i64 73, i64 93)
++ %sel = select i1 icmp ne (ptr inttoptr (i64 4873 to ptr), ptr null), i64 73, i64 93
++ %add.ptr157 = getelementptr inbounds i64, ptr undef, i64 %sel
+ %cmp169 = icmp uge ptr undef, %add.ptr157
+ unreachable
+ }
+diff --git a/llvm/test/Transforms/InferAddressSpaces/AMDGPU/select.ll b/llvm/test/Transforms/InferAddressSpaces/AMDGPU/select.ll
+index 5562843a7dbf..9495c5566b36 100644
+--- a/llvm/test/Transforms/InferAddressSpaces/AMDGPU/select.ll
++++ b/llvm/test/Transforms/InferAddressSpaces/AMDGPU/select.ll
+@@ -54,22 +54,6 @@ define amdgpu_kernel void @store_select_mismatch_group_private_flat(i1 %c, ptr a
+ @lds0 = internal addrspace(3) global i32 123, align 4
+ @lds1 = internal addrspace(3) global i32 456, align 4
+
+-; CHECK-LABEL: @constexpr_select_group_flat(
+-; CHECK: %tmp = load i32, ptr addrspace(3) select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspace(3) @lds0, ptr addrspace(3) @lds1)
+-define i32 @constexpr_select_group_flat() #0 {
+-bb:
+- %tmp = load i32, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) @lds0 to ptr), ptr addrspacecast (ptr addrspace(3) @lds1 to ptr))
+- ret i32 %tmp
+-}
+-
+-; CHECK-LABEL: @constexpr_select_group_global_flat_mismatch(
+-; CHECK: %tmp = load i32, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) @lds0 to ptr), ptr addrspacecast (ptr addrspace(1) @global0 to ptr))
+-define i32 @constexpr_select_group_global_flat_mismatch() #0 {
+-bb:
+- %tmp = load i32, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) @lds0 to ptr), ptr addrspacecast (ptr addrspace(1) @global0 to ptr))
+- ret i32 %tmp
+-}
+-
+ ; CHECK-LABEL: @store_select_group_flat_null(
+ ; CHECK: %select = select i1 %c, ptr addrspace(3) %group.ptr.0, ptr addrspace(3) addrspacecast (ptr null to ptr addrspace(3))
+ ; CHECK: store i32 -1, ptr addrspace(3) %select
+@@ -185,48 +169,6 @@ define amdgpu_kernel void @store_select_group_global_mismatch_null_null(i1 %c) #
+ ret void
+ }
+
+-; CHECK-LABEL: @store_select_group_global_mismatch_null_null_constexpr(
+-; CHECK: store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) null to ptr), ptr addrspacecast (ptr addrspace(1) null to ptr)), align 4
+-define amdgpu_kernel void @store_select_group_global_mismatch_null_null_constexpr() #0 {
+- store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) null to ptr), ptr addrspacecast (ptr addrspace(1) null to ptr)), align 4
+- ret void
+-}
+-
+-; CHECK-LABEL: @store_select_group_global_mismatch_gv_null_constexpr(
+-; CHECK: store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) @lds0 to ptr), ptr addrspacecast (ptr addrspace(1) null to ptr)), align 4
+-define amdgpu_kernel void @store_select_group_global_mismatch_gv_null_constexpr() #0 {
+- store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) @lds0 to ptr), ptr addrspacecast (ptr addrspace(1) null to ptr)), align 4
+- ret void
+-}
+-
+-; CHECK-LABEL: @store_select_group_global_mismatch_null_gv_constexpr(
+-; CHECK: store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) null to ptr), ptr addrspacecast (ptr addrspace(1) @global0 to ptr)), align 4
+-define amdgpu_kernel void @store_select_group_global_mismatch_null_gv_constexpr() #0 {
+- store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) null to ptr), ptr addrspacecast (ptr addrspace(1) @global0 to ptr)), align 4
+- ret void
+-}
+-
+-; CHECK-LABEL: @store_select_group_global_mismatch_inttoptr_null_constexpr(
+-; CHECK: store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) inttoptr (i64 123 to ptr addrspace(3)) to ptr), ptr addrspacecast (ptr addrspace(1) null to ptr)), align 4
+-define amdgpu_kernel void @store_select_group_global_mismatch_inttoptr_null_constexpr() #0 {
+- store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) inttoptr (i64 123 to ptr addrspace(3)) to ptr), ptr addrspacecast (ptr addrspace(1) null to ptr)), align 4
+- ret void
+-}
+-
+-; CHECK-LABEL: @store_select_group_global_mismatch_inttoptr_flat_null_constexpr(
+-; CHECK: store i32 7, ptr addrspace(1) select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspace(1) addrspacecast (ptr inttoptr (i64 123 to ptr) to ptr addrspace(1)), ptr addrspace(1) null), align 4
+-define amdgpu_kernel void @store_select_group_global_mismatch_inttoptr_flat_null_constexpr() #0 {
+- store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr inttoptr (i64 123 to ptr), ptr addrspacecast (ptr addrspace(1) null to ptr)), align 4
+- ret void
+-}
+-
+-; CHECK-LABEL: @store_select_group_global_mismatch_undef_undef_constexpr(
+-; CHECK: store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) null to ptr), ptr undef), align 4
+-define amdgpu_kernel void @store_select_group_global_mismatch_undef_undef_constexpr() #0 {
+- store i32 7, ptr select (i1 icmp eq (i32 ptrtoint (ptr addrspace(3) @lds1 to i32), i32 4), ptr addrspacecast (ptr addrspace(3) null to ptr), ptr addrspacecast (ptr addrspace(1) undef to ptr)), align 4
+- ret void
+-}
+-
+ @lds2 = external addrspace(3) global [1024 x i32], align 4
+
+ ; CHECK-LABEL: @store_select_group_constexpr_ptrtoint(
+diff --git a/llvm/test/Transforms/InstCombine/2010-03-03-ExtElim.ll b/llvm/test/Transforms/InstCombine/2010-03-03-ExtElim.ll
+index c9b2d6b41aa9..73fa613d0568 100644
+--- a/llvm/test/Transforms/InstCombine/2010-03-03-ExtElim.ll
++++ b/llvm/test/Transforms/InstCombine/2010-03-03-ExtElim.ll
+@@ -21,12 +21,19 @@ define i1 @PR6486() nounwind {
+
+ define i1 @PR16462_1() nounwind {
+ ; CHECK-LABEL: @PR16462_1(
+- ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (ptr @a, ptr @d), i32 0, i32 1) to i16) to i32), i32 65535)
++ %constexpr = select i1 icmp eq (ptr @a, ptr @d), i32 0, i32 1
++ %constexpr1 = trunc i32 %constexpr to i16
++ %constexpr2 = sext i16 %constexpr1 to i32
++ %constexpr3 = icmp sgt i32 %constexpr2, 65535
++ ret i1 %constexpr3
+ ; CHECK: ret i1 false
+ }
+
+ define i1 @PR16462_2() nounwind {
+ ; CHECK-LABEL: @PR16462_2(
+- ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (ptr @a, ptr @d), i32 0, i32 1) to i16) to i32), i32 42)
++ %constexpr = select i1 icmp eq (ptr @a, ptr @d), i32 0, i32 1
++ %constexpr1 = trunc i32 %constexpr to i16
++ %constexpr2 = icmp sgt i16 %constexpr1, 42
++ ret i1 %constexpr2
+ ; CHECK: ret i1 false
+ }
+diff --git a/llvm/test/Transforms/InstCombine/cast.ll b/llvm/test/Transforms/InstCombine/cast.ll
+index cd3b032d739d..5b480b115793 100644
+--- a/llvm/test/Transforms/InstCombine/cast.ll
++++ b/llvm/test/Transforms/InstCombine/cast.ll
+@@ -1441,7 +1441,8 @@ define i64 @PR28745() {
+ ; LE-LABEL: @PR28745(
+ ; LE-NEXT: ret i64 0
+ ;
+- %e = extractvalue { i32 } select (i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), { i32 } { i32 1 }, { i32 } zeroinitializer), 0
++ %s = select i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), { i32 } { i32 1 }, { i32 } zeroinitializer
++ %e = extractvalue { i32 } %s, 0
+ %b = zext i32 %e to i64
+ ret i64 %b
+ }
+diff --git a/llvm/test/Transforms/InstCombine/pr28725.ll b/llvm/test/Transforms/InstCombine/pr28725.ll
+index 26772eb7fe3a..688409c41f3c 100644
+--- a/llvm/test/Transforms/InstCombine/pr28725.ll
++++ b/llvm/test/Transforms/InstCombine/pr28725.ll
+@@ -3,7 +3,8 @@
+
+ define <2 x i16> @test1() {
+ entry:
+- %e = extractvalue %S select (i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), %S zeroinitializer, %S { i16 0, i32 1 }), 0
++ %s = select i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), %S zeroinitializer, %S { i16 0, i32 1 }
++ %e = extractvalue %S %s, 0
+ %b = insertelement <2 x i16> <i16 undef, i16 0>, i16 %e, i32 0
+ ret <2 x i16> %b
+ }
+diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/constant-expr.ll b/llvm/test/Transforms/InstSimplify/ConstProp/constant-expr.ll
+index 8978d9200afb..bdecda847d37 100644
+--- a/llvm/test/Transforms/InstSimplify/ConstProp/constant-expr.ll
++++ b/llvm/test/Transforms/InstSimplify/ConstProp/constant-expr.ll
+@@ -84,12 +84,3 @@
+ ; CHECK: pr9011_14 = constant i128 0
+ @pr9011_15 = constant i128 bitcast (<4 x i32> zeroinitializer to i128)
+ ; CHECK: pr9011_15 = constant i128 0
+-
+-@select = internal constant
+- i32 select (i1 icmp ult (i32 ptrtoint (ptr @X to i32),
+- i32 ptrtoint (ptr @Y to i32)),
+- i32 select (i1 icmp ult (i32 ptrtoint (ptr @X to i32),
+- i32 ptrtoint (ptr @Y to i32)),
+- i32 10, i32 20),
+- i32 30)
+-; CHECK: select = internal constant i32 select {{.*}} i32 10, i32 30
+diff --git a/llvm/test/Transforms/InstSimplify/pr28725.ll b/llvm/test/Transforms/InstSimplify/pr28725.ll
+index 67e6170c4f1b..8adfecc5128e 100644
+--- a/llvm/test/Transforms/InstSimplify/pr28725.ll
++++ b/llvm/test/Transforms/InstSimplify/pr28725.ll
+@@ -6,12 +6,14 @@
+ define <2 x i16> @test1() {
+ ; CHECK-LABEL: @test1(
+ ; CHECK-NEXT: entry:
+-; CHECK-NEXT: [[E:%.*]] = extractvalue [[S:%.*]] select (i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), [[S]] zeroinitializer, [[S]] { i16 0, i32 1 }), 0
++; CHECK-NEXT: [[SEL:%.*]] = select i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), [[S:%.*]] zeroinitializer, [[S]] { i16 0, i32 1 }
++; CHECK-NEXT: [[E:%.*]] = extractvalue [[S]] [[SEL]], 0
+ ; CHECK-NEXT: [[B:%.*]] = insertelement <2 x i16> <i16 undef, i16 0>, i16 [[E]], i32 0
+ ; CHECK-NEXT: ret <2 x i16> [[B]]
+ ;
+ entry:
+- %e = extractvalue %S select (i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), %S zeroinitializer, %S { i16 0, i32 1 }), 0
++ %sel = select i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), %S zeroinitializer, %S { i16 0, i32 1 }
++ %e = extractvalue %S %sel, 0
+ %b = insertelement <2 x i16> <i16 undef, i16 0>, i16 %e, i32 0
+ ret <2 x i16> %b
+ }
+diff --git a/llvm/unittests/Analysis/ValueTrackingTest.cpp b/llvm/unittests/Analysis/ValueTrackingTest.cpp
+index ef130522f10f..713cfed808f1 100644
+--- a/llvm/unittests/Analysis/ValueTrackingTest.cpp
++++ b/llvm/unittests/Analysis/ValueTrackingTest.cpp
+@@ -1157,10 +1157,7 @@ TEST(ValueTracking, canCreatePoisonOrUndef) {
+ {{false, false}, "call noundef i32 @g(i32 %x)"},
+ {{true, false}, "fcmp nnan oeq float %fx, %fy"},
+ {{false, false}, "fcmp oeq float %fx, %fy"},
+- {{true, false},
+- "ashr <4 x i32> %vx, select (i1 icmp sgt (i32 ptrtoint (i32* @s to "
+- "i32), i32 1), <4 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 "
+- "2, i32 3>)"},
++ {{true, false}, "ashr i32 %x, ptrtoint (i32* @s to i32)"},
+ {{false, false},
+ "call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %x, i32 %y)"},
+ {{false, false},
+diff --git a/llvm/unittests/IR/ConstantsTest.cpp b/llvm/unittests/IR/ConstantsTest.cpp
+index 71ff311e7693..947cc7f89243 100644
+--- a/llvm/unittests/IR/ConstantsTest.cpp
++++ b/llvm/unittests/IR/ConstantsTest.cpp
+@@ -270,8 +270,6 @@ TEST(ConstantsTest, AsInstructionsTest) {
+ CHECK(ConstantExpr::getFPExtend(P1, DoubleTy),
+ "fpext float " P1STR " to double");
+
+- CHECK(ConstantExpr::getSelect(P3, P0, P4),
+- "select i1 " P3STR ", i32 " P0STR ", i32 " P4STR);
+ CHECK(ConstantExpr::getICmp(CmpInst::ICMP_EQ, P0, P4),
+ "icmp eq i32 " P0STR ", " P4STR);
+ CHECK(ConstantExpr::getFCmp(CmpInst::FCMP_ULT, P1, P5),
+--
+2.40.0
+
diff --git a/0010-docs-Mention-removal-of-legacy-optimization-pipeline.patch b/0010-docs-Mention-removal-of-legacy-optimization-pipeline.patch
new file mode 100644
index 000000000000..1316f3306e74
--- /dev/null
+++ b/0010-docs-Mention-removal-of-legacy-optimization-pipeline.patch
@@ -0,0 +1,36 @@
+From a63270cda814a924f0ce35592a73dfd9f497ee00 Mon Sep 17 00:00:00 2001
+From: Arthur Eubanks <aeubanks@google.com>
+Date: Thu, 16 Mar 2023 10:05:34 -0700
+Subject: [PATCH] [docs] Mention removal of legacy optimization pipeline and
+ inliner alloca merging
+
+Reviewed By: asbirlea
+
+Differential Revision: https://reviews.llvm.org/D146243
+---
+ llvm/docs/ReleaseNotes.rst | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
+index 56da5be434eb..2fe22e855f53 100644
+--- a/llvm/docs/ReleaseNotes.rst
++++ b/llvm/docs/ReleaseNotes.rst
+@@ -61,6 +61,15 @@ Changes to the LLVM IR
+
+ * ``select``
+
++Changes to LLVM infrastructure
++-----------------------------
++
++* The legacy optimization pipeline has been removed.
++
++* Alloca merging in the inliner has been removed, since it only worked with the
++ legacy inliner pass. Backend stack coloring should handle cases alloca
++ merging initially set out to handle.
++
+ Changes to building LLVM
+ ------------------------
+
+--
+2.40.0
+
diff --git a/0011-Fix-LLVM-Sphinx-build.patch b/0011-Fix-LLVM-Sphinx-build.patch
new file mode 100644
index 000000000000..fda7d07cdbb5
--- /dev/null
+++ b/0011-Fix-LLVM-Sphinx-build.patch
@@ -0,0 +1,27 @@
+From d73c51bfda3719e698ef2e7ed973909d7138d882 Mon Sep 17 00:00:00 2001
+From: Aaron Ballman <aaron@aaronballman.com>
+Date: Thu, 16 Mar 2023 14:03:04 -0400
+Subject: [PATCH] Fix LLVM Sphinx build
+
+This addresses the issue found by:
+https://lab.llvm.org/buildbot/#/builders/30/builds/33006
+---
+ llvm/docs/ReleaseNotes.rst | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
+index 2fe22e855f53..e0da56da6b69 100644
+--- a/llvm/docs/ReleaseNotes.rst
++++ b/llvm/docs/ReleaseNotes.rst
+@@ -62,7 +62,7 @@ Changes to the LLVM IR
+ * ``select``
+
+ Changes to LLVM infrastructure
+------------------------------
++------------------------------
+
+ * The legacy optimization pipeline has been removed.
+
+--
+2.40.0
+
diff --git a/0012-Passes-Remove-some-legacy-passes.patch b/0012-Passes-Remove-some-legacy-passes.patch
new file mode 100644
index 000000000000..7e19944bf303
--- /dev/null
+++ b/0012-Passes-Remove-some-legacy-passes.patch
@@ -0,0 +1,487 @@
+From 1a90faacf1502fb967900ab44b62e8509a369013 Mon Sep 17 00:00:00 2001
+From: Arthur Eubanks <aeubanks@google.com>
+Date: Mon, 13 Mar 2023 09:53:50 -0700
+Subject: [PATCH] [Passes] Remove some legacy passes
+
+NewGVN
+GVNHoist
+GVNSink
+MemCpyOpt
+Float2Int
+
+These were only used for the optimization pipeline, of which the legacy version was removed.
+---
+ llvm/include/llvm/InitializePasses.h | 5 --
+ llvm/include/llvm/LinkAllPasses.h | 4 --
+ llvm/include/llvm/Transforms/Scalar.h | 34 ----------
+ llvm/lib/Transforms/Scalar/Float2Int.cpp | 33 ----------
+ llvm/lib/Transforms/Scalar/GVNHoist.cpp | 47 --------------
+ llvm/lib/Transforms/Scalar/GVNSink.cpp | 34 ----------
+ .../lib/Transforms/Scalar/MemCpyOptimizer.cpp | 62 -------------------
+ llvm/lib/Transforms/Scalar/NewGVN.cpp | 55 ----------------
+ llvm/lib/Transforms/Scalar/Scalar.cpp | 5 --
+ 9 files changed, 279 deletions(-)
+
+diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
+index 64a9f7b47112..7bf013f43d1b 100644
+--- a/llvm/include/llvm/InitializePasses.h
++++ b/llvm/include/llvm/InitializePasses.h
+@@ -136,14 +136,11 @@ void initializeFinalizeMachineBundlesPass(PassRegistry&);
+ void initializeFixIrreduciblePass(PassRegistry &);
+ void initializeFixupStatepointCallerSavedPass(PassRegistry&);
+ void initializeFlattenCFGLegacyPassPass(PassRegistry &);
+-void initializeFloat2IntLegacyPassPass(PassRegistry&);
+ void initializeForceFunctionAttrsLegacyPassPass(PassRegistry&);
+ void initializeFuncletLayoutPass(PassRegistry&);
+ void initializeGCMachineCodeAnalysisPass(PassRegistry&);
+ void initializeGCModuleInfoPass(PassRegistry&);
+-void initializeGVNHoistLegacyPassPass(PassRegistry&);
+ void initializeGVNLegacyPassPass(PassRegistry&);
+-void initializeGVNSinkLegacyPassPass(PassRegistry&);
+ void initializeGlobalDCELegacyPassPass(PassRegistry&);
+ void initializeGlobalMergePass(PassRegistry&);
+ void initializeGlobalOptLegacyPassPass(PassRegistry&);
+@@ -260,7 +257,6 @@ void initializeMachineTraceMetricsPass(PassRegistry&);
+ void initializeMachineUniformityInfoPrinterPassPass(PassRegistry &);
+ void initializeMachineUniformityAnalysisPassPass(PassRegistry &);
+ void initializeMachineVerifierPassPass(PassRegistry&);
+-void initializeMemCpyOptLegacyPassPass(PassRegistry&);
+ void initializeMemDepPrinterPass(PassRegistry&);
+ void initializeMemDerefPrinterPass(PassRegistry&);
+ void initializeMemoryDependenceWrapperPassPass(PassRegistry&);
+@@ -275,7 +271,6 @@ void initializeModuloScheduleTestPass(PassRegistry&);
+ void initializeMustExecutePrinterPass(PassRegistry&);
+ void initializeMustBeExecutedContextPrinterPass(PassRegistry&);
+ void initializeNaryReassociateLegacyPassPass(PassRegistry&);
+-void initializeNewGVNLegacyPassPass(PassRegistry&);
+ void initializeObjCARCContractLegacyPassPass(PassRegistry &);
+ void initializeOptimizationRemarkEmitterWrapperPassPass(PassRegistry&);
+ void initializeOptimizePHIsPass(PassRegistry&);
+diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
+index 9e16054bfb9f..55d2a35ca353 100644
+--- a/llvm/include/llvm/LinkAllPasses.h
++++ b/llvm/include/llvm/LinkAllPasses.h
+@@ -138,11 +138,8 @@ namespace {
+ (void) llvm::createConstantHoistingPass();
+ (void) llvm::createCodeGenPreparePass();
+ (void) llvm::createEarlyCSEPass();
+- (void) llvm::createGVNHoistPass();
+ (void) llvm::createMergedLoadStoreMotionPass();
+ (void) llvm::createGVNPass();
+- (void) llvm::createNewGVNPass();
+- (void) llvm::createMemCpyOptPass();
+ (void) llvm::createPostDomTree();
+ (void) llvm::createInstructionNamerPass();
+ (void) llvm::createMetaRenamerPass();
+@@ -170,7 +167,6 @@ namespace {
+ (void) llvm::createMemDerefPrinter();
+ (void) llvm::createMustExecutePrinter();
+ (void) llvm::createMustBeExecutedContextPrinter();
+- (void) llvm::createFloat2IntPass();
+ (void)llvm::createScalarizeMaskedMemIntrinLegacyPass();
+ (void) llvm::createHardwareLoopsLegacyPass();
+ (void) llvm::createInjectTLIMappingsLegacyPass();
+diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
+index e9b6dc40c913..c188df4b248f 100644
+--- a/llvm/include/llvm/Transforms/Scalar.h
++++ b/llvm/include/llvm/Transforms/Scalar.h
+@@ -205,20 +205,6 @@ FunctionPass *createTailCallEliminationPass();
+ //
+ FunctionPass *createEarlyCSEPass(bool UseMemorySSA = false);
+
+-//===----------------------------------------------------------------------===//
+-//
+-// GVNHoist - This pass performs a simple and fast GVN pass over the dominator
+-// tree to hoist common expressions from sibling branches.
+-//
+-FunctionPass *createGVNHoistPass();
+-
+-//===----------------------------------------------------------------------===//
+-//
+-// GVNSink - This pass uses an "inverted" value numbering to decide the
+-// similarity of expressions and sinks similar expressions into successors.
+-//
+-FunctionPass *createGVNSinkPass();
+-
+ //===----------------------------------------------------------------------===//
+ //
+ // MergedLoadStoreMotion - This pass merges loads and stores in diamonds. Loads
+@@ -226,20 +212,6 @@ FunctionPass *createGVNSinkPass();
+ //
+ FunctionPass *createMergedLoadStoreMotionPass(bool SplitFooterBB = false);
+
+-//===----------------------------------------------------------------------===//
+-//
+-// GVN - This pass performs global value numbering and redundant load
+-// elimination cotemporaneously.
+-//
+-FunctionPass *createNewGVNPass();
+-
+-//===----------------------------------------------------------------------===//
+-//
+-// MemCpyOpt - This pass performs optimizations related to eliminating memcpy
+-// calls and/or combining multiple stores into memset's.
+-//
+-FunctionPass *createMemCpyOptPass();
+-
+ //===----------------------------------------------------------------------===//
+ //
+ // ConstantHoisting - This pass prepares a function for expensive constants.
+@@ -366,12 +338,6 @@ FunctionPass *createPlaceSafepointsPass();
+ //
+ ModulePass *createRewriteStatepointsForGCLegacyPass();
+
+-//===----------------------------------------------------------------------===//
+-//
+-// Float2Int - Demote floats to ints where possible.
+-//
+-FunctionPass *createFloat2IntPass();
+-
+ //===----------------------------------------------------------------------===//
+ //
+ // NaryReassociate - Simplify n-ary operations by reassociation.
+diff --git a/llvm/lib/Transforms/Scalar/Float2Int.cpp b/llvm/lib/Transforms/Scalar/Float2Int.cpp
+index 149d0dee2428..35123606a15d 100644
+--- a/llvm/lib/Transforms/Scalar/Float2Int.cpp
++++ b/llvm/lib/Transforms/Scalar/Float2Int.cpp
+@@ -49,35 +49,6 @@ MaxIntegerBW("float2int-max-integer-bw", cl::init(64), cl::Hidden,
+ cl::desc("Max integer bitwidth to consider in float2int"
+ "(default=64)"));
+
+-namespace {
+- struct Float2IntLegacyPass : public FunctionPass {
+- static char ID; // Pass identification, replacement for typeid
+- Float2IntLegacyPass() : FunctionPass(ID) {
+- initializeFloat2IntLegacyPassPass(*PassRegistry::getPassRegistry());
+- }
+-
+- bool runOnFunction(Function &F) override {
+- if (skipFunction(F))
+- return false;
+-
+- const DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+- return Impl.runImpl(F, DT);
+- }
+-
+- void getAnalysisUsage(AnalysisUsage &AU) const override {
+- AU.setPreservesCFG();
+- AU.addRequired<DominatorTreeWrapperPass>();
+- AU.addPreserved<GlobalsAAWrapperPass>();
+- }
+-
+- private:
+- Float2IntPass Impl;
+- };
+-}
+-
+-char Float2IntLegacyPass::ID = 0;
+-INITIALIZE_PASS(Float2IntLegacyPass, "float2int", "Float to int", false, false)
+-
+ // Given a FCmp predicate, return a matching ICmp predicate if one
+ // exists, otherwise return BAD_ICMP_PREDICATE.
+ static CmpInst::Predicate mapFCmpPred(CmpInst::Predicate P) {
+@@ -529,9 +500,6 @@ bool Float2IntPass::runImpl(Function &F, const DominatorTree &DT) {
+ return Modified;
+ }
+
+-namespace llvm {
+-FunctionPass *createFloat2IntPass() { return new Float2IntLegacyPass(); }
+-
+ PreservedAnalyses Float2IntPass::run(Function &F, FunctionAnalysisManager &AM) {
+ const DominatorTree &DT = AM.getResult<DominatorTreeAnalysis>(F);
+ if (!runImpl(F, DT))
+@@ -541,4 +509,3 @@ PreservedAnalyses Float2IntPass::run(Function &F, FunctionAnalysisManager &AM) {
+ PA.preserveSet<CFGAnalyses>();
+ return PA;
+ }
+-} // End namespace llvm
+diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
+index abe38aa2a357..4e290015bc5e 100644
+--- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp
++++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
+@@ -519,39 +519,6 @@ private:
+ std::pair<unsigned, unsigned> hoistExpressions(Function &F);
+ };
+
+-class GVNHoistLegacyPass : public FunctionPass {
+-public:
+- static char ID;
+-
+- GVNHoistLegacyPass() : FunctionPass(ID) {
+- initializeGVNHoistLegacyPassPass(*PassRegistry::getPassRegistry());
+- }
+-
+- bool runOnFunction(Function &F) override {
+- if (skipFunction(F))
+- return false;
+- auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+- auto &PDT = getAnalysis<PostDominatorTreeWrapperPass>().getPostDomTree();
+- auto &AA = getAnalysis<AAResultsWrapperPass>().getAAResults();
+- auto &MD = getAnalysis<MemoryDependenceWrapperPass>().getMemDep();
+- auto &MSSA = getAnalysis<MemorySSAWrapperPass>().getMSSA();
+-
+- GVNHoist G(&DT, &PDT, &AA, &MD, &MSSA);
+- return G.run(F);
+- }
+-
+- void getAnalysisUsage(AnalysisUsage &AU) const override {
+- AU.addRequired<DominatorTreeWrapperPass>();
+- AU.addRequired<PostDominatorTreeWrapperPass>();
+- AU.addRequired<AAResultsWrapperPass>();
+- AU.addRequired<MemoryDependenceWrapperPass>();
+- AU.addRequired<MemorySSAWrapperPass>();
+- AU.addPreserved<DominatorTreeWrapperPass>();
+- AU.addPreserved<MemorySSAWrapperPass>();
+- AU.addPreserved<GlobalsAAWrapperPass>();
+- }
+-};
+-
+ bool GVNHoist::run(Function &F) {
+ NumFuncArgs = F.arg_size();
+ VN.setDomTree(DT);
+@@ -1256,17 +1223,3 @@ PreservedAnalyses GVNHoistPass::run(Function &F, FunctionAnalysisManager &AM) {
+ PA.preserve<MemorySSAAnalysis>();
+ return PA;
+ }
+-
+-char GVNHoistLegacyPass::ID = 0;
+-
+-INITIALIZE_PASS_BEGIN(GVNHoistLegacyPass, "gvn-hoist",
+- "Early GVN Hoisting of Expressions", false, false)
+-INITIALIZE_PASS_DEPENDENCY(MemoryDependenceWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(PostDominatorTreeWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
+-INITIALIZE_PASS_END(GVNHoistLegacyPass, "gvn-hoist",
+- "Early GVN Hoisting of Expressions", false, false)
+-
+-FunctionPass *llvm::createGVNHoistPass() { return new GVNHoistLegacyPass(); }
+diff --git a/llvm/lib/Transforms/Scalar/GVNSink.cpp b/llvm/lib/Transforms/Scalar/GVNSink.cpp
+index 5fb8a77051fb..34a9aaf4066e 100644
+--- a/llvm/lib/Transforms/Scalar/GVNSink.cpp
++++ b/llvm/lib/Transforms/Scalar/GVNSink.cpp
+@@ -886,29 +886,6 @@ void GVNSink::sinkLastInstruction(ArrayRef<BasicBlock *> Blocks,
+ NumRemoved += Insts.size() - 1;
+ }
+
+-////////////////////////////////////////////////////////////////////////////////
+-// Pass machinery / boilerplate
+-
+-class GVNSinkLegacyPass : public FunctionPass {
+-public:
+- static char ID;
+-
+- GVNSinkLegacyPass() : FunctionPass(ID) {
+- initializeGVNSinkLegacyPassPass(*PassRegistry::getPassRegistry());
+- }
+-
+- bool runOnFunction(Function &F) override {
+- if (skipFunction(F))
+- return false;
+- GVNSink G;
+- return G.run(F);
+- }
+-
+- void getAnalysisUsage(AnalysisUsage &AU) const override {
+- AU.addPreserved<GlobalsAAWrapperPass>();
+- }
+-};
+-
+ } // end anonymous namespace
+
+ PreservedAnalyses GVNSinkPass::run(Function &F, FunctionAnalysisManager &AM) {
+@@ -917,14 +894,3 @@ PreservedAnalyses GVNSinkPass::run(Function &F, FunctionAnalysisManager &AM) {
+ return PreservedAnalyses::all();
+ return PreservedAnalyses::none();
+ }
+-
+-char GVNSinkLegacyPass::ID = 0;
+-
+-INITIALIZE_PASS_BEGIN(GVNSinkLegacyPass, "gvn-sink",
+- "Early GVN sinking of Expressions", false, false)
+-INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(PostDominatorTreeWrapperPass)
+-INITIALIZE_PASS_END(GVNSinkLegacyPass, "gvn-sink",
+- "Early GVN sinking of Expressions", false, false)
+-
+-FunctionPass *llvm::createGVNSinkPass() { return new GVNSinkLegacyPass(); }
+diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+index 64846484f936..1a83c713092d 100644
+--- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
++++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+@@ -255,54 +255,6 @@ void MemsetRanges::addRange(int64_t Start, int64_t Size, Value *Ptr,
+ // MemCpyOptLegacyPass Pass
+ //===----------------------------------------------------------------------===//
+
+-namespace {
+-
+-class MemCpyOptLegacyPass : public FunctionPass {
+- MemCpyOptPass Impl;
+-
+-public:
+- static char ID; // Pass identification, replacement for typeid
+-
+- MemCpyOptLegacyPass() : FunctionPass(ID) {
+- initializeMemCpyOptLegacyPassPass(*PassRegistry::getPassRegistry());
+- }
+-
+- bool runOnFunction(Function &F) override;
+-
+-private:
+- // This transformation requires dominator postdominator info
+- void getAnalysisUsage(AnalysisUsage &AU) const override {
+- AU.setPreservesCFG();
+- AU.addRequired<AssumptionCacheTracker>();
+- AU.addRequired<DominatorTreeWrapperPass>();
+- AU.addPreserved<DominatorTreeWrapperPass>();
+- AU.addPreserved<GlobalsAAWrapperPass>();
+- AU.addRequired<TargetLibraryInfoWrapperPass>();
+- AU.addRequired<AAResultsWrapperPass>();
+- AU.addPreserved<AAResultsWrapperPass>();
+- AU.addRequired<MemorySSAWrapperPass>();
+- AU.addPreserved<MemorySSAWrapperPass>();
+- }
+-};
+-
+-} // end anonymous namespace
+-
+-char MemCpyOptLegacyPass::ID = 0;
+-
+-/// The public interface to this file...
+-FunctionPass *llvm::createMemCpyOptPass() { return new MemCpyOptLegacyPass(); }
+-
+-INITIALIZE_PASS_BEGIN(MemCpyOptLegacyPass, "memcpyopt", "MemCpy Optimization",
+- false, false)
+-INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
+-INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(GlobalsAAWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
+-INITIALIZE_PASS_END(MemCpyOptLegacyPass, "memcpyopt", "MemCpy Optimization",
+- false, false)
+-
+ // Check that V is either not accessible by the caller, or unwinding cannot
+ // occur between Start and End.
+ static bool mayBeVisibleThroughUnwinding(Value *V, Instruction *Start,
+@@ -1730,17 +1682,3 @@ bool MemCpyOptPass::runImpl(Function &F, TargetLibraryInfo *TLI_,
+
+ return MadeChange;
+ }
+-
+-/// This is the main transformation entry point for a function.
+-bool MemCpyOptLegacyPass::runOnFunction(Function &F) {
+- if (skipFunction(F))
+- return false;
+-
+- auto *TLI = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
+- auto *AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();
+- auto *AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
+- auto *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+- auto *MSSA = &getAnalysis<MemorySSAWrapperPass>().getMSSA();
+-
+- return Impl.runImpl(F, TLI, AA, AC, DT, MSSA);
+-}
+diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
+index d3dba0c5f1d5..92e9becf7afb 100644
+--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
++++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
+@@ -4208,61 +4208,6 @@ bool NewGVN::shouldSwapOperandsForIntrinsic(const Value *A, const Value *B,
+ return false;
+ }
+
+-namespace {
+-
+-class NewGVNLegacyPass : public FunctionPass {
+-public:
+- // Pass identification, replacement for typeid.
+- static char ID;
+-
+- NewGVNLegacyPass() : FunctionPass(ID) {
+- initializeNewGVNLegacyPassPass(*PassRegistry::getPassRegistry());
+- }
+-
+- bool runOnFunction(Function &F) override;
+-
+-private:
+- void getAnalysisUsage(AnalysisUsage &AU) const override {
+- AU.addRequired<AssumptionCacheTracker>();
+- AU.addRequired<DominatorTreeWrapperPass>();
+- AU.addRequired<TargetLibraryInfoWrapperPass>();
+- AU.addRequired<MemorySSAWrapperPass>();
+- AU.addRequired<AAResultsWrapperPass>();
+- AU.addPreserved<DominatorTreeWrapperPass>();
+- AU.addPreserved<GlobalsAAWrapperPass>();
+- }
+-};
+-
+-} // end anonymous namespace
+-
+-bool NewGVNLegacyPass::runOnFunction(Function &F) {
+- if (skipFunction(F))
+- return false;
+- return NewGVN(F, &getAnalysis<DominatorTreeWrapperPass>().getDomTree(),
+- &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F),
+- &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F),
+- &getAnalysis<AAResultsWrapperPass>().getAAResults(),
+- &getAnalysis<MemorySSAWrapperPass>().getMSSA(),
+- F.getParent()->getDataLayout())
+- .runGVN();
+-}
+-
+-char NewGVNLegacyPass::ID = 0;
+-
+-INITIALIZE_PASS_BEGIN(NewGVNLegacyPass, "newgvn", "Global Value Numbering",
+- false, false)
+-INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
+-INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
+-INITIALIZE_PASS_DEPENDENCY(GlobalsAAWrapperPass)
+-INITIALIZE_PASS_END(NewGVNLegacyPass, "newgvn", "Global Value Numbering", false,
+- false)
+-
+-// createGVNPass - The public interface to this file.
+-FunctionPass *llvm::createNewGVNPass() { return new NewGVNLegacyPass(); }
+-
+ PreservedAnalyses NewGVNPass::run(Function &F, AnalysisManager<Function> &AM) {
+ // Apparently the order in which we get these results matter for
+ // the old GVN (see Chandler's comment in GVN.cpp). I'll keep
+diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
+index 26a1e22f3317..5c8018956b43 100644
+--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
++++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
+@@ -38,12 +38,9 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
+ initializeGuardWideningLegacyPassPass(Registry);
+ initializeLoopGuardWideningLegacyPassPass(Registry);
+ initializeGVNLegacyPassPass(Registry);
+- initializeNewGVNLegacyPassPass(Registry);
+ initializeEarlyCSELegacyPassPass(Registry);
+ initializeEarlyCSEMemSSALegacyPassPass(Registry);
+ initializeMakeGuardsExplicitLegacyPassPass(Registry);
+- initializeGVNHoistLegacyPassPass(Registry);
+- initializeGVNSinkLegacyPassPass(Registry);
+ initializeFlattenCFGLegacyPassPass(Registry);
+ initializeIRCELegacyPassPass(Registry);
+ initializeInferAddressSpacesPass(Registry);
+@@ -64,7 +61,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
+ initializeLowerMatrixIntrinsicsLegacyPassPass(Registry);
+ initializeLowerMatrixIntrinsicsMinimalLegacyPassPass(Registry);
+ initializeLowerWidenableConditionLegacyPassPass(Registry);
+- initializeMemCpyOptLegacyPassPass(Registry);
+ initializeMergeICmpsLegacyPassPass(Registry);
+ initializeMergedLoadStoreMotionLegacyPassPass(Registry);
+ initializeNaryReassociateLegacyPassPass(Registry);
+@@ -86,7 +82,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
+ initializeStraightLineStrengthReduceLegacyPassPass(Registry);
+ initializePlaceBackedgeSafepointsLegacyPassPass(Registry);
+ initializePlaceSafepointsLegacyPassPass(Registry);
+- initializeFloat2IntLegacyPassPass(Registry);
+ initializeLoopSimplifyCFGLegacyPassPass(Registry);
+ }
+
+--
+2.40.0
+
diff --git a/0013-opt-Rename-enable-new-pm-bugpoint-enable-legacy-pm.patch b/0013-opt-Rename-enable-new-pm-bugpoint-enable-legacy-pm.patch
new file mode 100644
index 000000000000..befc1ae59971
--- /dev/null
+++ b/0013-opt-Rename-enable-new-pm-bugpoint-enable-legacy-pm.patch
@@ -0,0 +1,176 @@
+From c1b4240322bfaa43b7f02ca58cf9fe52744884b9 Mon Sep 17 00:00:00 2001
+From: Arthur Eubanks <aeubanks@google.com>
+Date: Tue, 14 Mar 2023 16:23:53 -0700
+Subject: [PATCH] [opt] Rename -enable-new-pm -> -bugpoint-enable-legacy-pm
+
+-enable-new-pm is no longer necessary except for bugpoint. Make the name more clunky so it hopefully won't be used.
+
+Reviewed By: nikic
+
+Differential Revision: https://reviews.llvm.org/D146103
+---
+ llvm/docs/NewPassManager.rst | 11 -----------
+ llvm/docs/WritingAnLLVMPass.rst | 7 +++----
+ llvm/test/BugPoint/unsymbolized.ll | 2 +-
+ llvm/test/Feature/load_extension.ll | 4 ----
+ llvm/test/Other/opt-On.ll | 13 -------------
+ .../Other/opt-legacy-syntax-deprecation.ll | 1 -
+ llvm/tools/bugpoint/OptimizerDriver.cpp | 2 +-
+ llvm/tools/opt/opt.cpp | 19 ++++++++-----------
+ 8 files changed, 13 insertions(+), 46 deletions(-)
+
+diff --git a/llvm/docs/NewPassManager.rst b/llvm/docs/NewPassManager.rst
+index d115c4dbc401..7464110daa09 100644
+--- a/llvm/docs/NewPassManager.rst
++++ b/llvm/docs/NewPassManager.rst
+@@ -420,17 +420,6 @@ for more details.
+ Invoking ``opt``
+ ================
+
+-To use the legacy pass manager:
+-
+-.. code-block:: shell
+-
+- $ opt -enable-new-pm=0 -pass1 -pass2 /tmp/a.ll -S
+-
+-This will be removed once the legacy pass manager is deprecated and removed for
+-the optimization pipeline.
+-
+-To use the new PM:
+-
+ .. code-block:: shell
+
+ $ opt -passes='pass1,pass2' /tmp/a.ll -S
+diff --git a/llvm/docs/WritingAnLLVMPass.rst b/llvm/docs/WritingAnLLVMPass.rst
+index 1e92be87e2e9..3e6063e58334 100644
+--- a/llvm/docs/WritingAnLLVMPass.rst
++++ b/llvm/docs/WritingAnLLVMPass.rst
+@@ -36,11 +36,10 @@ advanced features are discussed.
+
+ .. warning::
+ This document deals with the legacy pass manager. LLVM uses the new pass
+- manager by default for the optimization pipeline (the codegen pipeline is
+- still using the legacy pass manager), which has its own way of defining
++ manager for the optimization pipeline (the codegen pipeline
++ still uses the legacy pass manager), which has its own way of defining
+ passes. For more details, see :doc:`WritingAnLLVMNewPMPass` and
+- :doc:`NewPassManager`. To use the legacy pass manager with ``opt``, pass
+- the ``-enable-new-pm=0`` flag to all ``opt`` invocations.
++ :doc:`NewPassManager`.
+
+ Quick Start --- Writing hello world
+ ===================================
+diff --git a/llvm/test/BugPoint/unsymbolized.ll b/llvm/test/BugPoint/unsymbolized.ll
+index d0658b1b6b3a..b181cffd4370 100644
+--- a/llvm/test/BugPoint/unsymbolized.ll
++++ b/llvm/test/BugPoint/unsymbolized.ll
+@@ -3,7 +3,7 @@
+ ; RUN: echo "print('args = ' + str(sys.argv))" >> %t.py
+ ; RUN: echo "exit(1)" >> %t.py
+ ; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%python -opt-args %t.py | FileCheck %s
+-; RUN: not --crash opt -enable-new-pm=0 -load %llvmshlibdir/BugpointPasses%pluginext %s -bugpoint-crashcalls -disable-symbolication 2>&1 | FileCheck --check-prefix=CRASH %s
++; RUN: not --crash opt -bugpoint-enable-legacy-pm -load %llvmshlibdir/BugpointPasses%pluginext %s -bugpoint-crashcalls -disable-symbolication 2>&1 | FileCheck --check-prefix=CRASH %s
+ ; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%t.non.existent.opt.binary -opt-args %t.py 2>&1 | FileCheck %s --check-prefix=BAD-OPT
+
+ ; Test that bugpoint disables symbolication on the opt tool to reduce runtime overhead when opt crashes
+diff --git a/llvm/test/Feature/load_extension.ll b/llvm/test/Feature/load_extension.ll
+index 7c97262fdaa8..dd47f2abc541 100644
+--- a/llvm/test/Feature/load_extension.ll
++++ b/llvm/test/Feature/load_extension.ll
+@@ -7,10 +7,6 @@
+ ; REQUIRES: plugins, examples
+ ; UNSUPPORTED: target={{.*windows.*}}
+ ; CHECK: Bye
+-;
+-; Specifying a new PM pass plugin with the old PM is an error.
+-; RUN: ! opt %s %loadnewpmbye -goodbye -wave-goodbye -disable-output -enable-new-pm=0 2>&1 | FileCheck %s --check-prefix=ERROR
+-; ERROR: load-pass-plugin specified with legacy PM.
+
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+diff --git a/llvm/test/Other/opt-On.ll b/llvm/test/Other/opt-On.ll
+index 49f2d9d10dee..522f35578f96 100644
+--- a/llvm/test/Other/opt-On.ll
++++ b/llvm/test/Other/opt-On.ll
+@@ -19,16 +19,3 @@ define void @f() {
+ unreachable
+ }
+
+-
+-; Legacy PM deprecation tests (tests should be removed in the future).
+-;
+-; RUN: not opt -enable-new-pm=0 -O0 < %s -S 2>&1 | FileCheck %s --check-prefix=LEGACYPM-ERROR
+-; RUN: not opt -enable-new-pm=0 -O1 < %s -S 2>&1 | FileCheck %s --check-prefix=LEGACYPM-ERROR
+-; RUN: not opt -enable-new-pm=0 -O2 < %s -S 2>&1 | FileCheck %s --check-prefix=LEGACYPM-ERROR
+-; RUN: not opt -enable-new-pm=0 -O3 < %s -S 2>&1 | FileCheck %s --check-prefix=LEGACYPM-ERROR
+-; RUN: not opt -enable-new-pm=0 -Os < %s -S 2>&1 | FileCheck %s --check-prefix=LEGACYPM-ERROR
+-; RUN: not opt -enable-new-pm=0 -Oz < %s -S 2>&1 | FileCheck %s --check-prefix=LEGACYPM-ERROR
+-; RUN: not opt -O1 -codegenprepare < %s -S 2>&1 | FileCheck %s --check-prefix=LEGACYPM-ERROR
+-; RUN: not opt -codegenprepare -O2 < %s -S 2>&1 | FileCheck %s --check-prefix=LEGACYPM-ERROR
+-
+-; LEGACYPM-ERROR: Cannot use -O# with legacy PM
+diff --git a/llvm/test/Other/opt-legacy-syntax-deprecation.ll b/llvm/test/Other/opt-legacy-syntax-deprecation.ll
+index a5a33564fd7e..50162b333524 100644
+--- a/llvm/test/Other/opt-legacy-syntax-deprecation.ll
++++ b/llvm/test/Other/opt-legacy-syntax-deprecation.ll
+@@ -4,7 +4,6 @@
+ ; RUN: opt /dev/null -disable-output -passes=instcombine 2>&1 | FileCheck %s --check-prefix=OK --allow-empty
+ ; RUN: not opt /dev/null -disable-output -instcombine 2>&1 | FileCheck %s --check-prefix=WARN
+ ; RUN: not opt /dev/null -disable-output -instcombine -always-inline 2>&1 | FileCheck %s --check-prefix=WARN
+-; RUN: opt /dev/null -disable-output -instcombine -enable-new-pm=0 2>&1 | FileCheck %s --check-prefix=OK --allow-empty
+ ; RUN: opt /dev/null -disable-output -codegenprepare -mtriple=x86_64-unknown-linux-gnu 2>&1 | FileCheck %s --check-prefix=OK --allow-empty
+
+ ; OK-NOT: deprecated
+diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
+index 1197528d0dd3..f7239f5dc61b 100644
+--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
++++ b/llvm/tools/bugpoint/OptimizerDriver.cpp
+@@ -207,7 +207,7 @@ bool BugDriver::runPasses(Module &Program,
+ Args.push_back(OptArgs[i]);
+ // Pin to legacy PM since bugpoint has lots of infra and hacks revolving
+ // around the legacy PM.
+- Args.push_back("-enable-new-pm=0");
++ Args.push_back("-bugpoint-enable-legacy-pm");
+ Args.push_back("-disable-symbolication");
+ Args.push_back("-o");
+ Args.push_back(OutputFilename);
+diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
+index 1b07bbe09416..6a582fb0d425 100644
+--- a/llvm/tools/opt/opt.cpp
++++ b/llvm/tools/opt/opt.cpp
+@@ -68,12 +68,12 @@ static codegen::RegisterCodeGenFlags CFG;
+ static cl::list<const PassInfo *, bool, PassNameParser> PassList(cl::desc(
+ "Optimizations available (use '-passes=' for the new pass manager)"));
+
+-static cl::opt<bool> EnableNewPassManager(
+- "enable-new-pm",
+- cl::desc("Enable the new pass manager, translating "
+- "'opt -foo' to 'opt -passes=foo'. This is strictly for the new PM "
+- "migration, use '-passes=' when possible."),
+- cl::init(true));
++static cl::opt<bool> EnableLegacyPassManager(
++ "bugpoint-enable-legacy-pm",
++ cl::desc(
++ "Enable the legacy pass manager. This is strictly for bugpoint "
++ "due to it not working with the new PM, please do not use otherwise."),
++ cl::init(false));
+
+ // This flag specifies a textual description of the optimization pass pipeline
+ // to run over the module. This flag switches opt to use the new pass manager
+@@ -485,11 +485,8 @@ int main(int argc, char **argv) {
+
+ LLVMContext Context;
+
+- // If `-passes=` is specified, use NPM.
+- // If `-enable-new-pm` is specified and there are no codegen passes, use NPM.
+- // e.g. `-enable-new-pm -sroa` will use NPM.
+- // but `-enable-new-pm -codegenprepare` will still revert to legacy PM.
+- const bool UseNPM = (EnableNewPassManager && !shouldForceLegacyPM()) ||
++ // TODO: remove shouldForceLegacyPM().
++ const bool UseNPM = (!EnableLegacyPassManager && !shouldForceLegacyPM()) ||
+ PassPipeline.getNumOccurrences() > 0;
+
+ if (UseNPM && !PassList.empty()) {
+--
+2.40.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 2e0dc9b2073c..dea7e4c0e6c7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,7 +16,7 @@
pkgbase=llvm-minimal-git
pkgname=('llvm-minimal-git' 'llvm-libs-minimal-git' 'spirv-llvm-translator-minimal-git')
-pkgver=17.0.0_r454521.e4ea2d59191c
+pkgver=17.0.0_r455043.b1e9baea3a2c
pkgrel=1
arch=('x86_64')
url="https://llvm.org/"
@@ -34,6 +34,11 @@ source=("llvm-project::git+https://github.com/llvm/llvm-project.git"
'0006-llvm-c-Remove-pointee-support-from-LLVMGetElementTyp.patch'
'0007-Passes-Remove-some-legacy-passes.patch'
'0008-PassManagerBuilder-Remove-PassManagerBuilder.patch'
+ '0009-ConstExpr-Remove-select-constant-expression.patch'
+ '0010-docs-Mention-removal-of-legacy-optimization-pipeline.patch'
+ '0011-Fix-LLVM-Sphinx-build.patch'
+ '0012-Passes-Remove-some-legacy-passes.patch'
+ '0013-opt-Rename-enable-new-pm-bugpoint-enable-legacy-pm.patch'
)
md5sums=('SKIP'
@@ -46,7 +51,12 @@ md5sums=('SKIP'
'9e7e1648b472f83b054bf8dcbfc74175'
'a4604d7858e1536af63f52dcbc47fbb8'
'a09eda7d75c717aeb882fdfa67b028c3'
- '6f07ebda99c0c0cab5bb2ff063e05152')
+ '6f07ebda99c0c0cab5bb2ff063e05152'
+ 'b43ad443cb817e1e341d25f0de6ba248'
+ '161e703a83b93d6266c47b9883e55541'
+ '8ce50e0f42ed9f4d26fff1233d21c055'
+ '5ae64f8df9f04ecba27765d2401b58b0'
+ 'ff35711ebdb2833fc084f077c3cdc40f')
sha512sums=('SKIP'
'75e743dea28b280943b3cc7f8bbb871b57d110a7f2b9da2e6845c1c36bf170dd883fca54e463f5f49e0c3effe07fbd0db0f8cf5a12a2469d3f792af21a73fcdd'
'SKIP'
@@ -57,7 +67,12 @@ sha512sums=('SKIP'
'034b8262c2cec48fcdf1eef8f74332fc7016ecbf1627ab755f95f525c653cab0dd4199cd60b85dd09a63dc0b76bc9db9f85043c91801940294e42bc1feb1ea60'
'2f227060ab56e04bf3e74fbb785c2edf9fc55121c936ba17ac62275cacdacfb9cb84bfda0e6637e11e744e26212bbfa861fa320084502afb4b7fd247d832993b'
'6d77c23ad97c057898d97fd08af9714ff18c43026e082ad5e654b736caffb1ba814de0ebb9a7e169de9475d819df3cd0058805e4a0f020c55ce3b2272181802a'
- '4e006cb70005a4116e8637d9dabf7d3f1668e5ad21429254b641fa9ee716c2822cc718cc91c58e29451e4ffde96d25abfd31813322b82b91f896656c05be1210')
+ '4e006cb70005a4116e8637d9dabf7d3f1668e5ad21429254b641fa9ee716c2822cc718cc91c58e29451e4ffde96d25abfd31813322b82b91f896656c05be1210'
+ 'af7ee9560ac9346a9424706c1f5e7536f985c7fae74d6342429a8d865bfee529d694f6b835c5dc76952d45392f077c2d756f55d41a28075d8c999f847c5242a6'
+ 'ed6ac398f3d7c141d789a700880a23ee0f7f82de87462a44941ede6ef9fea426138ce587077ded0265577c2a31b4de9ef7dfa4446be145bce8c1088092e6902b'
+ '55036920d244f97d9e03de34558f6c20af57e26652acdb1db9f1ee5022c09984d2db2e2d71178b5440d46145ff8ff33c7fbc657195073f630a17a6e6bce42b82'
+ '852b52175aab6eb6193e0a6a1f8a6e0031061c73158a292472b20a7ac99f00e04d4c8ac266e99c1c2d7e91d8d071dd4d6ad1737a4a2ecc31085153c44f09f9d7'
+ '3e37d9449d74477c0fc2a6c3af37e06aba6555cc8cef83c71e74cb34e5a6ae3b6a5bc6c3fbb6b88c9cd0684e2e40ae066e1eb56337f8980a4729780bc7f9bdd3')
options=('staticlibs' '!lto')
@@ -88,6 +103,11 @@ pkgver() {
prepare() {
+ patch --directory="llvm-project" --reverse --strip=1 --input="${srcdir}"/0013-opt-Rename-enable-new-pm-bugpoint-enable-legacy-pm.patch
+ patch --directory="llvm-project" --reverse --strip=1 --input="${srcdir}"/0012-Passes-Remove-some-legacy-passes.patch
+ patch --directory="llvm-project" --reverse --strip=1 --input="${srcdir}"/0011-Fix-LLVM-Sphinx-build.patch
+ patch --directory="llvm-project" --reverse --strip=1 --input="${srcdir}"/0010-docs-Mention-removal-of-legacy-optimization-pipeline.patch
+ patch --directory="llvm-project" --reverse --strip=1 --input="${srcdir}"/0009-ConstExpr-Remove-select-constant-expression.patch
patch --directory="llvm-project" --reverse --strip=1 --input="${srcdir}"/0008-PassManagerBuilder-Remove-PassManagerBuilder.patch
patch --directory="llvm-project" --reverse --strip=1 --input="${srcdir}"/0007-Passes-Remove-some-legacy-passes.patch
patch --directory="llvm-project" --reverse --strip=1 --input="${srcdir}"/0006-llvm-c-Remove-pointee-support-from-LLVMGetElementTyp.patch