Analysis: fix bugs in checkers 00/17300/3
Calixte DENIZET [Thu, 8 Oct 2015 17:34:54 +0000 (19:34 +0200)]
Change-Id: I7cbc144b38f892f96d0d2de7638f8650293e6fc5

scilab/modules/ast/includes/analysis/TIType.hxx
scilab/modules/ast/includes/analysis/data/TITypeSignatureTuple.hxx
scilab/modules/ast/includes/analysis/tools.hxx
scilab/modules/ast/src/cpp/analysis/AnalysisVisitor.cpp
scilab/modules/ast/src/cpp/analysis/check_____dotpower____.cpp
scilab/modules/ast/src/cpp/analysis/check_____oror____.cpp
scilab/modules/ast/src/cpp/analysis/check_____power____.cpp

index 88281b8..27cc94b 100644 (file)
@@ -40,7 +40,7 @@ struct TIType
     TIType(GVN & gvn, const Type _type) : type(_type), rows(gvn, _type == EMPTY ? 0 : 1), cols(gvn, _type == EMPTY ? 0 : 1), scalar(_type != EMPTY) { }
     TIType(GVN & gvn, const Type _type, const int _rows, const int _cols) : type(_type), rows(gvn, _rows), cols(gvn, _cols), scalar(_rows == 1 && _cols == 1) { }
     TIType(GVN & gvn, Type _type, const SymbolicDimension & _rows, const SymbolicDimension & _cols) : type(_type), rows(_rows), cols(_cols), scalar(_rows == 1 && _cols == 1) { }
-    TIType(GVN & gvn, const Type _type, const bool _scalar) : type(_type), rows(gvn, _scalar ? 1. : -1.), cols(gvn, _scalar ? 1. : -1.), scalar(_scalar) { }
+    TIType(GVN & gvn, const Type _type, const bool _scalar) : type(_type), rows(gvn, _scalar ? 1 : -1), cols(gvn, _scalar ? 1 : -1), scalar(_scalar) { }
 
     inline bool hasValidDims() const
     {
index a4ae432..8b1d53f 100644 (file)
@@ -68,6 +68,11 @@ struct TITypeSignatureTuple
         types.emplace_back(t.type, t.isscalar());
     }
 
