[llvm] 3d9b537 - [SVEIntrinsicOpts] NFC: Remove unused isReinterpretFromBool for no-assert builds

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 01:50:57 PDT 2020


Author: Sander de Smalen
Date: 2020-04-21T09:49:22+01:00
New Revision: 3d9b53706fdfc15e53e0cd6823f45922e2c696db

URL: https://github.com/llvm/llvm-project/commit/3d9b53706fdfc15e53e0cd6823f45922e2c696db
DIFF: https://github.com/llvm/llvm-project/commit/3d9b53706fdfc15e53e0cd6823f45922e2c696db.diff

LOG: [SVEIntrinsicOpts] NFC: Remove unused isReinterpretFromBool for no-assert builds

isReinterpretFromBool's only use is in an assert, which causes a warning that the
function is defined but not used in no-assert builds.

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp b/llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp
index 9811ab14eaf2..74fe0cdd1ea7 100644
--- a/llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp
+++ b/llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp
@@ -54,7 +54,6 @@ struct SVEIntrinsicOpts : public ModulePass {
   void getAnalysisUsage(AnalysisUsage &AU) const override;
 
 private:
-  static IntrinsicInst *isReinterpretFromSVBool(Value *V);
   static IntrinsicInst *isReinterpretToSVBool(Value *V);
 
   static bool optimizeIntrinsic(Instruction *I);
@@ -96,18 +95,6 @@ IntrinsicInst *SVEIntrinsicOpts::isReinterpretToSVBool(Value *V) {
   return I;
 }
 
-/// Returns V if it's a cast to <n x 16 x i1> (aka svbool_t), nullptr otherwise.
-IntrinsicInst *SVEIntrinsicOpts::isReinterpretFromSVBool(Value *V) {
-  IntrinsicInst *I = dyn_cast<IntrinsicInst>(V);
-  if (!I)
-    return nullptr;
-
-  if (I->getIntrinsicID() != Intrinsic::aarch64_sve_convert_from_svbool)
-    return nullptr;
-
-  return I;
-}
-
 /// The function will remove redundant reinterprets casting in the presence
 /// of the control flow
 bool SVEIntrinsicOpts::processPhiNode(IntrinsicInst *X) {
@@ -183,7 +170,8 @@ bool SVEIntrinsicOpts::optimizePTest(IntrinsicInst *I) {
 }
 
 bool SVEIntrinsicOpts::optimizeConvertFromSVBool(IntrinsicInst *I) {
-  assert(isReinterpretFromSVBool(I));
+  assert(I->getIntrinsicID() == Intrinsic::aarch64_sve_convert_from_svbool &&
+         "Unexpected opcode");
 
   // If the reinterpret instruction operand is a PHI Node
   if (isa<PHINode>(I->getArgOperand(0)))


        


More information about the llvm-commits mailing list