From 5b9226c25fc439859259b94caca292aa9bc9a026 Mon Sep 17 00:00:00 2001 From: Michael Ringgaard Date: Tue, 9 Jul 2019 15:56:15 +0200 Subject: [PATCH] Fix bug in Express::AlwaysZero() (#398) --- doc/guide/myelin.md | 6 +++--- sling/myelin/express.cc | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/guide/myelin.md b/doc/guide/myelin.md index a75c8707..d90b84af 100644 --- a/doc/guide/myelin.md +++ b/doc/guide/myelin.md @@ -134,9 +134,9 @@ cell f { // size 2336 Finally, the Myelin JIT compiler converts the optimized operations into [assembler code](flowasm.txt) using the selected kernel generators. The code -generated for each function depends the negotiated layout and alignment of the -input and output tensors as well as the features support by the CPU (SSE, AVX, -AVX2, FMA3, AVX512, etc.). +generated for each function depends on the negotiated layout and alignment of +the input and output tensors as well as the features support by the CPU (SSE, +AVX, AVX2, FMA3, AVX512, etc.). ### Computing using network cell instances diff --git a/sling/myelin/express.cc b/sling/myelin/express.cc index 3ed3df5f..127aef88 100644 --- a/sling/myelin/express.cc +++ b/sling/myelin/express.cc @@ -870,6 +870,7 @@ bool Express::AlwaysZero(Var *x) const { case MOV: return AlwaysZero(op->args[0]); case ADD: + return AlwaysZero(op->args[0]) && AlwaysZero(op->args[1]); case SUB: return (AlwaysZero(op->args[0]) && AlwaysZero(op->args[1])) || (AlwaysOne(op->args[0]) && AlwaysOne(op->args[1]));