GBE: fix a corner case when allocate registers for local buffer.
GBE: fix a corner case when allocate registers for local buffer.

We use a simple way to find a instruction which refer to the local
data. Then we can identify the parent function. We found there is
a corner case that the instruction may be modified at the optimization
pass, for example the GVN pass. When all of the instruction's operand
are modified to constant, then the whole instruction seens to be a
constant either.

If that is the case, we fail to get a valid instruction and may trigger
an assert. This patch change to check another use of the local data to
avoid this assert.

Signed-off-by: Zhigang Gong <e04a7b9b70b1e4c6318cf117dcd1a9056e14b97a@intel.com>
Reviewed-by: "Song, Ruiling" <286a174c1339c6eff91abc41c3a1012c95030c95@intel.com>

wdv4758h/beignet,ignatenkobrain/beignet,zhenyw/beignet,zhenyw/beignet,ignatenkobrain/beignet,wdv4758h/beignet,ignatenkobrain/beignet,wdv4758h/beignet,freedesktop-unofficial-mirror/beignet,wdv4758h/beignet,freedesktop-unofficial-mirror/beignet,wdv4758h/beignet,zhenyw/beignet,zhenyw/beignet,ignatenkobrain/beignet,freedesktop-unofficial-mirror/beignet,freedesktop-unofficial-mirror/beignet,zhenyw/beignet,ignatenkobrain/beignet