summaryrefslogtreecommitdiff
path: root/src/ir/load-utils.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-04-11 12:02:29 -0700
committerGitHub <noreply@github.com>2018-04-11 12:02:29 -0700
commit92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb (patch)
tree671827c29364ef509ce2a6ba050d9b119c54c9cc /src/ir/load-utils.h
parent9b5ce471992033eeec9a8779bce55f2429496431 (diff)
downloadbinaryen-92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb.tar.gz
binaryen-92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb.tar.bz2
binaryen-92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb.zip
Some simple integer math opts (#1504)
Stuff like x + 5 != 2 => x != -3. Also some cleanups of utility functions I noticed while writing this, isTypeFloat => isFloatType. Inspired by https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/gen/generic.rules
Diffstat (limited to 'src/ir/load-utils.h')
-rw-r--r--src/ir/load-utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir/load-utils.h b/src/ir/load-utils.h
index 41b3c69ef..8df4bcde8 100644
--- a/src/ir/load-utils.h
+++ b/src/ir/load-utils.h
@@ -29,7 +29,7 @@ namespace LoadUtils {
inline bool isSignRelevant(Load* load) {
auto type = load->type;
if (load->type == unreachable) return false;
- return !isTypeFloat(type) && load->bytes < getTypeSize(type);
+ return !isFloatType(type) && load->bytes < getTypeSize(type);
}
// check if a load can be signed (which some opts want to do)