Teach cheapEqExpr about casts
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>
Wed, 6 Feb 2008 03:50:07 +0000 (03:50 +0000)
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Wed, 6 Feb 2008 03:50:07 +0000 (03:50 +0000)
commita4835b8b82170a11fde4a5d05b3f4ecea7376d97
tree90952de8f8c6dccae2ada5b090f9abd87f13ba02
parent5952ef0dfd1a9eec38bd2756b37d040feb2b09d8
Teach cheapEqExpr about casts

Previously, cheapEqExpr would always return False if it encountered a cast.
This was bad for two reasons. Firstly, CSE (which uses cheapEqExpr to compare
expressions) never eliminated expressions which contained casts and secondly,
it was inconsistent with exprIsBig. This patch fixes this.
compiler/coreSyn/CoreUtils.lhs
compiler/types/Coercion.lhs