If a function always returns a constant, replace all calls sites with that
authorChris Lattner <sabre@nondot.org>
Sun, 14 Nov 2004 06:10:11 +0000 (06:10 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 14 Nov 2004 06:10:11 +0000 (06:10 +0000)
commita990d94330141404158a2ae6ba25661be4468b25
treed3805a776e09aa16cf803c4a2cb9e20f49802ea5
parent0240a377d87c7e0f8588b764dc83b3b2c7bbd4db
If a function always returns a constant, replace all calls sites with that
constant value.  This makes the return value dead and allows for
simplification in the caller.

This implements IPConstantProp/return-constant.ll

This triggers several dozen times throughout SPEC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17730 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/IPConstantPropagation.cpp