[llvm] 486ed88 - [ConstProp] Remove ConstantPropagation
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 09:33:59 PDT 2020
Ok, I'm not actively asking for revert, but I will note that I'd have
preferred you just ported the pass. I will be unsurprised to see an
analogous pass readded in the future.
Philip
On 8/26/20 4:15 PM, Arthur Eubanks wrote:
> And IPConstantPropagation was deleted previously:
> http://lists.llvm.org/pipermail/llvm-dev/2020-July/143773.html.
>
> On Wed, Aug 26, 2020 at 4:14 PM Arthur Eubanks <aeubanks at google.com
> <mailto:aeubanks at google.com>> wrote:
>
> The main reason was that it wasn't ported to the new pass manager,
> which seems to indicate that not too many people are using it. It
> was responsible for a significant amount of check-llvm failures
> under the NPM because it wasn't ported. The only uses at least in
> the LLVM codebase were only in tests. And I'd rather delete a pass
> than port it to the NPM if nobody is using it.
>
> On Wed, Aug 26, 2020 at 4:05 PM Philip Reames
> <listmail at philipreames.com <mailto:listmail at philipreames.com>> wrote:
>
> It's not clear to me what the value of this change is. Having
> a pass
> which exists "just" to exercise constant propagation seems pretty
> reasonable to me. As your test changes note, it's sometimes
> hard to
> exercise constant prop logic without tripping other transforms.
>
> I realize this was reviewed, but can you back up and explain the
> motivation for deleting this? Was it just the fact the code was
> "dead"? Or was there some deeper reason?
>
> Philip
>
> On 8/26/20 3:56 PM, Arthur Eubanks via llvm-commits wrote:
> > Author: Arthur Eubanks
> > Date: 2020-08-26T15:51:30-07:00
> > New Revision: 486ed885339d70cd71ee55567282a43cce28d763
> >
> > URL:
> https://github.com/llvm/llvm-project/commit/486ed885339d70cd71ee55567282a43cce28d763
> > DIFF:
> https://github.com/llvm/llvm-project/commit/486ed885339d70cd71ee55567282a43cce28d763.diff
> >
> > LOG: [ConstProp] Remove ConstantPropagation
> >
> > As discussed in
> > http://lists.llvm.org/pipermail/llvm-dev/2020-July/143801.html.
> >
> > Currently no users outside of unit tests.
> >
> > Replace all instances in tests of -constprop with -instsimplify.
> > Notable changes in tests:
> > * vscale.ll - @llvm.sadd.sat.nxv16i8 is evaluated by
> instsimplify, use a fake intrinsic instead
> > * InsertElement.ll - insertelement undef is removed by
> instsimplify in @insertelement_undef
> > llvm/test/Transforms/ConstProp moved to
> llvm/test/Transforms/InstSimplify/ConstProp
> >
> > Reviewed By: lattner, nikic
> >
> > Differential Revision: https://reviews.llvm.org/D85159
> >
> > Added:
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2002-03-11-ConstPropCrash.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2002-05-03-DivideByZeroException.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2002-05-03-NotOperator.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2002-09-03-SetCC-Bools.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2003-05-12-DivideError.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2005-01-28-SetCCGEP.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2006-11-30-vector-cast.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2006-12-01-TruncBoolBug.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2006-12-01-bool-casts.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2007-02-05-BitCast.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/2007-02-23-sdiv.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2008-07-07-VectorCompare.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2009-06-20-constexpr-zero-lhs.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/2009-09-01-GEP-Crash.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cos.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubeid.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubema.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubesc.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubetc.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/fmul_legacy.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/fract.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/lit.local.cfg
> > llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/sin.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/ARM/lit.local.cfg
> > llvm/test/Transforms/InstSimplify/ConstProp/ARM/mve-vctp.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/InsertElement.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/trunc.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/trunc_saturate.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/abs.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/allones.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/avx512.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/basictest.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/binop-identity-undef.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/bitcast.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/bitcount.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/bswap.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/calls-math-finite.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/calls.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/cast-vector.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/cast.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/constant-expr.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/convert-from-fp16.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/copysign.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/div-zero.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/extractelement-vscale.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/extractvalue.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/float-to-ptr-cast.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/fma.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/fneg.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/fp-undef.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/freeze.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/funnel-shift.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/gep-alias.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/gep-constanfolding-error.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/gep-zeroinit-vector.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/gep.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/insertvalue.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/loads.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/logicaltest.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/math-1.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/math-2.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/min-max.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/overflow-ops.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/phi.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/remtest.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/rint.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/round.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/saturating-add-sub.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/shift.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/smul-fix-sat.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/smul-fix.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/sse.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/timeout.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/trunc.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/trunc_vec.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/vecreduce.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/vector-undef-elts.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/vectorgep-crash.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/vscale-getelementptr.ll
> >
> llvm/test/Transforms/InstSimplify/ConstProp/vscale-shufflevector.ll
> > llvm/test/Transforms/InstSimplify/ConstProp/vscale.ll
> >
> > Modified:
> > llvm/bindings/go/llvm/executionengine_test.go
> > llvm/bindings/go/llvm/transforms_scalar.go
> > llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
> > llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
> > llvm/docs/CommandLine.rst
> > llvm/docs/Passes.rst
> > llvm/include/llvm-c/Transforms/Scalar.h
> > llvm/include/llvm/InitializePasses.h
> > llvm/include/llvm/LinkAllPasses.h
> > llvm/include/llvm/Transforms/Scalar.h
> > llvm/lib/Transforms/Scalar/CMakeLists.txt
> > llvm/lib/Transforms/Scalar/Scalar.cpp
> > llvm/test/Assembler/2002-04-07-HexFloatConstants.ll
> > llvm/test/Bitcode/extractelement.ll
> > llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll
> > llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
> > llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn
> >
> > Removed:
> > llvm/lib/Transforms/Scalar/ConstantProp.cpp
> > llvm/test/Analysis/ConstantFolding/AMDGPU/cos.ll
> > llvm/test/Analysis/ConstantFolding/AMDGPU/cubeid.ll
> > llvm/test/Analysis/ConstantFolding/AMDGPU/cubema.ll
> > llvm/test/Analysis/ConstantFolding/AMDGPU/cubesc.ll
> > llvm/test/Analysis/ConstantFolding/AMDGPU/cubetc.ll
> > llvm/test/Analysis/ConstantFolding/AMDGPU/fmul_legacy.ll
> > llvm/test/Analysis/ConstantFolding/AMDGPU/fract.ll
> > llvm/test/Analysis/ConstantFolding/AMDGPU/lit.local.cfg
> > llvm/test/Analysis/ConstantFolding/AMDGPU/sin.ll
> > llvm/test/Analysis/ConstantFolding/ARM/lit.local.cfg
> > llvm/test/Analysis/ConstantFolding/ARM/mve-vctp.ll
> > llvm/test/Analysis/ConstantFolding/WebAssembly/trunc.ll
> > llvm/test/Analysis/ConstantFolding/WebAssembly/trunc_saturate.ll
> > llvm/test/Analysis/ConstantFolding/abs.ll
> > llvm/test/Analysis/ConstantFolding/allones.ll
> > llvm/test/Analysis/ConstantFolding/binop-identity-undef.ll
> > llvm/test/Analysis/ConstantFolding/bitcount.ll
> > llvm/test/Analysis/ConstantFolding/cast-vector.ll
> > llvm/test/Analysis/ConstantFolding/copysign.ll
> > llvm/test/Analysis/ConstantFolding/extractelement-vscale.ll
> > llvm/test/Analysis/ConstantFolding/fneg.ll
> > llvm/test/Analysis/ConstantFolding/fp-undef.ll
> > llvm/test/Analysis/ConstantFolding/freeze.ll
> > llvm/test/Analysis/ConstantFolding/funnel-shift.ll
> > llvm/test/Analysis/ConstantFolding/gep-alias.ll
> > llvm/test/Analysis/ConstantFolding/gep-constanfolding-error.ll
> > llvm/test/Analysis/ConstantFolding/gep-zeroinit-vector.ll
> > llvm/test/Analysis/ConstantFolding/gep.ll
> > llvm/test/Analysis/ConstantFolding/math-1.ll
> > llvm/test/Analysis/ConstantFolding/math-2.ll
> > llvm/test/Analysis/ConstantFolding/min-max.ll
> > llvm/test/Analysis/ConstantFolding/rint.ll
> > llvm/test/Analysis/ConstantFolding/round.ll
> > llvm/test/Analysis/ConstantFolding/saturating-add-sub.ll
> > llvm/test/Analysis/ConstantFolding/smul-fix-sat.ll
> > llvm/test/Analysis/ConstantFolding/smul-fix.ll
> > llvm/test/Analysis/ConstantFolding/timeout.ll
> > llvm/test/Analysis/ConstantFolding/trunc.ll
> > llvm/test/Analysis/ConstantFolding/vecreduce.ll
> > llvm/test/Analysis/ConstantFolding/vector-undef-elts.ll
> > llvm/test/Analysis/ConstantFolding/vectorgep-crash.ll
> > llvm/test/Analysis/ConstantFolding/vscale-getelementptr.ll
> > llvm/test/Analysis/ConstantFolding/vscale-shufflevector.ll
> > llvm/test/Analysis/ConstantFolding/vscale.ll
> > llvm/test/Other/2002-03-11-ConstPropCrash.ll
> >
> llvm/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll
> > llvm/test/Transforms/ConstProp/2002-05-03-NotOperator.ll
> > llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll
> > llvm/test/Transforms/ConstProp/2003-05-12-DivideError.ll
> > llvm/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll
> > llvm/test/Transforms/ConstProp/2006-11-30-vector-cast.ll
> > llvm/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll
> > llvm/test/Transforms/ConstProp/2006-12-01-bool-casts.ll
> > llvm/test/Transforms/ConstProp/2007-02-05-BitCast.ll
> > llvm/test/Transforms/ConstProp/2007-02-23-sdiv.ll
> > llvm/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll
> > llvm/test/Transforms/ConstProp/2009-06-20-constexpr-zero-lhs.ll
> > llvm/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll
> > llvm/test/Transforms/ConstProp/InsertElement.ll
> > llvm/test/Transforms/ConstProp/avx512.ll
> > llvm/test/Transforms/ConstProp/basictest.ll
> > llvm/test/Transforms/ConstProp/bitcast.ll
> > llvm/test/Transforms/ConstProp/bswap.ll
> > llvm/test/Transforms/ConstProp/calls-math-finite.ll
> > llvm/test/Transforms/ConstProp/calls.ll
> > llvm/test/Transforms/ConstProp/cast.ll
> > llvm/test/Transforms/ConstProp/constant-expr.ll
> > llvm/test/Transforms/ConstProp/convert-from-fp16.ll
> > llvm/test/Transforms/ConstProp/div-zero.ll
> > llvm/test/Transforms/ConstProp/extractvalue.ll
> > llvm/test/Transforms/ConstProp/float-to-ptr-cast.ll
> > llvm/test/Transforms/ConstProp/fma.ll
> > llvm/test/Transforms/ConstProp/insertvalue.ll
> > llvm/test/Transforms/ConstProp/loads.ll
> > llvm/test/Transforms/ConstProp/logicaltest.ll
> > llvm/test/Transforms/ConstProp/overflow-ops.ll
> > llvm/test/Transforms/ConstProp/phi.ll
> > llvm/test/Transforms/ConstProp/remtest.ll
> > llvm/test/Transforms/ConstProp/shift.ll
> > llvm/test/Transforms/ConstProp/sse.ll
> > llvm/test/Transforms/ConstProp/trunc_vec.ll
> >
> >
> >
> ################################################################################
> > diff --git a/llvm/bindings/go/llvm/executionengine_test.go
> b/llvm/bindings/go/llvm/executionengine_test.go
> > index 4462f8fb2046..2369826db914 100644
> > --- a/llvm/bindings/go/llvm/executionengine_test.go
> > +++ b/llvm/bindings/go/llvm/executionengine_test.go
> > @@ -80,7 +80,6 @@ func TestFactorial(t *testing.T) {
> > pass := NewPassManager()
> > defer pass.Dispose()
> >
> > - pass.AddConstantPropagationPass()
> > pass.AddInstructionCombiningPass()
> > pass.AddPromoteMemoryToRegisterPass()
> > pass.AddGVNPass()
> >
> > diff --git a/llvm/bindings/go/llvm/transforms_scalar.go
> b/llvm/bindings/go/llvm/transforms_scalar.go
> > index 36fc13e00696..d1b54bd2a191 100644
> > --- a/llvm/bindings/go/llvm/transforms_scalar.go
> > +++ b/llvm/bindings/go/llvm/transforms_scalar.go
> > @@ -40,6 +40,5 @@ func (pm PassManager)
> AddScalarReplAggregatesPassWithThreshold(threshold int) {
> > }
> > func (pm PassManager) AddSimplifyLibCallsPass() {
> C.LLVMAddSimplifyLibCallsPass(pm.C) }
> > func (pm PassManager) AddTailCallEliminationPass() {
> C.LLVMAddTailCallEliminationPass(pm.C) }
> > -func (pm PassManager) AddConstantPropagationPass() {
> C.LLVMAddConstantPropagationPass(pm.C) }
> > func (pm PassManager) AddDemoteMemoryToRegisterPass() {
> C.LLVMAddDemoteMemoryToRegisterPass(pm.C) }
> > func (pm PassManager) AddVerifierPass() {
> C.LLVMAddVerifierPass(pm.C) }
> >
> > diff --git
> a/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
> b/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
> > index 117218f06608..bd57ba1136bb 100644
> > ---
> a/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
> > +++
> b/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
> > @@ -161,11 +161,6 @@ external add_tail_call_elimination
> > : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
> > = "llvm_add_tail_call_elimination"
> >
> > -(** See the [llvm::createConstantPropagationPass] function. *)
> > -external add_constant_propagation
> > - : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
> > - = "llvm_add_constant_propagation"
> > -
> > (** See the [llvm::createDemoteMemoryToRegisterPass]
> function. *)
> > external add_memory_to_register_demotion
> > : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
> >
> > diff --git
> a/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
> b/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
> > index 8d10989bd667..1e794c9241d6 100644
> > ---
> a/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
> > +++
> b/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
> > @@ -200,12 +200,6 @@ CAMLprim value
> llvm_add_tail_call_elimination(LLVMPassManagerRef PM) {
> > return Val_unit;
> > }
> >
> > -/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
> > -CAMLprim value
> llvm_add_constant_propagation(LLVMPassManagerRef PM) {
> > - LLVMAddConstantPropagationPass(PM);
> > - return Val_unit;
> > -}
> > -
> > /* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
> > CAMLprim value
> llvm_add_demote_memory_to_register(LLVMPassManagerRef PM) {
> > LLVMAddDemoteMemoryToRegisterPass(PM);
> >
> > diff --git a/llvm/docs/CommandLine.rst
> b/llvm/docs/CommandLine.rst
> > index 431ebc0e67e6..c67e73373ebd 100644
> > --- a/llvm/docs/CommandLine.rst
> > +++ b/llvm/docs/CommandLine.rst
> > @@ -475,7 +475,7 @@ Parsing a list of options
> > Now that we have the standard run-of-the-mill argument
> types out of the way,
> > lets get a little wild and crazy. Lets say that we want
> our optimizer to accept
> > a **list** of optimizations to perform, allowing
> duplicates. For example, we
> > -might want to run: "``compiler -dce -constprop -inline -dce
> -strip``". In this
> > +might want to run: "``compiler -dce -instsimplify -inline
> -dce -strip``". In this
> > case, the order of the arguments and the number of
> appearances is very
> > important. This is what the "``cl::list``" template is
> for. First, start by
> > defining an enum of the optimizations that you would like
> to perform:
> > @@ -484,7 +484,7 @@ defining an enum of the optimizations
> that you would like to perform:
> >
> > enum Opts {
> > // 'inline' is a C++ keyword, so name it 'inlining'
> > - dce, constprop, inlining, strip
> > + dce, instsimplify, inlining, strip
> > };
> >
> > Then define your "``cl::list``" variable:
> > @@ -494,7 +494,7 @@ Then define your "``cl::list``" variable:
> > cl::list<Opts> OptimizationList(cl::desc("Available
> Optimizations:"),
> > cl::values(
> > clEnumVal(dce , "Dead Code Elimination"),
> > - clEnumVal(constprop , "Constant Propagation"),
> > + clEnumVal(instsimplify , "Instruction
> Simplification"),
> > clEnumValN(inlining, "inline", "Procedure Integration"),
> > clEnumVal(strip , "Strip Symbols")));
> >
> > @@ -553,16 +553,16 @@ Reworking the above list example, we
> could replace `cl::list`_ with `cl::bits`_:
> > cl::bits<Opts> OptimizationBits(cl::desc("Available
> Optimizations:"),
> > cl::values(
> > clEnumVal(dce , "Dead Code Elimination"),
> > - clEnumVal(constprop , "Constant Propagation"),
> > + clEnumVal(instsimplify , "Instruction
> Simplification"),
> > clEnumValN(inlining, "inline", "Procedure Integration"),
> > clEnumVal(strip , "Strip Symbols")));
> >
> > -To test to see if ``constprop`` was specified, we can use
> the ``cl:bits::isSet``
> > +To test to see if ``instsimplify`` was specified, we can
> use the ``cl:bits::isSet``
> > function:
> >
> > .. code-block:: c++
> >
> > - if (OptimizationBits.isSet(constprop)) {
> > + if (OptimizationBits.isSet(instsimplify)) {
> > ...
> > }
> >
> >
> > diff --git a/llvm/docs/Passes.rst b/llvm/docs/Passes.rst
> > index 2ff28eb09e54..202e3ab223d6 100644
> > --- a/llvm/docs/Passes.rst
> > +++ b/llvm/docs/Passes.rst
> > @@ -460,27 +460,6 @@ shared. This is useful because some
> passes (i.e., TraceValues) insert a lot of
> > string constants into the program, regardless of whether
> or not an existing
> > string is available.
> >
> > -``-constprop``: Simple constant propagation
> > --------------------------------------------
> > -
> > -This pass implements constant propagation and merging. It
> looks for
> > -instructions involving only constant operands and replaces
> them with a constant
> > -value instead of an instruction. For example:
> > -
> > -.. code-block:: llvm
> > -
> > - add i32 1, 2
> > -
> > -becomes
> > -
> > -.. code-block:: llvm
> > -
> > - i32 3
> > -
> > -NOTE: this pass has a habit of making definitions be dead.
> It is a good idea
> > -to run a :ref:`Dead Instruction Elimination <passes-die>`
> pass sometime after
> > -running this pass.
> > -
> > .. _passes-dce:
> >
> > ``-dce``: Dead Code Elimination
> >
> > diff --git a/llvm/include/llvm-c/Transforms/Scalar.h
> b/llvm/include/llvm-c/Transforms/Scalar.h
> > index 93d79a205195..8b0a4d2642a9 100644
> > --- a/llvm/include/llvm-c/Transforms/Scalar.h
> > +++ b/llvm/include/llvm-c/Transforms/Scalar.h
> > @@ -125,9 +125,6 @@ void
> LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
> > /** See llvm::createTailCallEliminationPass function. */
> > void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
> >
> > -/** See llvm::createConstantPropagationPass function. */
> > -void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM);
> > -
> > /** See llvm::demotePromoteMemoryToRegisterPass function. */
> > void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
> >
> >
> > diff --git a/llvm/include/llvm/InitializePasses.h
> b/llvm/include/llvm/InitializePasses.h
> > index ec97b7f276bf..f1b4d2f71bde 100644
> > --- a/llvm/include/llvm/InitializePasses.h
> > +++ b/llvm/include/llvm/InitializePasses.h
> > @@ -113,7 +113,6 @@ void
> initializeCalledValuePropagationLegacyPassPass(PassRegistry &);
> > void initializeCodeGenPreparePass(PassRegistry&);
> > void initializeConstantHoistingLegacyPassPass(PassRegistry&);
> > void initializeConstantMergeLegacyPassPass(PassRegistry&);
> > -void initializeConstantPropagationPass(PassRegistry&);
> > void
> initializeControlHeightReductionLegacyPassPass(PassRegistry&);
> > void initializeCorrelatedValuePropagationPass(PassRegistry&);
> > void initializeCostModelAnalysisPass(PassRegistry&);
> >
> > diff --git a/llvm/include/llvm/LinkAllPasses.h
> b/llvm/include/llvm/LinkAllPasses.h
> > index 9d7ac2b3f3b9..dfd0e9c8da70 100644
> > --- a/llvm/include/llvm/LinkAllPasses.h
> > +++ b/llvm/include/llvm/LinkAllPasses.h
> > @@ -89,7 +89,6 @@ namespace {
> > (void) llvm::createLibCallsShrinkWrapPass();
> > (void) llvm::createCalledValuePropagationPass();
> > (void) llvm::createConstantMergePass();
> > - (void) llvm::createConstantPropagationPass();
> > (void) llvm::createControlHeightReductionLegacyPass();
> > (void) llvm::createCostModelAnalysisPass();
> > (void) llvm::createDeadArgEliminationPass();
> >
> > diff --git a/llvm/include/llvm/Transforms/Scalar.h
> b/llvm/include/llvm/Transforms/Scalar.h
> > index 8dd59e018061..242ffa0ede09 100644
> > --- a/llvm/include/llvm/Transforms/Scalar.h
> > +++ b/llvm/include/llvm/Transforms/Scalar.h
> > @@ -24,12 +24,6 @@ class FunctionPass;
> > class ModulePass;
> > class Pass;
> >
> >
> -//===----------------------------------------------------------------------===//
> > -//
> > -// ConstantPropagation - A worklist driven constant
> propagation pass
> > -//
> > -FunctionPass *createConstantPropagationPass();
> > -
> >
> //===----------------------------------------------------------------------===//
> > //
> > // AlignmentFromAssumptions - Use assume intrinsics to set
> load/store
> >
> > diff --git a/llvm/lib/Transforms/Scalar/CMakeLists.txt
> b/llvm/lib/Transforms/Scalar/CMakeLists.txt
> > index 9d9712bb0da3..89173414c16b 100644
> > --- a/llvm/lib/Transforms/Scalar/CMakeLists.txt
> > +++ b/llvm/lib/Transforms/Scalar/CMakeLists.txt
> > @@ -4,7 +4,6 @@ add_llvm_component_library(LLVMScalarOpts
> > BDCE.cpp
> > CallSiteSplitting.cpp
> > ConstantHoisting.cpp
> > - ConstantProp.cpp
> > CorrelatedValuePropagation.cpp
> > DCE.cpp
> > DeadStoreElimination.cpp
> >
> > diff --git a/llvm/lib/Transforms/Scalar/ConstantProp.cpp
> b/llvm/lib/Transforms/Scalar/ConstantProp.cpp
> > deleted file mode 100644
> > index 73bf1d521b1d..000000000000
> > --- a/llvm/lib/Transforms/Scalar/ConstantProp.cpp
> > +++ /dev/null
> > @@ -1,121 +0,0 @@
> > -//===- ConstantProp.cpp - Code to perform Simple Constant
> Propagation -----===//
> > -//
> > -// 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 file implements constant propagation and merging:
> > -//
> > -// Specifically, this:
> > -// * Converts instructions like "add int 1, 2" into 3
> > -//
> > -// Notice that:
> > -// * This pass has a habit of making definitions be
> dead. It is a good idea
> > -// to run a DIE pass sometime after running this pass.
> > -//
> >
> -//===----------------------------------------------------------------------===//
> > -
> > -#include "llvm/ADT/SmallPtrSet.h"
> > -#include "llvm/ADT/SmallVector.h"
> > -#include "llvm/ADT/Statistic.h"
> > -#include "llvm/Analysis/ConstantFolding.h"
> > -#include "llvm/Analysis/TargetLibraryInfo.h"
> > -#include "llvm/IR/Constant.h"
> > -#include "llvm/IR/InstIterator.h"
> > -#include "llvm/IR/Instruction.h"
> > -#include "llvm/InitializePasses.h"
> > -#include "llvm/Pass.h"
> > -#include "llvm/Support/DebugCounter.h"
> > -#include "llvm/Transforms/Scalar.h"
> > -#include "llvm/Transforms/Utils/Local.h"
> > -using namespace llvm;
> > -
> > -#define DEBUG_TYPE "constprop"
> > -
> > -STATISTIC(NumInstKilled, "Number of instructions killed");
> > -DEBUG_COUNTER(CPCounter, "constprop-transform",
> > - "Controls which instructions are killed");
> > -
> > -namespace {
> > - struct ConstantPropagation : public FunctionPass {
> > - static char ID; // Pass identification, replacement for
> typeid
> > - ConstantPropagation() : FunctionPass(ID) {
> > -
> initializeConstantPropagationPass(*PassRegistry::getPassRegistry());
> > - }
> > -
> > - bool runOnFunction(Function &F) override;
> > -
> > - void getAnalysisUsage(AnalysisUsage &AU) const override {
> > - AU.setPreservesCFG();
> > - AU.addRequired<TargetLibraryInfoWrapperPass>();
> > - }
> > - };
> > -}
> > -
> > -char ConstantPropagation::ID = 0;
> > -INITIALIZE_PASS_BEGIN(ConstantPropagation, "constprop",
> > - "Simple constant propagation", false, false)
> > -INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
> > -INITIALIZE_PASS_END(ConstantPropagation, "constprop",
> > - "Simple constant propagation", false, false)
> > -
> > -FunctionPass *llvm::createConstantPropagationPass() {
> > - return new ConstantPropagation();
> > -}
> > -
> > -bool ConstantPropagation::runOnFunction(Function &F) {
> > - if (skipFunction(F))
> > - return false;
> > -
> > - // Initialize the worklist to all of the instructions
> ready to process...
> > - SmallPtrSet<Instruction *, 16> WorkList;
> > - // The SmallVector of WorkList ensures that we do
> iteration at stable order.
> > - // We use two containers rather than one SetVector, since
> remove is
> > - // linear-time, and we don't care enough to remove from Vec.
> > - SmallVector<Instruction *, 16> WorkListVec;
> > - for (Instruction &I : instructions(&F)) {
> > - WorkList.insert(&I);
> > - WorkListVec.push_back(&I);
> > - }
> > -
> > - bool Changed = false;
> > - const DataLayout &DL = F.getParent()->getDataLayout();
> > - TargetLibraryInfo *TLI =
> > - &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
> > -
> > - while (!WorkList.empty()) {
> > - SmallVector<Instruction*, 16> NewWorkListVec;
> > - for (auto *I : WorkListVec) {
> > - WorkList.erase(I); // Remove element from the worklist...
> > -
> > - if (!I->use_empty()) // Don't muck with dead
> instructions...
> > - if (Constant *C = ConstantFoldInstruction(I, DL,
> TLI)) {
> > - if (!DebugCounter::shouldExecute(CPCounter))
> > - continue;
> > -
> > - // Add all of the users of this instruction to
> the worklist, they might
> > - // be constant propagatable now...
> > - for (User *U : I->users()) {
> > - // If user not in the set, then add it to the
> vector.
> > - if (WorkList.insert(cast<Instruction>(U)).second)
> > - NewWorkListVec.push_back(cast<Instruction>(U));
> > - }
> > -
> > - // Replace all of the uses of a variable with
> uses of the constant.
> > - I->replaceAllUsesWith(C);
> > -
> > - if (isInstructionTriviallyDead(I, TLI)) {
> > - I->eraseFromParent();
> > - ++NumInstKilled;
> > - }
> > -
> > - // We made a change to the function...
> > - Changed = true;
> > - }
> > - }
> > - WorkListVec = std::move(NewWorkListVec);
> > - }
> > - return Changed;
> > -}
> >
> > diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp
> b/llvm/lib/Transforms/Scalar/Scalar.cpp
> > index 8bc35d5228df..55b9dd7482cc 100644
> > --- a/llvm/lib/Transforms/Scalar/Scalar.cpp
> > +++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
> > @@ -38,7 +38,6 @@ void
> llvm::initializeScalarOpts(PassRegistry &Registry) {
> > initializeAlignmentFromAssumptionsPass(Registry);
> > initializeCallSiteSplittingLegacyPassPass(Registry);
> > initializeConstantHoistingLegacyPassPass(Registry);
> > - initializeConstantPropagationPass(Registry);
> > initializeCorrelatedValuePropagationPass(Registry);
> > initializeDCELegacyPassPass(Registry);
> > initializeDeadInstEliminationPass(Registry);
> > @@ -248,10 +247,6 @@ void
> LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM) {
> > unwrap(PM)->add(createTailCallEliminationPass());
> > }
> >
> > -void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM) {
> > - unwrap(PM)->add(createConstantPropagationPass());
> > -}
> > -
> > void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef
> PM) {
> > unwrap(PM)->add(createDemoteRegisterToMemoryPass());
> > }
> >
> > diff --git
> a/llvm/test/Assembler/2002-04-07-HexFloatConstants.ll
> b/llvm/test/Assembler/2002-04-07-HexFloatConstants.ll
> > index 90ee85a2a302..6bd583eb1a60 100644
> > --- a/llvm/test/Assembler/2002-04-07-HexFloatConstants.ll
> > +++ b/llvm/test/Assembler/2002-04-07-HexFloatConstants.ll
> > @@ -5,8 +5,8 @@
> > ; of the bug that was causing the Olden Health benchmark
> to output incorrect
> > ; results!
> > ;
> > -; RUN: opt -constprop -S > %t.1 < %s
> > -; RUN: llvm-as < %s | llvm-dis | llvm-as | opt -constprop | \
> > +; RUN: opt -instsimplify -S > %t.1 < %s
> > +; RUN: llvm-as < %s | llvm-dis | llvm-as | opt
> -instsimplify | \
> > ; RUN: llvm-dis > %t.2
> > ; RUN:
> > diff %t.1 %t.2
> > ; RUN: verify-uselistorder %s
> >
> > diff --git a/llvm/test/Bitcode/extractelement.ll
> b/llvm/test/Bitcode/extractelement.ll
> > index 90a883d6f02d..10858a6dd30a 100644
> > --- a/llvm/test/Bitcode/extractelement.ll
> > +++ b/llvm/test/Bitcode/extractelement.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop | llvm-dis -disable-output
> > +; RUN: opt < %s -instsimplify | llvm-dis -disable-output
> > ; RUN: verify-uselistorder < %s
> > ; PR3465
> >
> >
> > diff --git a/llvm/test/Other/2002-03-11-ConstPropCrash.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2002-03-11-ConstPropCrash.ll
> > similarity index 96%
> > rename from llvm/test/Other/2002-03-11-ConstPropCrash.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2002-03-11-ConstPropCrash.ll
> > index a6d4f5b3dbcc..fd74fff636ae 100644
> > --- a/llvm/test/Other/2002-03-11-ConstPropCrash.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2002-03-11-ConstPropCrash.ll
> > @@ -5,7 +5,7 @@
> > ;
> > ; Fixed by adding new arguments to ConstantFoldTerminator
> > ;
> > -; RUN: opt < %s -constprop
> > +; RUN: opt < %s -instsimplify
> >
> > define void @build_tree(i32 %ml) {
> > ; <label>:0
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2002-05-03-DivideByZeroException.ll
> > similarity index 90%
> > rename from
> llvm/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2002-05-03-DivideByZeroException.ll
> > index 15a621189382..00fb09cf16af 100644
> > ---
> a/llvm/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2002-05-03-DivideByZeroException.ll
> > @@ -1,6 +1,6 @@
> > ; Make sure that the constant propogator doesn't divide by
> zero!
> > ;
> > -; RUN: opt < %s -constprop
> > +; RUN: opt < %s -instsimplify
> > ;
> >
> > define i32 @test() {
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2002-05-03-NotOperator.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2002-05-03-NotOperator.ll
> > similarity index 92%
> > rename from
> llvm/test/Transforms/ConstProp/2002-05-03-NotOperator.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2002-05-03-NotOperator.ll
> > index ca1d6180c758..aa0bdc9fd41e 100644
> > --- a/llvm/test/Transforms/ConstProp/2002-05-03-NotOperator.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2002-05-03-NotOperator.ll
> > @@ -4,7 +4,7 @@
> >
> > ; Fix #2: The unary not instruction now no longer exists.
> Change to xor.
> >
> > -; RUN: opt < %s -constprop -S | \
> > +; RUN: opt < %s -instsimplify -S | \
> > ; RUN: not grep "i32 0"
> >
> > define i32 @test1() {
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2002-09-03-SetCC-Bools.ll
> > similarity index 94%
> > rename from
> llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2002-09-03-SetCC-Bools.ll
> > index dd24d965620c..65ea22583c04 100644
> > --- a/llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2002-09-03-SetCC-Bools.ll
> > @@ -1,6 +1,6 @@
> > ; SetCC on boolean values was not implemented!
> >
> > -; RUN: opt < %s -constprop -die -S | \
> > +; RUN: opt < %s -instsimplify -die -S | \
> > ; RUN: not grep set
> >
> > define i1 @test1() {
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2003-05-12-DivideError.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2003-05-12-DivideError.ll
> > similarity index 90%
> > rename from
> llvm/test/Transforms/ConstProp/2003-05-12-DivideError.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2003-05-12-DivideError.ll
> > index 2708dce9852d..52bb044f45e8 100644
> > --- a/llvm/test/Transforms/ConstProp/2003-05-12-DivideError.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2003-05-12-DivideError.ll
> > @@ -1,6 +1,6 @@
> > ; Make sure that the constant propagator doesn't cause a
> sigfpe
> > ;
> > -; RUN: opt < %s -constprop
> > +; RUN: opt < %s -instsimplify
> > ;
> >
> > define i32 @test() {
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2005-01-28-SetCCGEP.ll
> > similarity index 89%
> > rename from
> llvm/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2005-01-28-SetCCGEP.ll
> > index af7e8be4fcd8..0518a91f0c66 100644
> > --- a/llvm/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2005-01-28-SetCCGEP.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | \
> > +; RUN: opt < %s -instsimplify -S | \
> > ; RUN: not grep "ret i1 false"
> >
> > @b = external global [2 x { }] ; <[2 x { }]*>
> [#uses=2]
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2006-11-30-vector-cast.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2006-11-30-vector-cast.ll
> > similarity index 77%
> > rename from
> llvm/test/Transforms/ConstProp/2006-11-30-vector-cast.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2006-11-30-vector-cast.ll
> > index 4a93144d2d51..bf5615414aa2 100644
> > --- a/llvm/test/Transforms/ConstProp/2006-11-30-vector-cast.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2006-11-30-vector-cast.ll
> > @@ -1,6 +1,6 @@
> > -; RUN: opt < %s -constprop -S | \
> > +; RUN: opt < %s -instsimplify -S | \
> > ; RUN: grep "i32 -1"
> > -; RUN: opt < %s -constprop -S | \
> > +; RUN: opt < %s -instsimplify -S | \
> > ; RUN: not grep zeroinitializer
> >
> > define <4 x i32> @test() {
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2006-12-01-TruncBoolBug.ll
> > similarity index 100%
> > rename from
> llvm/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2006-12-01-TruncBoolBug.ll
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2006-12-01-bool-casts.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2006-12-01-bool-casts.ll
> > similarity index 78%
> > rename from
> llvm/test/Transforms/ConstProp/2006-12-01-bool-casts.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2006-12-01-bool-casts.ll
> > index 71db4211c5d2..6d323435c425 100644
> > --- a/llvm/test/Transforms/ConstProp/2006-12-01-bool-casts.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2006-12-01-bool-casts.ll
> > @@ -1,6 +1,6 @@
> > -; RUN: opt < %s -constprop -S | \
> > +; RUN: opt < %s -instsimplify -S | \
> > ; RUN: grep "ret i32 -1"
> > -; RUN: opt < %s -constprop -S | \
> > +; RUN: opt < %s -instsimplify -S | \
> > ; RUN: grep "ret i32 1"
> >
> > define i32 @test1() {
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2007-02-05-BitCast.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2007-02-05-BitCast.ll
> > similarity index 69%
> > rename from llvm/test/Transforms/ConstProp/2007-02-05-BitCast.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2007-02-05-BitCast.ll
> > index ebe3d21806b7..8df5c405dd9e 100644
> > --- a/llvm/test/Transforms/ConstProp/2007-02-05-BitCast.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2007-02-05-BitCast.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | grep 1065353216
> > +; RUN: opt < %s -instsimplify -S | grep 1065353216
> >
> > define i32 @test() {
> > %A = bitcast float 1.000000e+00 to i32 ; <i32>
> [#uses=1]
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2007-02-23-sdiv.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2007-02-23-sdiv.ll
> > similarity index 100%
> > rename from llvm/test/Transforms/ConstProp/2007-02-23-sdiv.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2007-02-23-sdiv.ll
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2008-07-07-VectorCompare.ll
> > similarity index 94%
> > rename from
> llvm/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2008-07-07-VectorCompare.ll
> > index fd5495445b79..bc8eed58970a 100644
> > --- a/llvm/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2008-07-07-VectorCompare.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -disable-output
> > +; RUN: opt < %s -instsimplify -disable-output
> > ; PR2529
> > define <4 x i1> @test1(i32 %argc, i8** %argv) {
> > entry:
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2009-06-20-constexpr-zero-lhs.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2009-06-20-constexpr-zero-lhs.ll
> > similarity index 100%
> > rename from
> llvm/test/Transforms/ConstProp/2009-06-20-constexpr-zero-lhs.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2009-06-20-constexpr-zero-lhs.ll
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/2009-09-01-GEP-Crash.ll
> > similarity index 96%
> > rename from
> llvm/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/2009-09-01-GEP-Crash.ll
> > index e93a2c066bd2..25cd3bb59fc8 100644
> > --- a/llvm/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/2009-09-01-GEP-Crash.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop | llvm-dis
> > +; RUN: opt < %s -instsimplify | llvm-dis
> > ; PR4848
> > target datalayout =
> "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
> > target triple = "x86_64-unknown-linux-gnu"
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/cos.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cos.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/AMDGPU/cos.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cos.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/cubeid.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubeid.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/AMDGPU/cubeid.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubeid.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/cubema.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubema.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/AMDGPU/cubema.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubema.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/cubesc.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubesc.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/AMDGPU/cubesc.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubesc.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/cubetc.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubetc.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/AMDGPU/cubetc.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/cubetc.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/fmul_legacy.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/fmul_legacy.ll
> > similarity index 100%
> > rename from
> llvm/test/Analysis/ConstantFolding/AMDGPU/fmul_legacy.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/fmul_legacy.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/fract.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/fract.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/AMDGPU/fract.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/fract.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/lit.local.cfg
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/lit.local.cfg
> > similarity index 100%
> > rename from
> llvm/test/Analysis/ConstantFolding/AMDGPU/lit.local.cfg
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/lit.local.cfg
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/AMDGPU/sin.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/sin.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/AMDGPU/sin.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/sin.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/ARM/lit.local.cfg
> b/llvm/test/Transforms/InstSimplify/ConstProp/ARM/lit.local.cfg
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/ARM/lit.local.cfg
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/ARM/lit.local.cfg
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/ARM/mve-vctp.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/ARM/mve-vctp.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/ARM/mve-vctp.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/ARM/mve-vctp.ll
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/InsertElement.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/InsertElement.ll
> > similarity index 91%
> > rename from llvm/test/Transforms/ConstProp/InsertElement.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/InsertElement.ll
> > index 1048b5752e8b..98ba4c6f0036 100644
> > --- a/llvm/test/Transforms/ConstProp/InsertElement.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/InsertElement.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > define i32 @test1() {
> > ; CHECK-LABEL: @test1(
> > @@ -25,7 +25,6 @@ define <4 x i64> @insertelement() {
> >
> > define <4 x i64> @insertelement_undef() {
> > ; CHECK-LABEL: @insertelement_undef(
> > -; CHECK-NEXT: [[VEC4:%.*]] = insertelement <4 x i64>
> <i64 -1, i64 -2, i64 -3, i64 undef>, i64 -4, i32 3
> > ; CHECK-NEXT: ret <4 x i64> undef
> > ;
> > %vec1 = insertelement <4 x i64> undef, i64 -1, i32 0
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/WebAssembly/trunc.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/trunc.ll
> > similarity index 100%
> > rename from
> llvm/test/Analysis/ConstantFolding/WebAssembly/trunc.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/trunc.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/WebAssembly/trunc_saturate.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/trunc_saturate.ll
> > similarity index 100%
> > rename from
> llvm/test/Analysis/ConstantFolding/WebAssembly/trunc_saturate.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/trunc_saturate.ll
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/abs.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/abs.ll
> > similarity index 95%
> > rename from llvm/test/Analysis/ConstantFolding/abs.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/abs.ll
> > index 7b3a146e8614..73e12f956382 100644
> > --- a/llvm/test/Analysis/ConstantFolding/abs.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/abs.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > declare i8 @llvm.abs.i8(i8, i1)
> > declare <8 x i8> @llvm.abs.v8i8(<8 x i8>, i1)
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/allones.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/allones.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/allones.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/allones.ll
> >
> > diff --git a/llvm/test/Transforms/ConstProp/avx512.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/avx512.ll
> > similarity index 99%
> > rename from llvm/test/Transforms/ConstProp/avx512.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/avx512.ll
> > index 7043c23315cd..9649611fd8fe 100644
> > --- a/llvm/test/Transforms/ConstProp/avx512.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/avx512.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> > ; REQUIRES: x86-registered-target
> >
> > define i1 @test_avx512_cvts_exact() nounwind readnone {
> >
> > diff --git a/llvm/test/Transforms/ConstProp/basictest.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/basictest.ll
> > similarity index 96%
> > rename from llvm/test/Transforms/ConstProp/basictest.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/basictest.ll
> > index afe6ef91240d..3c1e97f3c9b5 100644
> > --- a/llvm/test/Transforms/ConstProp/basictest.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/basictest.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -die -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -die -S | FileCheck %s
> >
> > target datalayout =
> "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
> > target triple = "x86_64-apple-macosx10.7.2"
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/binop-identity-undef.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/binop-identity-undef.ll
> > similarity index 94%
> > rename from
> llvm/test/Analysis/ConstantFolding/binop-identity-undef.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/binop-identity-undef.ll
> > index 68307892187c..7b36b5555ae7 100644
> > --- a/llvm/test/Analysis/ConstantFolding/binop-identity-undef.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/binop-identity-undef.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt -constprop -S %s | FileCheck %s
> > +; RUN: opt -instsimplify -S %s | FileCheck %s
> >
> > define i32 @and1() {
> > ; CHECK-LABEL: @and1(
> >
> > diff --git a/llvm/test/Transforms/ConstProp/bitcast.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/bitcast.ll
> > similarity index 98%
> > rename from llvm/test/Transforms/ConstProp/bitcast.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/bitcast.ll
> > index 7b07391ee869..19165da28bba 100644
> > --- a/llvm/test/Transforms/ConstProp/bitcast.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/bitcast.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> > ; PR2165
> >
> > define <1 x i64> @test1() {
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/bitcount.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/bitcount.ll
> > similarity index 98%
> > rename from llvm/test/Analysis/ConstantFolding/bitcount.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/bitcount.ll
> > index 6333c4d24d09..f737653a6f3b 100644
> > --- a/llvm/test/Analysis/ConstantFolding/bitcount.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/bitcount.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > declare i31 @llvm.ctpop.i31(i31 %val)
> > declare i32 @llvm.cttz.i32(i32 %val, i1)
> >
> > diff --git a/llvm/test/Transforms/ConstProp/bswap.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/bswap.ll
> > similarity index 95%
> > rename from llvm/test/Transforms/ConstProp/bswap.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/bswap.ll
> > index f601deb73db2..d06545dcde34 100644
> > --- a/llvm/test/Transforms/ConstProp/bswap.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/bswap.ll
> > @@ -1,6 +1,6 @@
> > ; bswap should be constant folded when it is passed a
> constant argument
> >
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > declare i16 @llvm.bswap.i16(i16)
> >
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/calls-math-finite.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/calls-math-finite.ll
> > similarity index 97%
> > rename from llvm/test/Transforms/ConstProp/calls-math-finite.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/calls-math-finite.ll
> > index d13b798bde21..307324640000 100644
> > --- a/llvm/test/Transforms/ConstProp/calls-math-finite.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/calls-math-finite.ll
> > @@ -1,6 +1,6 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > -; RUN: opt < %s -constprop -S
> -mtriple=unknown-unknown-linux-musl | FileCheck
> -check-prefix=MUSL %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S
> -mtriple=unknown-unknown-linux-musl | FileCheck
> -check-prefix=MUSL %s
> >
> > ; Test to verify constant folding can occur when math
> routines are mapped
> > ; to the __<func>_finite versions of functions due to
> __FINITE_MATH_ONLY__
> >
> > diff --git a/llvm/test/Transforms/ConstProp/calls.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/calls.ll
> > similarity index 97%
> > rename from llvm/test/Transforms/ConstProp/calls.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/calls.ll
> > index 12ee1cb11393..84aa7c2913a2 100644
> > --- a/llvm/test/Transforms/ConstProp/calls.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/calls.ll
> > @@ -1,5 +1,5 @@
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > -; RUN: opt < %s -constprop -disable-simplify-libcalls -S |
> FileCheck %s --check-prefix=FNOBUILTIN
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -disable-simplify-libcalls -S
> | FileCheck %s --check-prefix=FNOBUILTIN
> >
> > declare double @acos(double) readnone nounwind
> > declare double @asin(double) readnone nounwind
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/cast-vector.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/cast-vector.ll
> > similarity index 97%
> > rename from llvm/test/Analysis/ConstantFolding/cast-vector.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/cast-vector.ll
> > index 1aaf55a23b50..f73058741e54 100644
> > --- a/llvm/test/Analysis/ConstantFolding/cast-vector.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/cast-vector.ll
> > @@ -1,32 +1,32 @@
> > -; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -instsimplify -S | FileCheck %s
> > -
> > -; Test constant fold of constant expression GEP used by
> ptrtoint (the
> > -; "offsetof-like expression" case).
> > -; This used to hit an assert due to not supporting vectors in
> > -; llvm::ConstantFoldCastInstruction when handling ptrtoint.
> > -define <2 x i16> @test1() {
> > -; CHECK-LABEL: @test1(
> > -; CHECK-NEXT: entry:
> > -; CHECK-NEXT: ret <2 x i16> ptrtoint (<2 x i32*>
> getelementptr ([10 x i32], [10 x i32]* null, <2 x i64>
> zeroinitializer, <2 x i64> <i64 5, i64 7>) to <2 x i16>)
> > -;
> > -entry:
> > - %gep = getelementptr inbounds [10 x i32], [10 x i32]*
> null, i16 0, <2 x i16> <i16 5, i16 7>
> > - %vec = ptrtoint <2 x i32*> %gep to <2 x i16>
> > - ret <2 x i16> %vec
> > -}
> > -
> > -; Test constant fold of constant expression GEP used by
> ptrtoint (the
> > -; "sizeof-like expression" case).
> > -; This used to hit an assert due to not supporting vectors in
> > -; llvm::ConstantFoldCastInstruction when handling ptrtoint.
> > -define <2 x i16> @test2() {
> > -; CHECK-LABEL: @test2(
> > -; CHECK-NEXT: entry:
> > -; CHECK-NEXT: ret <2 x i16> ptrtoint (<2 x i32*>
> getelementptr (i32, i32* null, <2 x i64> <i64 5, i64 7>) to <2
> x i16>)
> > -;
> > -entry:
> > - %gep = getelementptr i32, i32* null, <2 x i16> <i16 5, i16 7>
> > - %vec = ptrtoint <2 x i32*> %gep to <2 x i16>
> > - ret <2 x i16> %vec
> > -}
> > +; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> > +
> > +; Test constant fold of constant expression GEP used by
> ptrtoint (the
> > +; "offsetof-like expression" case).
> > +; This used to hit an assert due to not supporting vectors in
> > +; llvm::ConstantFoldCastInstruction when handling ptrtoint.
> > +define <2 x i16> @test1() {
> > +; CHECK-LABEL: @test1(
> > +; CHECK-NEXT: entry:
> > +; CHECK-NEXT: ret <2 x i16> ptrtoint (<2 x i32*>
> getelementptr ([10 x i32], [10 x i32]* null, <2 x i64>
> zeroinitializer, <2 x i64> <i64 5, i64 7>) to <2 x i16>)
> > +;
> > +entry:
> > + %gep = getelementptr inbounds [10 x i32], [10 x i32]*
> null, i16 0, <2 x i16> <i16 5, i16 7>
> > + %vec = ptrtoint <2 x i32*> %gep to <2 x i16>
> > + ret <2 x i16> %vec
> > +}
> > +
> > +; Test constant fold of constant expression GEP used by
> ptrtoint (the
> > +; "sizeof-like expression" case).
> > +; This used to hit an assert due to not supporting vectors in
> > +; llvm::ConstantFoldCastInstruction when handling ptrtoint.
> > +define <2 x i16> @test2() {
> > +; CHECK-LABEL: @test2(
> > +; CHECK-NEXT: entry:
> > +; CHECK-NEXT: ret <2 x i16> ptrtoint (<2 x i32*>
> getelementptr (i32, i32* null, <2 x i64> <i64 5, i64 7>) to <2
> x i16>)
> > +;
> > +entry:
> > + %gep = getelementptr i32, i32* null, <2 x i16> <i16 5, i16 7>
> > + %vec = ptrtoint <2 x i32*> %gep to <2 x i16>
> > + ret <2 x i16> %vec
> > +}
> >
> > diff --git a/llvm/test/Transforms/ConstProp/cast.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll
> > similarity index 95%
> > rename from llvm/test/Transforms/ConstProp/cast.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/cast.ll
> > index 8377df17b3a8..170e2d55421c 100644
> > --- a/llvm/test/Transforms/ConstProp/cast.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > ; Overflow on a float to int or int to float conversion is
> undefined (PR21130).
> >
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/constant-expr.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/constant-expr.ll
> > similarity index 100%
> > rename from llvm/test/Transforms/ConstProp/constant-expr.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/constant-expr.ll
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/convert-from-fp16.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/convert-from-fp16.ll
> > similarity index 98%
> > rename from llvm/test/Transforms/ConstProp/convert-from-fp16.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/convert-from-fp16.ll
> > index bb9032313179..f5b6705fe78c 100644
> > --- a/llvm/test/Transforms/ConstProp/convert-from-fp16.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/convert-from-fp16.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt -constprop -S < %s | FileCheck %s
> > +; RUN: opt -instsimplify -S < %s | FileCheck %s
> >
> > ; Verify that we don't crash with an assertion failure
> when constant folding
> > ; a call to intrinsic 'convert.from.fp16' if the return
> type is not 'float'.
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/copysign.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/copysign.ll
> > similarity index 96%
> > rename from llvm/test/Analysis/ConstantFolding/copysign.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/copysign.ll
> > index 228ffcb47053..52eb743d827b 100644
> > --- a/llvm/test/Analysis/ConstantFolding/copysign.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/copysign.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt -S -constprop < %s | FileCheck %s
> > +; RUN: opt -S -instsimplify < %s | FileCheck %s
> >
> > declare float @llvm.copysign.f32(float, float)
> > declare double @llvm.copysign.f64(double, double)
> >
> > diff --git a/llvm/test/Transforms/ConstProp/div-zero.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/div-zero.ll
> > similarity index 100%
> > rename from llvm/test/Transforms/ConstProp/div-zero.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/div-zero.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/extractelement-vscale.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/extractelement-vscale.ll
> > similarity index 100%
> > rename from
> llvm/test/Analysis/ConstantFolding/extractelement-vscale.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/extractelement-vscale.ll
> >
> > diff --git a/llvm/test/Transforms/ConstProp/extractvalue.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/extractvalue.ll
> > similarity index 96%
> > rename from llvm/test/Transforms/ConstProp/extractvalue.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/extractvalue.ll
> > index 72d6cb714a54..2c29cf0a61a3 100644
> > --- a/llvm/test/Transforms/ConstProp/extractvalue.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/extractvalue.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > %struct = type { i32, [4 x i8] }
> >
> >
> > diff --git
> a/llvm/test/Transforms/ConstProp/float-to-ptr-cast.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/float-to-ptr-cast.ll
> > similarity index 81%
> > rename from llvm/test/Transforms/ConstProp/float-to-ptr-cast.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/float-to-ptr-cast.ll
> > index 937f606bf136..56b1704db0d2 100644
> > --- a/llvm/test/Transforms/ConstProp/float-to-ptr-cast.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/float-to-ptr-cast.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > define i32* @test1() {
> > %X = inttoptr i64 0 to i32* ; <i32*>
> [#uses=1]
> >
> > diff --git a/llvm/test/Transforms/ConstProp/fma.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/fma.ll
> > similarity index 99%
> > rename from llvm/test/Transforms/ConstProp/fma.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/fma.ll
> > index e1c46978f9a7..90a6142b956b 100644
> > --- a/llvm/test/Transforms/ConstProp/fma.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/fma.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt -constprop -S < %s | FileCheck %s
> > +; RUN: opt -instsimplify -S < %s | FileCheck %s
> >
> > ; Fixes PR20832
> > ; Make sure that we correctly fold a fused multiply-add
> where operands
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/fneg.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/fneg.ll
> > similarity index 96%
> > rename from llvm/test/Analysis/ConstantFolding/fneg.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/fneg.ll
> > index 70a2fe2a4bdd..752dfa929eec 100644
> > --- a/llvm/test/Analysis/ConstantFolding/fneg.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/fneg.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > define float @fneg_constant() {
> > ; CHECK-LABEL: @fneg_constant(
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/fp-undef.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/fp-undef.ll
> > similarity index 99%
> > rename from llvm/test/Analysis/ConstantFolding/fp-undef.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/fp-undef.ll
> > index ad9cca7cff91..9d904595f2ca 100644
> > --- a/llvm/test/Analysis/ConstantFolding/fp-undef.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/fp-undef.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > ; Constant folding - undef undef.
> >
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/freeze.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/freeze.ll
> > similarity index 93%
> > rename from llvm/test/Analysis/ConstantFolding/freeze.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/freeze.ll
> > index 4908f71b924e..ef032a6b1624 100644
> > --- a/llvm/test/Analysis/ConstantFolding/freeze.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/freeze.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > @g = external global i16, align 1
> > @g2 = external global i16, align 1
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/funnel-shift.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/funnel-shift.ll
> > similarity index 99%
> > rename from llvm/test/Analysis/ConstantFolding/funnel-shift.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/funnel-shift.ll
> > index fae29c939216..8533224b8e93 100644
> > --- a/llvm/test/Analysis/ConstantFolding/funnel-shift.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/funnel-shift.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S -o - | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S -o - | FileCheck %s
> >
> > declare i32 @llvm.fshl.i32(i32, i32, i32)
> > declare i32 @llvm.fshr.i32(i32, i32, i32)
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/gep-alias.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/gep-alias.ll
> > similarity index 97%
> > rename from llvm/test/Analysis/ConstantFolding/gep-alias.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/gep-alias.ll
> > index 0fcc778a4f25..4b3fcf667979 100644
> > --- a/llvm/test/Analysis/ConstantFolding/gep-alias.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/gep-alias.ll
> > @@ -1,17 +1,17 @@
> > -; RUN: opt -instcombine -S -o - %s | FileCheck %s
> > -; Test that we don't replace an alias with its aliasee when
> simplifying GEPs.
> > -; In this test case the transformation is invalid because
> it replaces the
> > -; reference to the symbol "b" (which refers to whichever
> instance of "b"
> > -; was chosen by the linker) with a reference to "a" (which
> refers to the
> > -; specific instance of "b" in this module).
> > -
> > -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> > -target triple = "x86_64-unknown-linux-gnu"
> > -
> > - at a = internal global [3 x i8*] zeroinitializer
> > - at b = linkonce_odr alias [3 x i8*], [3 x i8*]* @a
> > -
> > -define i8** @f() {
> > - ; CHECK: ret i8** getelementptr ([3 x i8*], [3 x i8*]*
> @b, i64 0, i64 1)
> > - ret i8** getelementptr ([3 x i8*], [3 x i8*]* @b, i64 0,
> i64 1)
> > -}
> > +; RUN: opt -instcombine -S -o - %s | FileCheck %s
> > +; Test that we don't replace an alias with its aliasee when
> simplifying GEPs.
> > +; In this test case the transformation is invalid because
> it replaces the
> > +; reference to the symbol "b" (which refers to whichever
> instance of "b"
> > +; was chosen by the linker) with a reference to "a" (which
> refers to the
> > +; specific instance of "b" in this module).
> > +
> > +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> > +target triple = "x86_64-unknown-linux-gnu"
> > +
> > + at a = internal global [3 x i8*] zeroinitializer
> > + at b = linkonce_odr alias [3 x i8*], [3 x i8*]* @a
> > +
> > +define i8** @f() {
> > + ; CHECK: ret i8** getelementptr ([3 x i8*], [3 x i8*]*
> @b, i64 0, i64 1)
> > + ret i8** getelementptr ([3 x i8*], [3 x i8*]* @b, i64 0,
> i64 1)
> > +}
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/gep-constanfolding-error.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/gep-constanfolding-error.ll
> > similarity index 98%
> > rename from
> llvm/test/Analysis/ConstantFolding/gep-constanfolding-error.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/gep-constanfolding-error.ll
> > index a09fd550715d..ee7112b55268 100644
> > ---
> a/llvm/test/Analysis/ConstantFolding/gep-constanfolding-error.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/gep-constanfolding-error.ll
> > @@ -1,52 +1,52 @@
> > -; RUN: opt -gvn -S -o - %s | FileCheck %s
> > -; RUN: opt -newgvn -S -o - %s | FileCheck %s
> > -; Test that the constantfolding getelementptr computation
> results in
> > -; j[5][4][1] (j+239)
> > -; and not [1][4][4][1] (#449) which is an incorrect
> out-of-range error
> > -target datalayout =
> "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
> > -target triple = "armv7-none-eabi"
> > -
> > - at f = local_unnamed_addr global i32 2, align 4
> > - at t6 = local_unnamed_addr global i32 1, align 4
> > - at j = local_unnamed_addr global [6 x [6 x [7 x i8]]] [[6 x
> [7 x i8]] [[7 x i8] c"\06\00\00\00\00\00\00", [7 x i8]
> zeroinitializer, [7 x i8] zeroinitializer, [7 x i8]
> zeroinitializer, [7 x i8] zeroinitializer, [7 x i8]
> zeroinitializer], [6 x [7 x i8]] zeroinitializer, [6 x [7 x
> i8]] zeroinitializer, [6 x [7 x i8]] zeroinitializer, [6 x [7
> x i8]] zeroinitializer, [6 x [7 x i8]] zeroinitializer], align 1
> > - at p = internal global i64 0, align 8
> > - at y = local_unnamed_addr global i64* @p, align 4
> > - at b = internal unnamed_addr global i32 0, align 4
> > - at h = common local_unnamed_addr global i16 0, align 2
> > - at a = common local_unnamed_addr global i32 0, align 4
> > - at k = common local_unnamed_addr global i32 0, align 4
> > - at t11 = common local_unnamed_addr global i32 0, align 4
> > -
> > -; Function Attrs: nounwind
> > -define i32 @main() local_unnamed_addr {
> > -entry:
> > - %0 = load i32, i32* @t6, align 4
> > - %inc = add nsw i32 %0, 1
> > - store i32 %inc, i32* @t6, align 4
> > - store i16 4, i16* @h, align 2
> > - %1 = load i32, i32* @a, align 4
> > - %conv = trunc i32 %1 to i8
> > - store i32 1, i32* @f, align 4
> > - %2 = load i64, i64* @p, align 8
> > - %cmp4 = icmp slt i64 %2, 2
> > - %conv6 = zext i1 %cmp4 to i8
> > - %3 = load i16, i16* @h, align 2
> > - %conv7 = sext i16 %3 to i32
> > - %add = add nsw i32 %conv7, 1
> > - %f.promoted = load i32, i32* @f, align 4
> > - %4 = mul i32 %conv7, 7
> > - %5 = add i32 %4, 5
> > - %6 = sub i32 -1, %f.promoted
> > - %7 = icmp sgt i32 %6, -2
> > - %smax = select i1 %7, i32 %6, i32 -2
> > - %8 = sub i32 6, %smax
> > - %scevgep = getelementptr [6 x [6 x [7 x i8]]], [6 x [6 x
> [7 x i8]]]* @j, i32 0, i32 0, i32 %5, i32 %8
> > - %9 = add i32 %f.promoted, %smax
> > - %10 = add i32 %9, 2
> > - call void @llvm.memset.p0i8.i32(i8* %scevgep, i8 %conv6,
> i32 %10, i1 false)
> > -; CHECK: call void @llvm.memset.p0i8.i32(i8* getelementptr
> inbounds ([6 x [6 x [7 x i8]]], [6 x [6 x [7 x i8]]]* @j, i32
> 0, i{{32|64}} 5, i{{32|64}} 4, i32 1), i8 %conv6, i32 1, i1 false)
> > -; CHECK-NOT: call void @llvm.memset.p0i8.i32(i8*
> getelementptr ([6 x [6 x [7 x i8]]], [6 x [6 x [7 x i8]]]* @j,
> i64 1, i64 4, i64 4, i32 1)
> > - ret i32 0
> > -}
> > -; Function Attrs: argmemonly nounwind
> > -declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly,
> i8, i32, i1)
> > +; RUN: opt -gvn -S -o - %s | FileCheck %s
> > +; RUN: opt -newgvn -S -o - %s | FileCheck %s
> > +; Test that the constantfolding getelementptr computation
> results in
> > +; j[5][4][1] (j+239)
> > +; and not [1][4][4][1] (#449) which is an incorrect
> out-of-range error
> > +target datalayout =
> "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
> > +target triple = "armv7-none-eabi"
> > +
> > + at f = local_unnamed_addr global i32 2, align 4
> > + at t6 = local_unnamed_addr global i32 1, align 4
> > + at j = local_unnamed_addr global [6 x [6 x [7 x i8]]] [[6 x
> [7 x i8]] [[7 x i8] c"\06\00\00\00\00\00\00", [7 x i8]
> zeroinitializer, [7 x i8] zeroinitializer, [7 x i8]
> zeroinitializer, [7 x i8] zeroinitializer, [7 x i8]
> zeroinitializer], [6 x [7 x i8]] zeroinitializer, [6 x [7 x
> i8]] zeroinitializer, [6 x [7 x i8]] zeroinitializer, [6 x [7
> x i8]] zeroinitializer, [6 x [7 x i8]] zeroinitializer], align 1
> > + at p = internal global i64 0, align 8
> > + at y = local_unnamed_addr global i64* @p, align 4
> > + at b = internal unnamed_addr global i32 0, align 4
> > + at h = common local_unnamed_addr global i16 0, align 2
> > + at a = common local_unnamed_addr global i32 0, align 4
> > + at k = common local_unnamed_addr global i32 0, align 4
> > + at t11 = common local_unnamed_addr global i32 0, align 4
> > +
> > +; Function Attrs: nounwind
> > +define i32 @main() local_unnamed_addr {
> > +entry:
> > + %0 = load i32, i32* @t6, align 4
> > + %inc = add nsw i32 %0, 1
> > + store i32 %inc, i32* @t6, align 4
> > + store i16 4, i16* @h, align 2
> > + %1 = load i32, i32* @a, align 4
> > + %conv = trunc i32 %1 to i8
> > + store i32 1, i32* @f, align 4
> > + %2 = load i64, i64* @p, align 8
> > + %cmp4 = icmp slt i64 %2, 2
> > + %conv6 = zext i1 %cmp4 to i8
> > + %3 = load i16, i16* @h, align 2
> > + %conv7 = sext i16 %3 to i32
> > + %add = add nsw i32 %conv7, 1
> > + %f.promoted = load i32, i32* @f, align 4
> > + %4 = mul i32 %conv7, 7
> > + %5 = add i32 %4, 5
> > + %6 = sub i32 -1, %f.promoted
> > + %7 = icmp sgt i32 %6, -2
> > + %smax = select i1 %7, i32 %6, i32 -2
> > + %8 = sub i32 6, %smax
> > + %scevgep = getelementptr [6 x [6 x [7 x i8]]], [6 x [6 x
> [7 x i8]]]* @j, i32 0, i32 0, i32 %5, i32 %8
> > + %9 = add i32 %f.promoted, %smax
> > + %10 = add i32 %9, 2
> > + call void @llvm.memset.p0i8.i32(i8* %scevgep, i8 %conv6,
> i32 %10, i1 false)
> > +; CHECK: call void @llvm.memset.p0i8.i32(i8* getelementptr
> inbounds ([6 x [6 x [7 x i8]]], [6 x [6 x [7 x i8]]]* @j, i32
> 0, i{{32|64}} 5, i{{32|64}} 4, i32 1), i8 %conv6, i32 1, i1 false)
> > +; CHECK-NOT: call void @llvm.memset.p0i8.i32(i8*
> getelementptr ([6 x [6 x [7 x i8]]], [6 x [6 x [7 x i8]]]* @j,
> i64 1, i64 4, i64 4, i32 1)
> > + ret i32 0
> > +}
> > +; Function Attrs: argmemonly nounwind
> > +declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly,
> i8, i32, i1)
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/gep-zeroinit-vector.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/gep-zeroinit-vector.ll
> > similarity index 94%
> > rename from
> llvm/test/Analysis/ConstantFolding/gep-zeroinit-vector.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/gep-zeroinit-vector.ll
> > index 03d27e9fb6c5..7ec1aa833fc4 100644
> > --- a/llvm/test/Analysis/ConstantFolding/gep-zeroinit-vector.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/gep-zeroinit-vector.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S -o - | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S -o - | FileCheck %s
> >
> > ; Testcase that verify that we don't get a faulty bitcast
> that cast between
> > ;
> > diff erent sizes.
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/gep.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/gep.ll
> > similarity index 98%
> > rename from llvm/test/Analysis/ConstantFolding/gep.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/gep.ll
> > index 259618652ea9..103226045037 100644
> > --- a/llvm/test/Analysis/ConstantFolding/gep.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/gep.ll
> > @@ -1,27 +1,27 @@
> > -; RUN: opt -instcombine -S -o - %s | FileCheck %s
> > -; Tests that we preserve the inrange attribute on indices
> where possible.
> > -
> > -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> > -target triple = "x86_64-unknown-linux-gnu"
> > -
> > -%struct.A = type { i32 (...)** }
> > -
> > - at vt = external global [3 x i8*]
> > -
> > -; CHECK: define i32 (...)** @f0()
> > -define i32 (...)** @f0() {
> > - ; CHECK-NEXT: ret i32 (...)** bitcast (i8** getelementptr
> inbounds ([3 x i8*], [3 x i8*]* @vt, inrange i64 0, i64 2) to
> i32 (...)**
> > - ret i32 (...)** getelementptr (i32 (...)*, i32 (...)**
> bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]*
> @vt, inrange i64 0, i64 1) to i32 (...)**), i64 1)
> > -}
> > -
> > -; CHECK: define i32 (...)** @f1()
> > -define i32 (...)** @f1() {
> > - ; CHECK-NEXT: ret i32 (...)** getelementptr (i32 (...)*,
> i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*],
> [3 x i8*]* @vt, i64 0, inrange i64 1) to i32 (...)**), i64 1)
> > - ret i32 (...)** getelementptr (i32 (...)*, i32 (...)**
> bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]*
> @vt, i64 0, inrange i64 1) to i32 (...)**), i64 1)
> > -}
> > -
> > -; CHECK: define i32 (...)** @f2()
> > -define i32 (...)** @f2() {
> > - ; CHECK-NEXT: ret i32 (...)** getelementptr (i32 (...)*,
> i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*],
> [3 x i8*]* @vt, i64 0, inrange i64 1) to i32 (...)**), i64 3)
> > - ret i32 (...)** getelementptr (i32 (...)*, i32 (...)**
> bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]*
> @vt, i64 0, inrange i64 1) to i32 (...)**), i64 3)
> > -}
> > +; RUN: opt -instcombine -S -o - %s | FileCheck %s
> > +; Tests that we preserve the inrange attribute on indices
> where possible.
> > +
> > +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> > +target triple = "x86_64-unknown-linux-gnu"
> > +
> > +%struct.A = type { i32 (...)** }
> > +
> > + at vt = external global [3 x i8*]
> > +
> > +; CHECK: define i32 (...)** @f0()
> > +define i32 (...)** @f0() {
> > + ; CHECK-NEXT: ret i32 (...)** bitcast (i8** getelementptr
> inbounds ([3 x i8*], [3 x i8*]* @vt, inrange i64 0, i64 2) to
> i32 (...)**
> > + ret i32 (...)** getelementptr (i32 (...)*, i32 (...)**
> bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]*
> @vt, inrange i64 0, i64 1) to i32 (...)**), i64 1)
> > +}
> > +
> > +; CHECK: define i32 (...)** @f1()
> > +define i32 (...)** @f1() {
> > + ; CHECK-NEXT: ret i32 (...)** getelementptr (i32 (...)*,
> i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*],
> [3 x i8*]* @vt, i64 0, inrange i64 1) to i32 (...)**), i64 1)
> > + ret i32 (...)** getelementptr (i32 (...)*, i32 (...)**
> bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]*
> @vt, i64 0, inrange i64 1) to i32 (...)**), i64 1)
> > +}
> > +
> > +; CHECK: define i32 (...)** @f2()
> > +define i32 (...)** @f2() {
> > + ; CHECK-NEXT: ret i32 (...)** getelementptr (i32 (...)*,
> i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*],
> [3 x i8*]* @vt, i64 0, inrange i64 1) to i32 (...)**), i64 3)
> > + ret i32 (...)** getelementptr (i32 (...)*, i32 (...)**
> bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]*
> @vt, i64 0, inrange i64 1) to i32 (...)**), i64 3)
> > +}
> >
> > diff --git a/llvm/test/Transforms/ConstProp/insertvalue.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/insertvalue.ll
> > similarity index 98%
> > rename from llvm/test/Transforms/ConstProp/insertvalue.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/insertvalue.ll
> > index 606f7ddc679c..778a9734d19e 100644
> > --- a/llvm/test/Transforms/ConstProp/insertvalue.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/insertvalue.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > %struct = type { i32, [4 x i8] }
> >
> >
> > diff --git a/llvm/test/Transforms/ConstProp/loads.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/loads.ll
> > similarity index 100%
> > rename from llvm/test/Transforms/ConstProp/loads.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/loads.ll
> >
> > diff --git a/llvm/test/Transforms/ConstProp/logicaltest.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/logicaltest.ll
> > similarity index 93%
> > rename from llvm/test/Transforms/ConstProp/logicaltest.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/logicaltest.ll
> > index abd3275a4f74..e097d40c54e4 100644
> > --- a/llvm/test/Transforms/ConstProp/logicaltest.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/logicaltest.ll
> > @@ -1,6 +1,6 @@
> > ; Ensure constant propagation of logical instructions is
> working correctly.
> >
> > -; RUN: opt < %s -constprop -die -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -die -S | FileCheck %s
> > ; CHECK-NOT: {{and|or|xor}}
> >
> > define i32 @test1() {
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/math-1.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/math-1.ll
> > similarity index 95%
> > rename from llvm/test/Analysis/ConstantFolding/math-1.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/math-1.ll
> > index 595095017102..b57397381b64 100644
> > --- a/llvm/test/Analysis/ConstantFolding/math-1.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/math-1.ll
> > @@ -1,195 +1,195 @@
> > -; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt -early-cse -S -o - %s | FileCheck %s
> > -
> > -declare double @acos(double)
> > -define double @f_acos() {
> > -; CHECK-LABEL: @f_acos(
> > -; CHECK-NEXT: ret double 0.000000e+00
> > -;
> > - %res = tail call fast double @acos(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare float @asinf(float)
> > -define float @f_asinf() {
> > -; CHECK-LABEL: @f_asinf(
> > -; CHECK-NEXT: ret float 0x3FF921FB{{.+}}
> > -;
> > - %res = tail call fast float @asinf(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare double @atan(double)
> > -define double @f_atan() {
> > -; CHECK-LABEL: @f_atan(
> > -; CHECK-NEXT: [[RES:%.*]] = tail call fast double
> @atan(double 1.000000e+00)
> > -; CHECK-NEXT: ret double 0x3FE921FB
> > -;
> > - %res = tail call fast double @atan(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare float @cosf(float)
> > -define float @f_cosf() {
> > -; CHECK-LABEL: @f_cosf(
> > -; CHECK-NEXT: ret float 0x3FE14A2{{.+}}
> > -;
> > - %res = tail call fast float @cosf(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare float @llvm.cos.f32(float)
> > -define float @i_cosf() {
> > -; CHECK-LABEL: @i_cosf(
> > -; CHECK-NEXT: ret float 0x3FE14A2
> > -;
> > - %res = tail call fast float @llvm.cos.f32(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare double @cosh(double)
> > -define double @f_cosh() {
> > -; CHECK-LABEL: @f_cosh(
> > -; CHECK-NEXT: ret double 0x3FF8B075{{.+}}
> > -;
> > - %res = tail call fast double @cosh(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare float @expf(float)
> > -define float @f_expf() {
> > -; CHECK-LABEL: @f_expf(
> > -; CHECK-NEXT: ret float 0x4005BF0A{{.+}}
> > -;
> > - %res = tail call fast float @expf(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare float @llvm.exp.f32(float)
> > -define float @i_expf() {
> > -; CHECK-LABEL: @i_expf(
> > -; CHECK-NEXT: ret float 0x4005BF0A{{.+}}
> > -;
> > - %res = tail call fast float @llvm.exp.f32(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare double @exp2(double)
> > -define double @f_exp2() {
> > -; CHECK-LABEL: @f_exp2(
> > -; CHECK-NEXT: ret double 2.000000e+00
> > -;
> > - %res = tail call fast double @exp2(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare double @llvm.exp2.f64(double)
> > -define double @i_exp2() {
> > -; CHECK-LABEL: @i_exp2(
> > -; CHECK-NEXT: ret double 2.000000e+00
> > -;
> > - %res = tail call fast double @llvm.exp2.f64(double 1.0)
> > - ret double %res
> > -}
> > -
> > -; FIXME: exp10() is not widely supported.
> > -declare float @exp10f(float)
> > -define float @f_exp10f() {
> > -; CHECK-LABEL: @f_exp10f(
> > -; CHECK-NEXT: [[RES:%.*]] = tail call float
> @exp10f(float 1.000000e+00)
> > -; CHECK-NEXT: ret float [[RES]]
> > -;
> > - %res = tail call float @exp10f(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare double @log(double)
> > -define double @f_log() {
> > -; CHECK-LABEL: @f_log(
> > -; CHECK-NEXT: ret double 0.000000e+00
> > -;
> > - %res = tail call fast double @log(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare double @llvm.log.f64(double)
> > -define double @i_log() {
> > -; CHECK-LABEL: @i_log(
> > -; CHECK-NEXT: ret double 0.000000e+00
> > -;
> > - %res = tail call fast double @llvm.log.f64(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare float @log2f(float)
> > -define float @f_log2f() {
> > -; CHECK-LABEL: @f_log2f(
> > -; CHECK-NEXT: ret float 0.000000e+00
> > -;
> > - %res = tail call fast float @log2f(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare float @llvm.log2.f32(float)
> > -define float @i_log2f() {
> > -; CHECK-LABEL: @i_log2f(
> > -; CHECK-NEXT: ret float 0.000000e+00
> > -;
> > - %res = tail call fast float @llvm.log2.f32(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare double @log10(double)
> > -define double @f_log10() {
> > -; CHECK-LABEL: @f_log10(
> > -; CHECK-NEXT: ret double 0.000000e+00
> > -;
> > - %res = tail call fast double @log10(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare float @sinf(float)
> > -define float @f_sinf() {
> > -; CHECK-LABEL: @f_sinf(
> > -; CHECK-NEXT: ret float 0x3FEAED54{{.+}}
> > -;
> > - %res = tail call fast float @sinf(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare double @sinh(double)
> > -define double @f_sinh() {
> > -; CHECK-LABEL: @f_sinh(
> > -; CHECK-NEXT: ret double 0x3FF2CD9F{{.+}}
> > -;
> > - %res = tail call fast double @sinh(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare float @sqrtf(float)
> > -define float @f_sqrtf() {
> > -; CHECK-LABEL: @f_sqrtf(
> > -; CHECK-NEXT: ret float 1.000000e+00
> > -;
> > - %res = tail call fast float @sqrtf(float 1.0)
> > - ret float %res
> > -}
> > -
> > -declare double @tan(double)
> > -define double @f_tan() {
> > -; CHECK-LABEL: @f_tan(
> > -; CHECK-NEXT: ret double 0x3FF8EB24{{.+}}
> > -;
> > - %res = tail call fast double @tan(double 1.0)
> > - ret double %res
> > -}
> > -
> > -declare float @tanhf(float)
> > -define float @f_tanhf() {
> > -; CHECK-LABEL: @f_tanhf(
> > -; CHECK-NEXT: [[RES:%.*]] = tail call fast float
> @tanhf(float 1.000000e+00)
> > -; CHECK-NEXT: ret float 0x3FE85EFA{{.+}}
> > -;
> > - %res = tail call fast float @tanhf(float 1.0)
> > - ret float %res
> > -}
> > +; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > +; RUN: opt -early-cse -S -o - %s | FileCheck %s
> > +
> > +declare double @acos(double)
> > +define double @f_acos() {
> > +; CHECK-LABEL: @f_acos(
> > +; CHECK-NEXT: ret double 0.000000e+00
> > +;
> > + %res = tail call fast double @acos(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare float @asinf(float)
> > +define float @f_asinf() {
> > +; CHECK-LABEL: @f_asinf(
> > +; CHECK-NEXT: ret float 0x3FF921FB{{.+}}
> > +;
> > + %res = tail call fast float @asinf(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare double @atan(double)
> > +define double @f_atan() {
> > +; CHECK-LABEL: @f_atan(
> > +; CHECK-NEXT: [[RES:%.*]] = tail call fast double
> @atan(double 1.000000e+00)
> > +; CHECK-NEXT: ret double 0x3FE921FB
> > +;
> > + %res = tail call fast double @atan(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare float @cosf(float)
> > +define float @f_cosf() {
> > +; CHECK-LABEL: @f_cosf(
> > +; CHECK-NEXT: ret float 0x3FE14A2{{.+}}
> > +;
> > + %res = tail call fast float @cosf(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare float @llvm.cos.f32(float)
> > +define float @i_cosf() {
> > +; CHECK-LABEL: @i_cosf(
> > +; CHECK-NEXT: ret float 0x3FE14A2
> > +;
> > + %res = tail call fast float @llvm.cos.f32(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare double @cosh(double)
> > +define double @f_cosh() {
> > +; CHECK-LABEL: @f_cosh(
> > +; CHECK-NEXT: ret double 0x3FF8B075{{.+}}
> > +;
> > + %res = tail call fast double @cosh(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare float @expf(float)
> > +define float @f_expf() {
> > +; CHECK-LABEL: @f_expf(
> > +; CHECK-NEXT: ret float 0x4005BF0A{{.+}}
> > +;
> > + %res = tail call fast float @expf(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare float @llvm.exp.f32(float)
> > +define float @i_expf() {
> > +; CHECK-LABEL: @i_expf(
> > +; CHECK-NEXT: ret float 0x4005BF0A{{.+}}
> > +;
> > + %res = tail call fast float @llvm.exp.f32(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare double @exp2(double)
> > +define double @f_exp2() {
> > +; CHECK-LABEL: @f_exp2(
> > +; CHECK-NEXT: ret double 2.000000e+00
> > +;
> > + %res = tail call fast double @exp2(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare double @llvm.exp2.f64(double)
> > +define double @i_exp2() {
> > +; CHECK-LABEL: @i_exp2(
> > +; CHECK-NEXT: ret double 2.000000e+00
> > +;
> > + %res = tail call fast double @llvm.exp2.f64(double 1.0)
> > + ret double %res
> > +}
> > +
> > +; FIXME: exp10() is not widely supported.
> > +declare float @exp10f(float)
> > +define float @f_exp10f() {
> > +; CHECK-LABEL: @f_exp10f(
> > +; CHECK-NEXT: [[RES:%.*]] = tail call float
> @exp10f(float 1.000000e+00)
> > +; CHECK-NEXT: ret float [[RES]]
> > +;
> > + %res = tail call float @exp10f(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare double @log(double)
> > +define double @f_log() {
> > +; CHECK-LABEL: @f_log(
> > +; CHECK-NEXT: ret double 0.000000e+00
> > +;
> > + %res = tail call fast double @log(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare double @llvm.log.f64(double)
> > +define double @i_log() {
> > +; CHECK-LABEL: @i_log(
> > +; CHECK-NEXT: ret double 0.000000e+00
> > +;
> > + %res = tail call fast double @llvm.log.f64(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare float @log2f(float)
> > +define float @f_log2f() {
> > +; CHECK-LABEL: @f_log2f(
> > +; CHECK-NEXT: ret float 0.000000e+00
> > +;
> > + %res = tail call fast float @log2f(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare float @llvm.log2.f32(float)
> > +define float @i_log2f() {
> > +; CHECK-LABEL: @i_log2f(
> > +; CHECK-NEXT: ret float 0.000000e+00
> > +;
> > + %res = tail call fast float @llvm.log2.f32(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare double @log10(double)
> > +define double @f_log10() {
> > +; CHECK-LABEL: @f_log10(
> > +; CHECK-NEXT: ret double 0.000000e+00
> > +;
> > + %res = tail call fast double @log10(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare float @sinf(float)
> > +define float @f_sinf() {
> > +; CHECK-LABEL: @f_sinf(
> > +; CHECK-NEXT: ret float 0x3FEAED54{{.+}}
> > +;
> > + %res = tail call fast float @sinf(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare double @sinh(double)
> > +define double @f_sinh() {
> > +; CHECK-LABEL: @f_sinh(
> > +; CHECK-NEXT: ret double 0x3FF2CD9F{{.+}}
> > +;
> > + %res = tail call fast double @sinh(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare float @sqrtf(float)
> > +define float @f_sqrtf() {
> > +; CHECK-LABEL: @f_sqrtf(
> > +; CHECK-NEXT: ret float 1.000000e+00
> > +;
> > + %res = tail call fast float @sqrtf(float 1.0)
> > + ret float %res
> > +}
> > +
> > +declare double @tan(double)
> > +define double @f_tan() {
> > +; CHECK-LABEL: @f_tan(
> > +; CHECK-NEXT: ret double 0x3FF8EB24{{.+}}
> > +;
> > + %res = tail call fast double @tan(double 1.0)
> > + ret double %res
> > +}
> > +
> > +declare float @tanhf(float)
> > +define float @f_tanhf() {
> > +; CHECK-LABEL: @f_tanhf(
> > +; CHECK-NEXT: [[RES:%.*]] = tail call fast float
> @tanhf(float 1.000000e+00)
> > +; CHECK-NEXT: ret float 0x3FE85EFA{{.+}}
> > +;
> > + %res = tail call fast float @tanhf(float 1.0)
> > + ret float %res
> > +}
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/math-2.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/math-2.ll
> > similarity index 100%
> > rename from llvm/test/Analysis/ConstantFolding/math-2.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/math-2.ll
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/min-max.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/min-max.ll
> > similarity index 99%
> > rename from llvm/test/Analysis/ConstantFolding/min-max.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/min-max.ll
> > index c01fd23683d1..4ef2fbf13de7 100644
> > --- a/llvm/test/Analysis/ConstantFolding/min-max.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/min-max.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt -constprop -S < %s | FileCheck %s
> > +; RUN: opt -instsimplify -S < %s | FileCheck %s
> >
> > declare float @llvm.minnum.f32(float, float)
> > declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x
> float>)
> >
> > diff --git a/llvm/test/Transforms/ConstProp/overflow-ops.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/overflow-ops.ll
> > similarity index 98%
> > rename from llvm/test/Transforms/ConstProp/overflow-ops.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/overflow-ops.ll
> > index 1d090d5d0ea1..a8c10748e779 100644
> > --- a/llvm/test/Transforms/ConstProp/overflow-ops.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/overflow-ops.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> --check-prefixes=CHECK,CONSTPROP
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> --check-prefixes=CHECK,CONSTPROP
> > ; RUN: opt < %s -instsimplify -S | FileCheck %s
> --check-prefixes=CHECK,INSTSIMPLIFY
> > ; We must *NOT* have any check-lines with prefixes other
> than CHECK here.
> > ; If we do, that means the rules are
> > diff erent between the passes.
> >
> > diff --git a/llvm/test/Transforms/ConstProp/phi.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/phi.ll
> > similarity index 87%
> > rename from llvm/test/Transforms/ConstProp/phi.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/phi.ll
> > index c65d34cc933a..74dc328b8a6a 100644
> > --- a/llvm/test/Transforms/ConstProp/phi.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/phi.ll
> > @@ -1,7 +1,7 @@
> > ; This is a basic sanity check for constant propagation.
> The add instruction
> > ; should be eliminated.
> >
> > -; RUN: opt < %s -constprop -die -S | not grep phi
> > +; RUN: opt < %s -instsimplify -die -S | not grep phi
> >
> > define i32 @test(i1 %B) {
> > BB0:
> >
> > diff --git a/llvm/test/Transforms/ConstProp/remtest.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/remtest.ll
> > similarity index 91%
> > rename from llvm/test/Transforms/ConstProp/remtest.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/remtest.ll
> > index efd2d48332a2..3e6fc8dfcb13 100644
> > --- a/llvm/test/Transforms/ConstProp/remtest.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/remtest.ll
> > @@ -1,6 +1,6 @@
> > ; Ensure constant propagation of remainder instructions is
> working correctly.
> >
> > -; RUN: opt < %s -constprop -die -S | not grep rem
> > +; RUN: opt < %s -instsimplify -die -S | not grep rem
> >
> > define i32 @test1() {
> > %R = srem i32 4, 3 ; <i32> [#uses=1]
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/rint.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/rint.ll
> > similarity index 96%
> > rename from llvm/test/Analysis/ConstantFolding/rint.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/rint.ll
> > index 9ad794d6094b..1c88bab81a39 100644
> > --- a/llvm/test/Analysis/ConstantFolding/rint.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/rint.ll
> > @@ -1,109 +1,109 @@
> > -; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt -S -early-cse < %s | FileCheck %s
> > -
> > -declare float @nearbyintf(float) #0
> > -declare float @llvm.nearbyint.f32(float) #0
> > -declare double @nearbyint(double) #0
> > -declare double @llvm.nearbyint.f64(double) #0
> > -declare float @rintf(float) #0
> > -declare float @llvm.rint.f32(float) #0
> > -declare double @rint(double) #0
> > -declare double @llvm.rint.f64(double) #0
> > -
> > -define float @constant_fold_rint_f32_01() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f32_01(
> > -; CHECK-NEXT: ret float 1.000000e+00
> > -;
> > - %x = call float @nearbyintf(float 1.25) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_rint_f32_02() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f32_02(
> > -; CHECK-NEXT: ret float -1.000000e+00
> > -;
> > - %x = call float @llvm.nearbyint.f32(float -1.25) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_rint_f32_03() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f32_03(
> > -; CHECK-NEXT: ret float 2.000000e+00
> > -;
> > - %x = call float @rintf(float 1.5) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_rint_f32_04() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f32_04(
> > -; CHECK-NEXT: ret float -2.000000e+00
> > -;
> > - %x = call float @llvm.rint.f32(float -1.5) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_rint_f32_05() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f32_05(
> > -; CHECK-NEXT: ret float 3.000000e+00
> > -;
> > - %x = call float @nearbyintf(float 2.75) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_rint_f32_06() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f32_06(
> > -; CHECK-NEXT: ret float -3.000000e+00
> > -;
> > - %x = call float @llvm.nearbyint.f32(float -2.75) #0
> > - ret float %x
> > -}
> > -
> > -define double @constant_fold_rint_f64_01() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f64_01(
> > -; CHECK-NEXT: ret double 1.000000e+00
> > -;
> > - %x = call double @rint(double 1.3) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_rint_f64_02() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f64_02(
> > -; CHECK-NEXT: ret double -1.000000e+00
> > -;
> > - %x = call double @llvm.rint.f64(double -1.3) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_rint_f64_03() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f64_03(
> > -; CHECK-NEXT: ret double 2.000000e+00
> > -;
> > - %x = call double @nearbyint(double 1.5) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_rint_f64_04() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f64_04(
> > -; CHECK-NEXT: ret double -2.000000e+00
> > -;
> > - %x = call double @llvm.nearbyint.f64(double -1.5) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_rint_f64_05() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f64_05(
> > -; CHECK-NEXT: ret double 3.000000e+00
> > -;
> > - %x = call double @rint(double 2.7) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_rint_f64_06() #0 {
> > -; CHECK-LABEL: @constant_fold_rint_f64_06(
> > -; CHECK-NEXT: ret double -3.000000e+00
> > -;
> > - %x = call double @llvm.rint.f64(double -2.7) #0
> > - ret double %x
> > -}
> > -
> > -attributes #0 = { nounwind readnone }
> > +; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > +; RUN: opt -S -early-cse < %s | FileCheck %s
> > +
> > +declare float @nearbyintf(float) #0
> > +declare float @llvm.nearbyint.f32(float) #0
> > +declare double @nearbyint(double) #0
> > +declare double @llvm.nearbyint.f64(double) #0
> > +declare float @rintf(float) #0
> > +declare float @llvm.rint.f32(float) #0
> > +declare double @rint(double) #0
> > +declare double @llvm.rint.f64(double) #0
> > +
> > +define float @constant_fold_rint_f32_01() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f32_01(
> > +; CHECK-NEXT: ret float 1.000000e+00
> > +;
> > + %x = call float @nearbyintf(float 1.25) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_rint_f32_02() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f32_02(
> > +; CHECK-NEXT: ret float -1.000000e+00
> > +;
> > + %x = call float @llvm.nearbyint.f32(float -1.25) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_rint_f32_03() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f32_03(
> > +; CHECK-NEXT: ret float 2.000000e+00
> > +;
> > + %x = call float @rintf(float 1.5) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_rint_f32_04() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f32_04(
> > +; CHECK-NEXT: ret float -2.000000e+00
> > +;
> > + %x = call float @llvm.rint.f32(float -1.5) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_rint_f32_05() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f32_05(
> > +; CHECK-NEXT: ret float 3.000000e+00
> > +;
> > + %x = call float @nearbyintf(float 2.75) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_rint_f32_06() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f32_06(
> > +; CHECK-NEXT: ret float -3.000000e+00
> > +;
> > + %x = call float @llvm.nearbyint.f32(float -2.75) #0
> > + ret float %x
> > +}
> > +
> > +define double @constant_fold_rint_f64_01() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f64_01(
> > +; CHECK-NEXT: ret double 1.000000e+00
> > +;
> > + %x = call double @rint(double 1.3) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_rint_f64_02() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f64_02(
> > +; CHECK-NEXT: ret double -1.000000e+00
> > +;
> > + %x = call double @llvm.rint.f64(double -1.3) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_rint_f64_03() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f64_03(
> > +; CHECK-NEXT: ret double 2.000000e+00
> > +;
> > + %x = call double @nearbyint(double 1.5) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_rint_f64_04() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f64_04(
> > +; CHECK-NEXT: ret double -2.000000e+00
> > +;
> > + %x = call double @llvm.nearbyint.f64(double -1.5) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_rint_f64_05() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f64_05(
> > +; CHECK-NEXT: ret double 3.000000e+00
> > +;
> > + %x = call double @rint(double 2.7) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_rint_f64_06() #0 {
> > +; CHECK-LABEL: @constant_fold_rint_f64_06(
> > +; CHECK-NEXT: ret double -3.000000e+00
> > +;
> > + %x = call double @llvm.rint.f64(double -2.7) #0
> > + ret double %x
> > +}
> > +
> > +attributes #0 = { nounwind readnone }
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/round.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/round.ll
> > similarity index 96%
> > rename from llvm/test/Analysis/ConstantFolding/round.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/round.ll
> > index d5b847810d5e..a636160dd12a 100644
> > --- a/llvm/test/Analysis/ConstantFolding/round.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/round.ll
> > @@ -1,92 +1,92 @@
> > -; RUN: opt -S -early-cse < %s | FileCheck %s
> > -
> > -declare float @roundf(float) #0
> > -declare float @llvm.round.f32(float) #0
> > -declare double @round(double) #0
> > -declare double @llvm.round.f64(double) #0
> > -
> > -; CHECK-LABEL: @constant_fold_round_f32_01
> > -; CHECK-NEXT: ret float 1.000000e+00
> > -define float @constant_fold_round_f32_01() #0 {
> > - %x = call float @roundf(float 1.25) #0
> > - ret float %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f32_02
> > -; CHECK-NEXT: ret float -1.000000e+00
> > -define float @constant_fold_round_f32_02() #0 {
> > - %x = call float @llvm.round.f32(float -1.25) #0
> > - ret float %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f32_03
> > -; CHECK-NEXT: ret float 2.000000e+00
> > -define float @constant_fold_round_f32_03() #0 {
> > - %x = call float @roundf(float 1.5) #0
> > - ret float %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f32_04
> > -; CHECK-NEXT: ret float -2.000000e+00
> > -define float @constant_fold_round_f32_04() #0 {
> > - %x = call float @llvm.round.f32(float -1.5) #0
> > - ret float %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f32_05
> > -; CHECK-NEXT: ret float 3.000000e+00
> > -define float @constant_fold_round_f32_05() #0 {
> > - %x = call float @roundf(float 2.75) #0
> > - ret float %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f32_06
> > -; CHECK-NEXT: ret float -3.000000e+00
> > -define float @constant_fold_round_f32_06() #0 {
> > - %x = call float @llvm.round.f32(float -2.75) #0
> > - ret float %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f64_01
> > -; CHECK-NEXT: ret double 1.000000e+00
> > -define double @constant_fold_round_f64_01() #0 {
> > - %x = call double @round(double 1.3) #0
> > - ret double %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f64_02
> > -; CHECK-NEXT: ret double -1.000000e+00
> > -define double @constant_fold_round_f64_02() #0 {
> > - %x = call double @llvm.round.f64(double -1.3) #0
> > - ret double %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f64_03
> > -; CHECK-NEXT: ret double 2.000000e+00
> > -define double @constant_fold_round_f64_03() #0 {
> > - %x = call double @round(double 1.5) #0
> > - ret double %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f64_04
> > -; CHECK-NEXT: ret double -2.000000e+00
> > -define double @constant_fold_round_f64_04() #0 {
> > - %x = call double @llvm.round.f64(double -1.5) #0
> > - ret double %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f64_05
> > -; CHECK-NEXT: ret double 3.000000e+00
> > -define double @constant_fold_round_f64_05() #0 {
> > - %x = call double @round(double 2.7) #0
> > - ret double %x
> > -}
> > -
> > -; CHECK-LABEL: @constant_fold_round_f64_06
> > -; CHECK-NEXT: ret double -3.000000e+00
> > -define double @constant_fold_round_f64_06() #0 {
> > - %x = call double @llvm.round.f64(double -2.7) #0
> > - ret double %x
> > -}
> > -
> > -attributes #0 = { nounwind readnone }
> > +; RUN: opt -S -early-cse < %s | FileCheck %s
> > +
> > +declare float @roundf(float) #0
> > +declare float @llvm.round.f32(float) #0
> > +declare double @round(double) #0
> > +declare double @llvm.round.f64(double) #0
> > +
> > +; CHECK-LABEL: @constant_fold_round_f32_01
> > +; CHECK-NEXT: ret float 1.000000e+00
> > +define float @constant_fold_round_f32_01() #0 {
> > + %x = call float @roundf(float 1.25) #0
> > + ret float %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f32_02
> > +; CHECK-NEXT: ret float -1.000000e+00
> > +define float @constant_fold_round_f32_02() #0 {
> > + %x = call float @llvm.round.f32(float -1.25) #0
> > + ret float %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f32_03
> > +; CHECK-NEXT: ret float 2.000000e+00
> > +define float @constant_fold_round_f32_03() #0 {
> > + %x = call float @roundf(float 1.5) #0
> > + ret float %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f32_04
> > +; CHECK-NEXT: ret float -2.000000e+00
> > +define float @constant_fold_round_f32_04() #0 {
> > + %x = call float @llvm.round.f32(float -1.5) #0
> > + ret float %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f32_05
> > +; CHECK-NEXT: ret float 3.000000e+00
> > +define float @constant_fold_round_f32_05() #0 {
> > + %x = call float @roundf(float 2.75) #0
> > + ret float %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f32_06
> > +; CHECK-NEXT: ret float -3.000000e+00
> > +define float @constant_fold_round_f32_06() #0 {
> > + %x = call float @llvm.round.f32(float -2.75) #0
> > + ret float %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f64_01
> > +; CHECK-NEXT: ret double 1.000000e+00
> > +define double @constant_fold_round_f64_01() #0 {
> > + %x = call double @round(double 1.3) #0
> > + ret double %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f64_02
> > +; CHECK-NEXT: ret double -1.000000e+00
> > +define double @constant_fold_round_f64_02() #0 {
> > + %x = call double @llvm.round.f64(double -1.3) #0
> > + ret double %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f64_03
> > +; CHECK-NEXT: ret double 2.000000e+00
> > +define double @constant_fold_round_f64_03() #0 {
> > + %x = call double @round(double 1.5) #0
> > + ret double %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f64_04
> > +; CHECK-NEXT: ret double -2.000000e+00
> > +define double @constant_fold_round_f64_04() #0 {
> > + %x = call double @llvm.round.f64(double -1.5) #0
> > + ret double %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f64_05
> > +; CHECK-NEXT: ret double 3.000000e+00
> > +define double @constant_fold_round_f64_05() #0 {
> > + %x = call double @round(double 2.7) #0
> > + ret double %x
> > +}
> > +
> > +; CHECK-LABEL: @constant_fold_round_f64_06
> > +; CHECK-NEXT: ret double -3.000000e+00
> > +define double @constant_fold_round_f64_06() #0 {
> > + %x = call double @llvm.round.f64(double -2.7) #0
> > + ret double %x
> > +}
> > +
> > +attributes #0 = { nounwind readnone }
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/saturating-add-sub.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/saturating-add-sub.ll
> > similarity index 99%
> > rename from
> llvm/test/Analysis/ConstantFolding/saturating-add-sub.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/saturating-add-sub.ll
> > index 7c6fdbf1e1fd..9d250627c1b5 100644
> > --- a/llvm/test/Analysis/ConstantFolding/saturating-add-sub.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/saturating-add-sub.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > declare i8 @llvm.uadd.sat.i8(i8, i8)
> > declare i8 @llvm.sadd.sat.i8(i8, i8)
> >
> > diff --git a/llvm/test/Transforms/ConstProp/shift.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/shift.ll
> > similarity index 96%
> > rename from llvm/test/Transforms/ConstProp/shift.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/shift.ll
> > index de23fe98ad87..3e64513533ff 100644
> > --- a/llvm/test/Transforms/ConstProp/shift.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/shift.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > ; CHECK-LABEL: shift_undef_64
> > define void @shift_undef_64(i64* %p) {
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/smul-fix-sat.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/smul-fix-sat.ll
> > similarity index 98%
> > rename from llvm/test/Analysis/ConstantFolding/smul-fix-sat.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/smul-fix-sat.ll
> > index 3caae7ce56e2..82d81a5dd0c5 100644
> > --- a/llvm/test/Analysis/ConstantFolding/smul-fix-sat.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/smul-fix-sat.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> >
> ;-----------------------------------------------------------------------------
> > ; Simple test using scalar layout.
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/smul-fix.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/smul-fix.ll
> > similarity index 98%
> > rename from llvm/test/Analysis/ConstantFolding/smul-fix.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/smul-fix.ll
> > index 9fcf4a9d65c2..260c49419c90 100644
> > --- a/llvm/test/Analysis/ConstantFolding/smul-fix.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/smul-fix.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> >
> ;-----------------------------------------------------------------------------
> > ; Simple test using scalar layout.
> >
> > diff --git a/llvm/test/Transforms/ConstProp/sse.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/sse.ll
> > similarity index 99%
> > rename from llvm/test/Transforms/ConstProp/sse.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/sse.ll
> > index ad0a62e42062..5d5c3e3309ad 100644
> > --- a/llvm/test/Transforms/ConstProp/sse.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/sse.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> > ; REQUIRES: x86-registered-target
> >
> > define i1 @test_sse_cvts_exact() nounwind readnone {
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/timeout.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/timeout.ll
> > similarity index 97%
> > rename from llvm/test/Analysis/ConstantFolding/timeout.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/timeout.ll
> > index 3d28c2adbe48..0ebd365a0335 100644
> > --- a/llvm/test/Analysis/ConstantFolding/timeout.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/timeout.ll
> > @@ -1,73 +1,73 @@
> > -; NOTE: This is a timeout test for some O(something silly)
> constant folding behaviour. It may not be the best test.
> Providing it finishes, it passes.
> > -; RUN: opt < %s -O3 -S | FileCheck %s
> > -target datalayout =
> "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
> > -target triple = "armv8-none-eabi"
> > -
> > -%struct.ST = type { %struct.ST* }
> > -
> > - at global = internal global [121 x i8] zeroinitializer, align 1
> > -
> > -define void @func() #0 {
> > -;CHECK-LABEL: func
> > -entry:
> > - %s = alloca %struct.ST*, align 4
> > - %j = alloca i32, align 4
> > - store %struct.ST* bitcast ([121 x i8]* @global to
> %struct.ST*), %struct.ST** %s, align 4
> > - store i32 0, i32* %j, align 4
> > - br label %for.cond
> > -
> > -for.cond: ; preds =
> %for.inc, %entry
> > - %0 = load i32, i32* %j, align 4
> > - %cmp = icmp slt i32 %0, 30
> > - br i1 %cmp, label %for.body, label %for.end
> > -
> > -for.body: ; preds =
> %for.cond
> > - %1 = load %struct.ST*, %struct.ST** %s, align 4
> > - %2 = bitcast %struct.ST* %1 to i8*
> > - %add.ptr = getelementptr inbounds i8, i8* %2, i32 4
> > - %3 = ptrtoint i8* %add.ptr to i32
> > - %4 = load %struct.ST*, %struct.ST** %s, align 4
> > - %5 = bitcast %struct.ST* %4 to i8*
> > - %add.ptr1 = getelementptr inbounds i8, i8* %5, i32 4
> > - %6 = ptrtoint i8* %add.ptr1 to i32
> > - %rem = urem i32 %6, 2
> > - %cmp2 = icmp eq i32 %rem, 0
> > - br i1 %cmp2, label %cond.true, label %cond.false
> > -
> > -cond.true: ; preds =
> %for.body
> > - br label %cond.end
> > -
> > -cond.false: ; preds =
> %for.body
> > - %7 = load %struct.ST*, %struct.ST** %s, align 4
> > - %8 = bitcast %struct.ST* %7 to i8*
> > - %add.ptr3 = getelementptr inbounds i8, i8* %8, i32 4
> > - %9 = ptrtoint i8* %add.ptr3 to i32
> > - %rem4 = urem i32 %9, 2
> > - br label %cond.end
> > -
> > -cond.end: ; preds =
> %cond.false, %cond.true
> > - %cond = phi i32 [ 0, %cond.true ], [ %rem4, %cond.false ]
> > - %add = add i32 %3, %cond
> > - %10 = inttoptr i32 %add to %struct.ST*
> > - %11 = load %struct.ST*, %struct.ST** %s, align 4
> > - %next = getelementptr inbounds %struct.ST, %struct.ST*
> %11, i32 0, i32 0
> > - store %struct.ST* %10, %struct.ST** %next, align 4
> > - %12 = load %struct.ST*, %struct.ST** %s, align 4
> > - %next5 = getelementptr inbounds %struct.ST, %struct.ST*
> %12, i32 0, i32 0
> > - %13 = load %struct.ST*, %struct.ST** %next5, align 4
> > - store %struct.ST* %13, %struct.ST** %s, align 4
> > - br label %for.inc
> > -
> > -for.inc: ; preds =
> %cond.end
> > - %14 = load i32, i32* %j, align 4
> > - %inc = add nsw i32 %14, 1
> > - store i32 %inc, i32* %j, align 4
> > - br label %for.cond
> > -
> > -for.end: ; preds =
> %for.cond
> > - %15 = load %struct.ST*, %struct.ST** %s, align 4
> > - %next6 = getelementptr inbounds %struct.ST, %struct.ST*
> %15, i32 0, i32 0
> > - store %struct.ST* null, %struct.ST** %next6, align 4
> > - ret void
> > -}
> > -
> > +; NOTE: This is a timeout test for some O(something silly)
> constant folding behaviour. It may not be the best test.
> Providing it finishes, it passes.
> > +; RUN: opt < %s -O3 -S | FileCheck %s
> > +target datalayout =
> "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
> > +target triple = "armv8-none-eabi"
> > +
> > +%struct.ST = type { %struct.ST* }
> > +
> > + at global = internal global [121 x i8] zeroinitializer, align 1
> > +
> > +define void @func() #0 {
> > +;CHECK-LABEL: func
> > +entry:
> > + %s = alloca %struct.ST*, align 4
> > + %j = alloca i32, align 4
> > + store %struct.ST* bitcast ([121 x i8]* @global to
> %struct.ST*), %struct.ST** %s, align 4
> > + store i32 0, i32* %j, align 4
> > + br label %for.cond
> > +
> > +for.cond: ; preds =
> %for.inc, %entry
> > + %0 = load i32, i32* %j, align 4
> > + %cmp = icmp slt i32 %0, 30
> > + br i1 %cmp, label %for.body, label %for.end
> > +
> > +for.body: ; preds =
> %for.cond
> > + %1 = load %struct.ST*, %struct.ST** %s, align 4
> > + %2 = bitcast %struct.ST* %1 to i8*
> > + %add.ptr = getelementptr inbounds i8, i8* %2, i32 4
> > + %3 = ptrtoint i8* %add.ptr to i32
> > + %4 = load %struct.ST*, %struct.ST** %s, align 4
> > + %5 = bitcast %struct.ST* %4 to i8*
> > + %add.ptr1 = getelementptr inbounds i8, i8* %5, i32 4
> > + %6 = ptrtoint i8* %add.ptr1 to i32
> > + %rem = urem i32 %6, 2
> > + %cmp2 = icmp eq i32 %rem, 0
> > + br i1 %cmp2, label %cond.true, label %cond.false
> > +
> > +cond.true: ; preds =
> %for.body
> > + br label %cond.end
> > +
> > +cond.false: ; preds =
> %for.body
> > + %7 = load %struct.ST*, %struct.ST** %s, align 4
> > + %8 = bitcast %struct.ST* %7 to i8*
> > + %add.ptr3 = getelementptr inbounds i8, i8* %8, i32 4
> > + %9 = ptrtoint i8* %add.ptr3 to i32
> > + %rem4 = urem i32 %9, 2
> > + br label %cond.end
> > +
> > +cond.end: ; preds =
> %cond.false, %cond.true
> > + %cond = phi i32 [ 0, %cond.true ], [ %rem4, %cond.false ]
> > + %add = add i32 %3, %cond
> > + %10 = inttoptr i32 %add to %struct.ST*
> > + %11 = load %struct.ST*, %struct.ST** %s, align 4
> > + %next = getelementptr inbounds %struct.ST, %struct.ST*
> %11, i32 0, i32 0
> > + store %struct.ST* %10, %struct.ST** %next, align 4
> > + %12 = load %struct.ST*, %struct.ST** %s, align 4
> > + %next5 = getelementptr inbounds %struct.ST, %struct.ST*
> %12, i32 0, i32 0
> > + %13 = load %struct.ST*, %struct.ST** %next5, align 4
> > + store %struct.ST* %13, %struct.ST** %s, align 4
> > + br label %for.inc
> > +
> > +for.inc: ; preds =
> %cond.end
> > + %14 = load i32, i32* %j, align 4
> > + %inc = add nsw i32 %14, 1
> > + store i32 %inc, i32* %j, align 4
> > + br label %for.cond
> > +
> > +for.end: ; preds =
> %for.cond
> > + %15 = load %struct.ST*, %struct.ST** %s, align 4
> > + %next6 = getelementptr inbounds %struct.ST, %struct.ST*
> %15, i32 0, i32 0
> > + store %struct.ST* null, %struct.ST** %next6, align 4
> > + ret void
> > +}
> > +
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/trunc.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/trunc.ll
> > similarity index 96%
> > rename from llvm/test/Analysis/ConstantFolding/trunc.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/trunc.ll
> > index df1380917145..68d20002fe4a 100644
> > --- a/llvm/test/Analysis/ConstantFolding/trunc.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/trunc.ll
> > @@ -1,105 +1,105 @@
> > -; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt -S -early-cse < %s | FileCheck %s
> > -
> > -declare float @truncf(float) #0
> > -declare float @llvm.trunc.f32(float) #0
> > -declare double @trunc(double) #0
> > -declare double @llvm.trunc.f64(double) #0
> > -
> > -define float @constant_fold_trunc_f32_01() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f32_01(
> > -; CHECK-NEXT: ret float 1.000000e+00
> > -;
> > - %x = call float @truncf(float 1.25) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_trunc_f32_02() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f32_02(
> > -; CHECK-NEXT: ret float -1.000000e+00
> > -;
> > - %x = call float @llvm.trunc.f32(float -1.25) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_trunc_f32_03() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f32_03(
> > -; CHECK-NEXT: ret float 1.000000e+00
> > -;
> > - %x = call float @truncf(float 1.5) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_trunc_f32_04() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f32_04(
> > -; CHECK-NEXT: ret float -1.000000e+00
> > -;
> > - %x = call float @llvm.trunc.f32(float -1.5) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_trunc_f32_05() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f32_05(
> > -; CHECK-NEXT: ret float 2.000000e+00
> > -;
> > - %x = call float @truncf(float 2.75) #0
> > - ret float %x
> > -}
> > -
> > -define float @constant_fold_trunc_f32_06() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f32_06(
> > -; CHECK-NEXT: ret float -2.000000e+00
> > -;
> > - %x = call float @llvm.trunc.f32(float -2.75) #0
> > - ret float %x
> > -}
> > -
> > -define double @constant_fold_trunc_f64_01() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f64_01(
> > -; CHECK-NEXT: ret double 1.000000e+00
> > -;
> > - %x = call double @trunc(double 1.3) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_trunc_f64_02() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f64_02(
> > -; CHECK-NEXT: ret double -1.000000e+00
> > -;
> > - %x = call double @llvm.trunc.f64(double -1.3) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_trunc_f64_03() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f64_03(
> > -; CHECK-NEXT: ret double 1.000000e+00
> > -;
> > - %x = call double @trunc(double 1.5) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_trunc_f64_04() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f64_04(
> > -; CHECK-NEXT: ret double -1.000000e+00
> > -;
> > - %x = call double @llvm.trunc.f64(double -1.5) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_trunc_f64_05() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f64_05(
> > -; CHECK-NEXT: ret double 2.000000e+00
> > -;
> > - %x = call double @trunc(double 2.7) #0
> > - ret double %x
> > -}
> > -
> > -define double @constant_fold_trunc_f64_06() #0 {
> > -; CHECK-LABEL: @constant_fold_trunc_f64_06(
> > -; CHECK-NEXT: ret double -2.000000e+00
> > -;
> > - %x = call double @llvm.trunc.f64(double -2.7) #0
> > - ret double %x
> > -}
> > -
> > -attributes #0 = { nounwind readnone }
> > +; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > +; RUN: opt -S -early-cse < %s | FileCheck %s
> > +
> > +declare float @truncf(float) #0
> > +declare float @llvm.trunc.f32(float) #0
> > +declare double @trunc(double) #0
> > +declare double @llvm.trunc.f64(double) #0
> > +
> > +define float @constant_fold_trunc_f32_01() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f32_01(
> > +; CHECK-NEXT: ret float 1.000000e+00
> > +;
> > + %x = call float @truncf(float 1.25) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_trunc_f32_02() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f32_02(
> > +; CHECK-NEXT: ret float -1.000000e+00
> > +;
> > + %x = call float @llvm.trunc.f32(float -1.25) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_trunc_f32_03() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f32_03(
> > +; CHECK-NEXT: ret float 1.000000e+00
> > +;
> > + %x = call float @truncf(float 1.5) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_trunc_f32_04() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f32_04(
> > +; CHECK-NEXT: ret float -1.000000e+00
> > +;
> > + %x = call float @llvm.trunc.f32(float -1.5) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_trunc_f32_05() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f32_05(
> > +; CHECK-NEXT: ret float 2.000000e+00
> > +;
> > + %x = call float @truncf(float 2.75) #0
> > + ret float %x
> > +}
> > +
> > +define float @constant_fold_trunc_f32_06() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f32_06(
> > +; CHECK-NEXT: ret float -2.000000e+00
> > +;
> > + %x = call float @llvm.trunc.f32(float -2.75) #0
> > + ret float %x
> > +}
> > +
> > +define double @constant_fold_trunc_f64_01() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f64_01(
> > +; CHECK-NEXT: ret double 1.000000e+00
> > +;
> > + %x = call double @trunc(double 1.3) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_trunc_f64_02() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f64_02(
> > +; CHECK-NEXT: ret double -1.000000e+00
> > +;
> > + %x = call double @llvm.trunc.f64(double -1.3) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_trunc_f64_03() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f64_03(
> > +; CHECK-NEXT: ret double 1.000000e+00
> > +;
> > + %x = call double @trunc(double 1.5) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_trunc_f64_04() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f64_04(
> > +; CHECK-NEXT: ret double -1.000000e+00
> > +;
> > + %x = call double @llvm.trunc.f64(double -1.5) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_trunc_f64_05() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f64_05(
> > +; CHECK-NEXT: ret double 2.000000e+00
> > +;
> > + %x = call double @trunc(double 2.7) #0
> > + ret double %x
> > +}
> > +
> > +define double @constant_fold_trunc_f64_06() #0 {
> > +; CHECK-LABEL: @constant_fold_trunc_f64_06(
> > +; CHECK-NEXT: ret double -2.000000e+00
> > +;
> > + %x = call double @llvm.trunc.f64(double -2.7) #0
> > + ret double %x
> > +}
> > +
> > +attributes #0 = { nounwind readnone }
> >
> > diff --git a/llvm/test/Transforms/ConstProp/trunc_vec.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/trunc_vec.ll
> > similarity index 86%
> > rename from llvm/test/Transforms/ConstProp/trunc_vec.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/trunc_vec.ll
> > index 99db329cdd2b..3f4882e18171 100644
> > --- a/llvm/test/Transforms/ConstProp/trunc_vec.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/trunc_vec.ll
> > @@ -1,4 +1,4 @@
> > -; RUN: opt -constprop < %s
> > +; RUN: opt -instsimplify < %s
> >
> > ; Make sure we don't crash on this one
> >
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/vecreduce.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/vecreduce.ll
> > similarity index 99%
> > rename from llvm/test/Analysis/ConstantFolding/vecreduce.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/vecreduce.ll
> > index 4d6ba1b45db1..5f1861e24b62 100644
> > --- a/llvm/test/Analysis/ConstantFolding/vecreduce.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/vecreduce.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S | FileCheck %s
> >
> > declare i32 @llvm.experimental.vector.reduce.add.v1i32(<1
> x i32> %a)
> > declare i32 @llvm.experimental.vector.reduce.add.v8i32(<8
> x i32> %a)
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/vector-undef-elts.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/vector-undef-elts.ll
> > similarity index 97%
> > rename from
> llvm/test/Analysis/ConstantFolding/vector-undef-elts.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/vector-undef-elts.ll
> > index ab1e8c1e436a..5d0f484bc3fd 100644
> > --- a/llvm/test/Analysis/ConstantFolding/vector-undef-elts.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/vector-undef-elts.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S -o - | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S -o - | FileCheck %s
> >
> > ; When both operands are undef in a lane, that lane should
> produce an undef result.
> >
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/vectorgep-crash.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/vectorgep-crash.ll
> > similarity index 100%
> > rename from
> llvm/test/Analysis/ConstantFolding/vectorgep-crash.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/vectorgep-crash.ll
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/vscale-getelementptr.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/vscale-getelementptr.ll
> > similarity index 97%
> > rename from
> llvm/test/Analysis/ConstantFolding/vscale-getelementptr.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/vscale-getelementptr.ll
> > index 8e90961928c9..6ac6564a08a9 100644
> > --- a/llvm/test/Analysis/ConstantFolding/vscale-getelementptr.ll
> > +++
> b/llvm/test/Transforms/InstSimplify/ConstProp/vscale-getelementptr.ll
> > @@ -1,32 +1,32 @@
> > -; RUN: opt -early-cse -S < %s | FileCheck %s
> > -
> > -target datalayout =
> "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
> > -target triple = "aarch64"
> > -
> > -; CHECK-LABEL: define <4 x i32*>
> @fixed_length_version_first() {
> > -; CHECK-NEXT: ret <4 x i32*> undef
> > -define <4 x i32*> @fixed_length_version_first() {
> > - %ptr = getelementptr i32, <4 x i32*> undef, <4 x i64> undef
> > - ret <4 x i32*> %ptr
> > -}
> > -
> > -; CHECK-LABEL: define <4 x <4 x i32>*>
> @fixed_length_version_second() {
> > -; CHECK-NEXT: ret <4 x <4 x i32>*> undef
> > -define <4 x <4 x i32>*> @fixed_length_version_second() {
> > - %ptr = getelementptr <4 x i32>, <4 x i32>* undef, <4 x
> i64> undef
> > - ret <4 x <4 x i32>*> %ptr
> > -}
> > -
> > -; CHECK-LABEL: define <vscale x 4 x i32*>
> @vscale_version_first() {
> > -; CHECK-NEXT: ret <vscale x 4 x i32*> undef
> > -define <vscale x 4 x i32*> @vscale_version_first() {
> > - %ptr = getelementptr i32, <vscale x 4 x i32*> undef,
> <vscale x 4 x i64> undef
> > - ret <vscale x 4 x i32*> %ptr
> > -}
> > -
> > -; CHECK-LABEL: define <vscale x 4 x <vscale x 4 x i32>*>
> @vscale_version_second() {
> > -; CHECK-NEXT: ret <vscale x 4 x <vscale x 4 x i32>*> undef
> > -define <vscale x 4 x <vscale x 4 x i32>*>
> @vscale_version_second() {
> > - %ptr = getelementptr <vscale x 4 x i32>, <vscale x 4 x
> i32>* undef, <vscale x 4 x i64> undef
> > - ret <vscale x 4 x <vscale x 4 x i32>*> %ptr
> > -}
> > +; RUN: opt -early-cse -S < %s | FileCheck %s
> > +
> > +target datalayout =
> "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
> > +target triple = "aarch64"
> > +
> > +; CHECK-LABEL: define <4 x i32*>
> @fixed_length_version_first() {
> > +; CHECK-NEXT: ret <4 x i32*> undef
> > +define <4 x i32*> @fixed_length_version_first() {
> > + %ptr = getelementptr i32, <4 x i32*> undef, <4 x i64> undef
> > + ret <4 x i32*> %ptr
> > +}
> > +
> > +; CHECK-LABEL: define <4 x <4 x i32>*>
> @fixed_length_version_second() {
> > +; CHECK-NEXT: ret <4 x <4 x i32>*> undef
> > +define <4 x <4 x i32>*> @fixed_length_version_second() {
> > + %ptr = getelementptr <4 x i32>, <4 x i32>* undef, <4 x
> i64> undef
> > + ret <4 x <4 x i32>*> %ptr
> > +}
> > +
> > +; CHECK-LABEL: define <vscale x 4 x i32*>
> @vscale_version_first() {
> > +; CHECK-NEXT: ret <vscale x 4 x i32*> undef
> > +define <vscale x 4 x i32*> @vscale_version_first() {
> > + %ptr = getelementptr i32, <vscale x 4 x i32*> undef,
> <vscale x 4 x i64> undef
> > + ret <vscale x 4 x i32*> %ptr
> > +}
> > +
> > +; CHECK-LABEL: define <vscale x 4 x <vscale x 4 x i32>*>
> @vscale_version_second() {
> > +; CHECK-NEXT: ret <vscale x 4 x <vscale x 4 x i32>*> undef
> > +define <vscale x 4 x <vscale x 4 x i32>*>
> @vscale_version_second() {
> > + %ptr = getelementptr <vscale x 4 x i32>, <vscale x 4 x
> i32>* undef, <vscale x 4 x i64> undef
> > + ret <vscale x 4 x <vscale x 4 x i32>*> %ptr
> > +}
> >
> > diff --git
> a/llvm/test/Analysis/ConstantFolding/vscale-shufflevector.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/vscale-shufflevector.ll
> > similarity index 100%
> > rename from
> llvm/test/Analysis/ConstantFolding/vscale-shufflevector.ll
> > rename to
> llvm/test/Transforms/InstSimplify/ConstProp/vscale-shufflevector.ll
> >
> > diff --git a/llvm/test/Analysis/ConstantFolding/vscale.ll
> b/llvm/test/Transforms/InstSimplify/ConstProp/vscale.ll
> > similarity index 95%
> > rename from llvm/test/Analysis/ConstantFolding/vscale.ll
> > rename to llvm/test/Transforms/InstSimplify/ConstProp/vscale.ll
> > index f00e74bd14ac..d590c565316e 100644
> > --- a/llvm/test/Analysis/ConstantFolding/vscale.ll
> > +++ b/llvm/test/Transforms/InstSimplify/ConstProp/vscale.ll
> > @@ -1,5 +1,5 @@
> > ; NOTE: Assertions have been autogenerated by
> utils/update_test_checks.py
> > -; RUN: opt < %s -constprop -S -verify | FileCheck %s
> > +; RUN: opt < %s -instsimplify -S -verify | FileCheck %s
> >
> >
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > ;; Unary Operations
> > @@ -225,14 +225,14 @@ define <vscale x 4 x i32> @select() {
> > ret <vscale x 4 x i32> %r
> > }
> >
> > -declare <vscale x 16 x i8> @llvm.sadd.sat.nxv16i8(<vscale x
> 16 x i8>, <vscale x 16 x i8>)
> > +declare <vscale x 16 x i8> @llvm.something(<vscale x 16 x
> i8>, <vscale x 16 x i8>)
> >
> > define <vscale x 16 x i8> @call() {
> > ; CHECK-LABEL: @call(
> > -; CHECK-NEXT: [[R:%.*]] = call <vscale x 16 x i8>
> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16
> x i8> undef)
> > +; CHECK-NEXT: [[R:%.*]] = call <vscale x 16 x i8>
> @llvm.something(<vscale x 16 x i8> undef, <vscale x 16 x i8>
> undef)
> > ; CHECK-NEXT: ret <vscale x 16 x i8> [[R]]
> > ;
> > - %r = call <vscale x 16 x i8>
> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16
> x i8> undef)
> > + %r = call <vscale x 16 x i8> @llvm.something(<vscale x
> 16 x i8> undef, <vscale x 16 x i8> undef)
> > ret <vscale x 16 x i8> %r
> > }
> >
> >
> > diff --git
> a/llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll
> b/llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll
> > index 2606e08da9a2..d31fd52ac362 100644
> > ---
> a/llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll
> > +++
> b/llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll
> > @@ -1,6 +1,6 @@
> > ; Make sure this doesn't turn into an infinite loop
> >
> > -; RUN: opt < %s -simplifycfg -constprop -simplifycfg |
> llvm-dis | FileCheck %s
> > +; RUN: opt < %s -simplifycfg -instsimplify -simplifycfg |
> llvm-dis | FileCheck %s
> >
> > %struct.anon = type { i32, i32, i32, i32, [1024 x i8] }
> > @_zero_ = external global %struct.anon* ;
> <%struct.anon**> [#uses=2]
> >
> > diff --git
> a/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
> b/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
> > index 52b3b76e795f..29130ec1e56b 100644
> > --- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
> > +++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
> > @@ -285,7 +285,6 @@ class MCJITCAPITest : public
> testing::Test, public MCJITTestAPICommon {
> >
> > void buildAndRunPasses() {
> > LLVMPassManagerRef pass = LLVMCreatePassManager();
> > - LLVMAddConstantPropagationPass(pass);
> > LLVMAddInstructionCombiningPass(pass);
> > LLVMRunPassManager(pass, Module);
> > LLVMDisposePassManager(pass);
> >
> > diff --git
> a/llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn
> b/llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn
> > index 57c09a7bb4d0..60fcbe031871 100644
> > ---
> a/llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn
> > +++
> b/llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn
> > @@ -15,7 +15,6 @@ static_library("Scalar") {
> > "BDCE.cpp",
> > "CallSiteSplitting.cpp",
> > "ConstantHoisting.cpp",
> > - "ConstantProp.cpp",
> > "CorrelatedValuePropagation.cpp",
> > "DCE.cpp",
> > "DeadStoreElimination.cpp",
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200827/aca64b6e/attachment-0001.html>
More information about the llvm-commits
mailing list