If a global is just loaded and restored, realize that it is not changing
authorChris Lattner <sabre@nondot.org>
Sun, 14 Nov 2004 20:50:30 +0000 (20:50 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 14 Nov 2004 20:50:30 +0000 (20:50 +0000)
commitbd38edfe236944ebecbbf84ef9ea75d5412737b5
treefebd533c7460d76ee14bfb76fadcf49953aabc6a
parent826c47ea5bdb6c252e6d4db83b0bc0047b3acb2c
If a global is just loaded and restored, realize that it is not changing
value.  This allows us to turn more globals into constants and eliminate them.
This patch implements GlobalOpt/load-store-global.llx.

Note that this patch speeds up 255.vortex from:

Output/255.vortex.out-cbe.time:program 7.640000
Output/255.vortex.out-llc.time:program 9.810000

to:

Output/255.vortex.out-cbe.time:program 7.250000
Output/255.vortex.out-llc.time:program 9.490000

Which isn't bad at all!

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