+    inline void emplace(const bool scalar, const analysis::TIType::Type type)
+    {
+        types.emplace_back(type, scalar);
+    }
+
     inline std::size_t size() const
     {
         return types.size();
index 9469c44..b996c2b 100644 (file)
@@ -115,12 +115,12 @@ inline static IntType getIntType(const double x)
     {
         if (x >= 0)
         {
-            if (x <= (double)(std::numeric_limits<uint64_t>::max)())
+            if (x <= (double)std::numeric_limits<uint64_t>::max())
             {
                 return UNSIGNED;
             }
         }
-        else if (x >= (double)(std::numeric_limits<int64_t>::min)())
+        else if (x >= (double)std::numeric_limits<int64_t>::min())
         {
             return SIGNED;
         }
@@ -272,10 +272,10 @@ static void printMap(const T & map, std::wostream & out, const bool newLine = fa
             else
             {
                 out << L",";
-               if (newLine)
-               {
-                   out << L"\n";
-               }
+                if (newLine)
+                {
+                    out << L"\n";
+                }
             }
         }
     }
index e8411b7..d7c51d9 100644 (file)
@@ -295,31 +295,35 @@ void AnalysisVisitor::visitArguments(const std::wstring & name, const unsigned i
     std::vector<TIType> out = getDM().call(*this, lhs, sym, vargs, &e, functionId);
     if (lhs > 1)
     {
-        std::vector<Result> resargs;
-        std::vector<TIType> vargs;
-        vargs.reserve(args.size());
-        resargs.reserve(args.size());
-
-        for (auto arg : args)
+        multipleLHS.clear();
+        multipleLHS.reserve(out.size());
+        for (const auto & type : out)
         {
-            arg->accept(*this);
-            resargs.push_back(getResult());
-            vargs.push_back(getResult().getType());
+            const int tempId = getDM().getTmpId(type, false);
+            multipleLHS.emplace_back(type, tempId);
         }
 
-        const symbol::Symbol & sym = static_cast<ast::SimpleVar &>(e.getName()).getSymbol();
-        uint64_t functionId = 0;
-        std::vector<TIType> out = getDM().call(*this, lhs, sym, vargs, &e, functionId);
-        if (lhs > 1)
+        auto i = args.begin();
+        for (const auto & resarg : resargs)
+        {
+            getDM().releaseTmp(resarg.getTempId(), *i);
+            ++i;
+        }
+    }
+    else if (lhs == 1)
+    {
+        int tempId = -1;
+        if (resargs.size() == 1)
         {
-            multipleLHS.clear();
-            multipleLHS.reserve(out.size());
-            for (const auto & type : out)
+            const int id = resargs.back().getTempId();
+            if (id != -1 && Checkers::isElementWise(name) && out[0] == resargs.back().getType())
             {
-                const int tempId = getDM().getTmpId(type, false);
-                multipleLHS.emplace_back(type, tempId);
+                tempId = id;
             }
-
+        }
+        if (tempId == -1)
+        {
+            tempId = getDM().getTmpId(out[0], false);
             auto i = args.begin();
             for (const auto & resarg : resargs)
             {
@@ -327,32 +331,10 @@ void AnalysisVisitor::visitArguments(const std::wstring & name, const unsigned i
                 ++i;
             }
         }
-        else if (lhs == 1)
-        {
-            int tempId = -1;
-            if (resargs.size() == 1)
-            {
-                const int id = resargs.back().getTempId();
-                if (id != -1 && Checkers::isElementWise(name) && out[0] == resargs.back().getType())
-                {
-                    tempId = id;
-                }
-            }
-            if (tempId == -1)
-            {
-                tempId = getDM().getTmpId(out[0], false);
-                auto i = args.begin();
-                for (const auto & resarg : resargs)
-                {
-                    getDM().releaseTmp(resarg.getTempId(), *i);
-                    ++i;
-                }
-            }
 
-            e.getDecorator().res = Result(out[0], tempId, functionId);
-            e.getDecorator().setCall(name, vargs);
-            setResult(e.getDecorator().res);
-        }
+        e.getDecorator().res = Result(out[0], tempId, functionId);
+        e.getDecorator().setCall(name, vargs);
+        setResult(e.getDecorator().res);
     }
 }
 
index f7e1d08..fd9a529 100644 (file)
@@ -79,13 +79,46 @@ TIType Checkers::check_____dotpower____(GVN & gvn, const TIType & in0, const TIT
         }
         case TIType::BOOLEAN :
         {
-            if (in1.type == TIType::EMPTY)
-            {
-                return in1;
-            }
-            else
+            switch (in1.type)
             {
-                return TIType(gvn);
+                case TIType::EMPTY :
+                {
+                    return in1;
+                }
+                case TIType::COMPLEX :
+                {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::COMPLEX, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
+                    return TIType(gvn, TIType::COMPLEX, -2, -2);
+                }
+                case TIType::DOUBLE :
+                {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::DOUBLE, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
+                    return TIType(gvn, TIType::DOUBLE, -2, -2);
+                }
+                default :
+                    return TIType(gvn);
             }
             return TIType(gvn);
         }
@@ -97,6 +130,22 @@ TIType Checkers::check_____dotpower____(GVN & gvn, const TIType & in0, const TIT
                 {
                     return in1;
                 }
+                case TIType::BOOLEAN :
+                {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::COMPLEX, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
+                    return TIType(gvn, TIType::COMPLEX, -2, -2);
+                }
                 case TIType::COMPLEX :
                 {
                     if (in0.rows == 1 && in0.cols == 1)
@@ -142,6 +191,22 @@ TIType Checkers::check_____dotpower____(GVN & gvn, const TIType & in0, const TIT
                 {
                     return in1;
                 }
+                case TIType::BOOLEAN :
+                {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::DOUBLE, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
+                    return TIType(gvn, TIType::DOUBLE, -2, -2);
+                }
                 case TIType::COMPLEX :
                 {
                     if (in0.rows == 1 && in0.cols == 1)
@@ -162,17 +227,17 @@ TIType Checkers::check_____dotpower____(GVN & gvn, const TIType & in0, const TIT
                 {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
-                        return in1;
+                        return TIType(gvn, TIType::COMPLEX, in1.rows, in1.cols);
                     }
                     if (in1.rows == 1 && in1.cols == 1)
                     {
-                        return in0;
+                        return TIType(gvn, TIType::COMPLEX, in0.rows, in0.cols);
                     }
                     if (in1.rows == in0.rows && in1.cols == in0.cols)
                     {
-                        return in0;
+                        return TIType(gvn, TIType::COMPLEX, in0.rows, in0.cols);
                     }
-                    return TIType(gvn, TIType::DOUBLE, -2, -2);
+                    return TIType(gvn, TIType::COMPLEX, -2, -2);
                 }
                 case TIType::INT16 :
                 {
index 78a6eec..a17d365 100644 (file)
@@ -51,14 +51,50 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::BOOLEAN :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 case TIType::COMPLEX :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 case TIType::DOUBLE :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 default :
@@ -76,14 +112,50 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::BOOLEAN :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 case TIType::COMPLEX :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 case TIType::DOUBLE :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 default :
@@ -101,14 +173,50 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::BOOLEAN :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 case TIType::COMPLEX :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 case TIType::DOUBLE :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::BOOLEAN, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::BOOLEAN, -2, -2);
                 }
                 default :
@@ -122,34 +230,130 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
             {
                 case TIType::INT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT16, -2, -2);
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::INT32, -2, -2);
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::INT64, -2, -2);
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT16, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT16, -2, -2);
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 default :
@@ -163,34 +367,130 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
             {
                 case TIType::INT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT32, -2, -2);
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT32, -2, -2);
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::INT64, -2, -2);
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT32, -2, -2);
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 default :
@@ -204,34 +504,130 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
             {
                 case TIType::INT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT64, -2, -2);
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT64, -2, -2);
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT64, -2, -2);
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT64, -2, -2);
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 default :
@@ -245,34 +641,130 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
             {
                 case TIType::INT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT16, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::INT16, -2, -2);
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::INT32, -2, -2);
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::INT64, -2, -2);
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::INT8, -2, -2);
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT8, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT8, -2, -2);
                 }
                 default :
