Add generic folding function and use in CCP
authorSteven Perron <stevenperron@google.com>
Tue, 9 Jan 2018 17:45:46 +0000 (12:45 -0500)
committerSteven Perron <stevenperron@google.com>
Wed, 10 Jan 2018 18:17:25 +0000 (13:17 -0500)
commit1ebd860daabf3328715d010af39f4950ec26d9c6
tree0a43026dd98cfeaac04039c3bb6876c480981b9a
parent3a054e1ddcc43cde3fdcb906ae087b2aa39d1deb
Add generic folding function and use in CCP

The current folding routines have a very cumbersome interface, make them
harder to use, and not a obvious how to extend.

This change is to create a new interface for the folding routines, and
show how it can be used by calling it from CCP.

This does not make a significant change to the behaviour of CCP.  In
general it should produce the same code as before; however it is
possible that an instruction that takes 32-bit integers as inputs and
the result is not a 32-bit integer or bool will not be folded as before.
source/opt/ccp_pass.cpp
source/opt/fold.cpp
source/opt/fold.h
source/opt/instruction.cpp
source/opt/instruction.h