OSDN Git Service

LowerBitSets: Don't bother to do any work if the llvm.bitset.test intrinsic is unused.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 3 Feb 2016 03:48:46 +0000 (03:48 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 3 Feb 2016 03:48:46 +0000 (03:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259625 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/LowerBitSets.cpp

index 92eaf9f..7b9879c 100644 (file)
@@ -920,7 +920,7 @@ void LowerBitSets::buildBitSetsFromDisjointSet(
 bool LowerBitSets::buildBitSets() {
   Function *BitSetTestFunc =
       M->getFunction(Intrinsic::getName(Intrinsic::bitset_test));
-  if (!BitSetTestFunc)
+  if (!BitSetTestFunc || BitSetTestFunc->use_empty())
     return false;
 
   // Equivalence class set containing bitsets and the globals they reference.