@@ -286,34 +778,130 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
             {
                 case TIType::INT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 default :
@@ -327,34 +915,130 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
             {
                 case TIType::INT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 default :
@@ -368,34 +1052,130 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
             {
                 case TIType::INT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 default :
@@ -409,34 +1189,130 @@ TIType Checkers::check_____oror____(GVN & gvn, const TIType & in0, const TIType
             {
                 case TIType::INT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT8, in1.rows, in1.cols);
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT8, -2, -2);
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT16, -2, -2);
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT32, -2, -2);
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.cols);
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in1;
+                    }
                     return TIType(gvn, TIType::UINT64, -2, -2);
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.rows == 1 && in0.cols == 1)
+                    {
+                        return in1;
+                    }
+                    if (in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
+                    if (in1.rows == in0.rows && in1.cols == in0.cols)
+                    {
+                        return in0;
+                    }
                     return TIType(gvn, TIType::UINT8, -2, -2);
                 }
                 default :
index eae8094..7e7cb21 100644 (file)
@@ -85,16 +85,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::COMPLEX :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::DOUBLE, in1.rows, in1.cols);
+                        return TIType(gvn, TIType::COMPLEX, in0.rows, in0.rows);
                     }
-                    return TIType(gvn, TIType::DOUBLE, -2, -2);
-                }
-                case TIType::COMPLEX :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -103,75 +99,15 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
-                    {
-                        return in1;
-                    }
-                    return TIType(gvn, TIType::DOUBLE, -2, -2);
-                }
-                case TIType::INT16 :
-                {
-                    if (in0.rows == 1 && in0.cols == 1)
-                    {
-                        return in1;
-                    }
-                    return TIType(gvn, TIType::INT16, -2, -2);
-                }
-                case TIType::INT32 :
-                {
-                    if (in0.rows == 1 && in0.cols == 1)
-                    {
-                        return in1;
-                    }
-                    return TIType(gvn, TIType::INT32, -2, -2);
-                }
-                case TIType::INT64 :
-                {
-                    if (in0.rows == 1 && in0.cols == 1)
-                    {
-                        return in1;
-                    }
-                    return TIType(gvn, TIType::INT64, -2, -2);
-                }
-                case TIType::INT8 :
-                {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return in1;
+                        return TIType(gvn, TIType::DOUBLE, in0.rows, in0.rows);
                     }
