Removing unnecessary uses of `unreached` from hwintrinsic importation (#2298)
authorTanner Gooding <tagoo@outlook.com>
Wed, 5 Feb 2020 18:53:22 +0000 (10:53 -0800)
committerGitHub <noreply@github.com>
Wed, 5 Feb 2020 18:53:21 +0000 (10:53 -0800)
src/coreclr/src/jit/hwintrinsic.cpp
src/coreclr/src/jit/hwintrinsicarm64.cpp
src/coreclr/src/jit/hwintrinsicxarch.cpp

index 1fb7d8d4ef6bae2be1c7f905abc771c723763aaf..716d4904046d69047131f77d5067d28268391ddd 100644 (file)
@@ -688,7 +688,7 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic        intrinsic,
             }
 
             default:
-                unreached();
+                return nullptr;
         }
 
         bool isMemoryStore = retNode->OperIsMemoryStore();
index 54f484332601137d7b1d7d4a963772ea6adc5a55..d23a5c1343e49edcb195d5485a39e20c0af924b0 100644 (file)
@@ -26,7 +26,7 @@ static InstructionSet Arm64VersionOfIsa(InstructionSet isa)
         case InstructionSet_Crc32:
             return InstructionSet_Crc32_Arm64;
         default:
-            unreached();
+            return InstructionSet_NONE;
     }
 }
 
@@ -175,7 +175,7 @@ bool HWIntrinsicInfo::isFullyImplementedIsa(InstructionSet isa)
 
         default:
         {
-            unreached();
+            return false;
         }
     }
 }
@@ -220,7 +220,7 @@ bool HWIntrinsicInfo::isScalarIsa(InstructionSet isa)
 //
 GenTree* Compiler::impNonConstFallback(NamedIntrinsic intrinsic, var_types simdType, var_types baseType)
 {
-    unreached();
+    return nullptr;
 }
 
 //------------------------------------------------------------------------
@@ -400,8 +400,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic        intrinsic,
 
         default:
         {
-            unreached();
-            break;
+            return nullptr;
         }
     }
 
index 9056733ff4781ee2ae38af710100212f2c789176..4a12b5a1af6e980acefef4844a3b30f2725e2b20 100644 (file)
@@ -36,7 +36,7 @@ static InstructionSet X64VersionOfIsa(InstructionSet isa)
         case InstructionSet_POPCNT:
             return InstructionSet_POPCNT_X64;
         default:
-            unreached();
+            return InstructionSet_NONE;
     }
 }
 
@@ -289,7 +289,7 @@ bool HWIntrinsicInfo::isFullyImplementedIsa(InstructionSet isa)
 
         default:
         {
-            unreached();
+            return false;
         }
     }
 }
@@ -357,7 +357,7 @@ GenTree* Compiler::impNonConstFallback(NamedIntrinsic intrinsic, var_types simdT
         }
 
         default:
-            unreached();
+            return nullptr;
     }
 }
 
@@ -415,7 +415,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic        intrinsic,
         case InstructionSet_POPCNT_X64:
             return impPOPCNTIntrinsic(intrinsic, method, sig, mustExpand);
         default:
-            unreached();
+            return nullptr;
     }
 }
 
@@ -821,8 +821,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic        intrinsic,
                     break;
 
                 default:
-                    unreached();
-                    break;
+                    return nullptr;
             }
 
             ssize_t imm8       = indexOp->AsIntCon()->IconValue();
@@ -980,8 +979,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic        intrinsic,
                 }
 
                 default:
-                    unreached();
-                    break;
+                    return nullptr;
             }
 
             if (simdSize == 32)
@@ -1106,7 +1104,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic        intrinsic,
                         break;
 
                     default:
-                        unreached();
+                        return nullptr;
                 }
 
                 return gtNewSimdHWIntrinsicNode(retType, vectorOp, resIntrinsic, baseType, 16);
@@ -1176,7 +1174,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic        intrinsic,
                     break;
 
                 default:
-                    unreached();
+                    return nullptr;
             }
 
             break;
@@ -1184,8 +1182,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic        intrinsic,
 
         default:
         {
-            unreached();
-            break;
+            return nullptr;
         }
     }
 
@@ -1513,7 +1510,7 @@ GenTree* Compiler::impBMI1OrBMI2Intrinsic(NamedIntrinsic        intrinsic,
         }
 
         default:
-            unreached();
+            return nullptr;
     }
 }