[polly] r246387 - Remove some code duplication [NFC]

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 30 09:57:15 PDT 2015


Author: grosser
Date: Sun Aug 30 11:57:15 2015
New Revision: 246387

URL: http://llvm.org/viewvc/llvm-project?rev=246387&view=rev
Log:
Remove some code duplication [NFC]

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp
    polly/trunk/lib/CodeGen/BlockGenerators.cpp

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=246387&r1=246386&r2=246387&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sun Aug 30 11:57:15 2015
@@ -395,28 +395,8 @@ bool ScopDetection::isValidCallInst(Call
   if (CalledFunction == 0)
     return false;
 
-  // Check if we can handle the intrinsic call.
-  if (auto *IT = dyn_cast<IntrinsicInst>(&CI)) {
-    switch (IT->getIntrinsicID()) {
-    // Lifetime markers are supported/ignored.
-    case llvm::Intrinsic::lifetime_start:
-    case llvm::Intrinsic::lifetime_end:
-    // Invariant markers are supported/ignored.
-    case llvm::Intrinsic::invariant_start:
-    case llvm::Intrinsic::invariant_end:
-    // Some misc annotations are supported/ignored.
-    case llvm::Intrinsic::var_annotation:
-    case llvm::Intrinsic::ptr_annotation:
-    case llvm::Intrinsic::annotation:
-    case llvm::Intrinsic::donothing:
-    case llvm::Intrinsic::assume:
-    case llvm::Intrinsic::expect:
-      return true;
-    default:
-      // Other intrinsics which may access the memory are not yet supported.
-      break;
-    }
-  }
+  if (isIgnoredIntrinsic(&CI))
+    return true;
 
   return false;
 }

Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=246387&r1=246386&r2=246387&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Sun Aug 30 11:57:15 2015
@@ -267,27 +267,8 @@ void BlockGenerator::copyInstruction(Sco
 
   // Skip some special intrinsics for which we do not adjust the semantics to
   // the new schedule. All others are handled like every other instruction.
-  if (auto *IT = dyn_cast<IntrinsicInst>(Inst)) {
-    switch (IT->getIntrinsicID()) {
-    // Lifetime markers are ignored.
-    case llvm::Intrinsic::lifetime_start:
-    case llvm::Intrinsic::lifetime_end:
-    // Invariant markers are ignored.
-    case llvm::Intrinsic::invariant_start:
-    case llvm::Intrinsic::invariant_end:
-    // Some misc annotations are ignored.
-    case llvm::Intrinsic::var_annotation:
-    case llvm::Intrinsic::ptr_annotation:
-    case llvm::Intrinsic::annotation:
-    case llvm::Intrinsic::donothing:
-    case llvm::Intrinsic::assume:
-    case llvm::Intrinsic::expect:
-      return;
-    default:
-      // Other intrinsics are copied.
-      break;
-    }
-  }
+  if (isIgnoredIntrinsic(Inst))
+    return;
 
   copyInstScalar(Stmt, Inst, BBMap, GlobalMap, LTS);
 }




More information about the llvm-commits mailing list