-                    return TIType(gvn, TIType::INT8, -2, -2);
-                }
-                case TIType::UINT16 :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
                     }
-                    return TIType(gvn, TIType::UINT16, -2, -2);
-                }
-                case TIType::UINT32 :
-                {
-                    if (in0.rows == 1 && in0.cols == 1)
-                    {
-                        return in1;
-                    }
-                    return TIType(gvn, TIType::UINT32, -2, -2);
-                }
-                case TIType::UINT64 :
-                {
-                    if (in0.rows == 1 && in0.cols == 1)
-                    {
-                        return in1;
-                    }
-                    return TIType(gvn, TIType::UINT64, -2, -2);
-                }
-                case TIType::UINT8 :
-                {
-                    if (in0.rows == 1 && in0.cols == 1)
-                    {
-                        return in1;
-                    }
-                    return TIType(gvn, TIType::UINT8, -2, -2);
+                    return TIType(gvn, TIType::DOUBLE, -2, -2);
                 }
                 default :
                     return TIType(gvn);
@@ -188,6 +124,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::BOOLEAN :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::COMPLEX, in1.rows, in1.cols);
@@ -196,6 +136,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::COMPLEX :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -204,6 +148,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::DOUBLE :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::COMPLEX, in1.rows, in1.cols);
@@ -225,6 +173,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::BOOLEAN :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::DOUBLE, in1.rows, in1.cols);
@@ -233,6 +185,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::COMPLEX :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::COMPLEX, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -241,14 +197,22 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::DOUBLE :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::COMPLEX, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
-                        return in1;
+                        return TIType(gvn, TIType::COMPLEX, in1.rows, in1.cols);
                     }
-                    return TIType(gvn, TIType::DOUBLE, -2, -2);
+                    return TIType(gvn, TIType::COMPLEX, -2, -2);
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT16, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -257,6 +221,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -265,6 +233,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -273,6 +245,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT8, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -281,6 +257,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -289,6 +269,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -297,6 +281,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -305,6 +293,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT8, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -324,16 +316,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::INT16, in1.rows, in1.cols);
+                        return in0;
                     }
-                    return TIType(gvn, TIType::INT16, -2, -2);
-                }
-                case TIType::DOUBLE :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT16, in1.rows, in1.cols);
@@ -342,6 +330,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -350,6 +342,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -358,6 +354,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -366,6 +366,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT16, in1.rows, in1.cols);
@@ -374,6 +378,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -382,6 +390,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -390,6 +402,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -398,6 +414,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
@@ -417,16 +437,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::INT32, in1.rows, in1.cols);
+                        return in0;
                     }
-                    return TIType(gvn, TIType::INT32, -2, -2);
-                }
-                case TIType::DOUBLE :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT32, in1.rows, in1.cols);
@@ -435,6 +451,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT32, in1.rows, in1.cols);
@@ -443,6 +463,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -451,6 +475,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -459,6 +487,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT32, in1.rows, in1.cols);
@@ -467,6 +499,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -475,6 +511,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -483,6 +523,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -491,6 +535,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -510,16 +558,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::INT64, in1.rows, in1.cols);
+                        return in0;
                     }
-                    return TIType(gvn, TIType::INT64, -2, -2);
-                }
-                case TIType::DOUBLE :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT64, in1.rows, in1.cols);
@@ -528,6 +572,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT64, in1.rows, in1.cols);
@@ -536,6 +584,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT64, in1.rows, in1.cols);
@@ -544,6 +596,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -552,6 +608,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT64, in1.rows, in1.cols);
@@ -560,6 +620,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -568,6 +632,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -576,6 +644,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -584,6 +656,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -603,16 +679,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::INT8, in1.rows, in1.cols);
+                        return in0;
                     }
-                    return TIType(gvn, TIType::INT8, -2, -2);
-                }
-                case TIType::DOUBLE :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::INT8, in1.rows, in1.cols);
@@ -621,6 +693,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT16, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -629,6 +705,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -637,6 +717,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::INT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -645,6 +729,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -653,6 +741,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -661,6 +753,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -669,6 +765,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -677,6 +777,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT8, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -696,16 +800,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
+                        return in0;
                     }
-                    return TIType(gvn, TIType::UINT16, -2, -2);
-                }
-                case TIType::DOUBLE :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
@@ -714,6 +814,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
@@ -722,6 +826,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -730,6 +838,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -738,6 +850,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
@@ -746,6 +862,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -754,6 +874,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -762,6 +886,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -770,6 +898,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
@@ -789,16 +921,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
+                        return in0;
                     }
-                    return TIType(gvn, TIType::UINT32, -2, -2);
-                }
-                case TIType::DOUBLE :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -807,6 +935,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -815,6 +947,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -823,6 +959,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -831,6 +971,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -839,6 +983,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -847,6 +995,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -855,6 +1007,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -863,6 +1019,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -882,16 +1042,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
+                        return in0;
                     }
-                    return TIType(gvn, TIType::UINT64, -2, -2);
-                }
-                case TIType::DOUBLE :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -900,6 +1056,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -908,6 +1068,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -916,6 +1080,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -924,6 +1092,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -932,6 +1104,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -940,6 +1116,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -948,6 +1128,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -956,6 +1140,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -975,16 +1163,12 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 {
                     return in1;
                 }
-                case TIType::BOOLEAN :
+                case TIType::DOUBLE :
                 {
-                    if (in0.rows == 1 && in0.cols == 1)
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
                     {
-                        return TIType(gvn, TIType::UINT8, in1.rows, in1.cols);
+                        return in0;
                     }
-                    return TIType(gvn, TIType::UINT8, -2, -2);
-                }
-                case TIType::DOUBLE :
-                {
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT8, in1.rows, in1.cols);
@@ -993,6 +1177,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT16, in1.rows, in1.cols);
@@ -1001,6 +1189,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT32, in1.rows, in1.cols);
@@ -1009,6 +1201,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT64, in1.rows, in1.cols);
@@ -1017,6 +1213,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::INT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return TIType(gvn, TIType::UINT8, in1.rows, in1.cols);
@@ -1025,6 +1225,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT16 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT16, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -1033,6 +1237,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT32 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT32, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -1041,6 +1249,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT64 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return TIType(gvn, TIType::UINT64, in0.rows, in0.rows);
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;
@@ -1049,6 +1261,10 @@ TIType Checkers::check_____power____(GVN & gvn, const TIType & in0, const TIType
                 }
                 case TIType::UINT8 :
                 {
+                    if (in0.cols == in0.rows && in1.rows == 1 && in1.cols == 1)
+                    {
+                        return in0;
+                    }
                     if (in0.rows == 1 && in0.cols == 1)
                     {
                         return in1;