diff options
| author | 2017-01-14 19:55:43 +0000 | |
|---|---|---|
| committer | 2017-01-14 19:55:43 +0000 | |
| commit | bd3306aecb3a15e8967143b8cdbbccf2b1b19b74 (patch) | |
| tree | 309a8132b44564b9e634c0da6815187ce8eab27c /gnu/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp | |
| parent | killp -a should not kill the window if only one pane. (diff) | |
| download | wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.tar.xz wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.zip | |
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp')
| -rw-r--r-- | gnu/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gnu/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp b/gnu/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp index 7920240bc2b..bfb4d875690 100644 --- a/gnu/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp +++ b/gnu/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp @@ -119,7 +119,7 @@ class PPCBoolRetToInt : public FunctionPass { Promotable.insert(P); SmallVector<const PHINode *, 8> ToRemove; - for (const auto &P : Promotable) { + for (const PHINode *P : Promotable) { // Condition 2 and 3 auto IsValidUser = [] (const Value *V) -> bool { return isa<ReturnInst>(V) || isa<CallInst>(V) || isa<PHINode>(V) || @@ -146,7 +146,7 @@ class PPCBoolRetToInt : public FunctionPass { Promotable.erase(User); ToRemove.clear(); - for (const auto &P : Promotable) { + for (const PHINode *P : Promotable) { // Condition 4 and 5 const auto &Users = P->users(); const auto &Operands = P->operands(); @@ -168,6 +168,9 @@ class PPCBoolRetToInt : public FunctionPass { } bool runOnFunction(Function &F) { + if (skipFunction(F)) + return false; + PHINodeSet PromotablePHINodes = getPromotablePHINodes(F); B2IMap Bool2IntMap; bool Changed = false; @@ -199,11 +202,11 @@ class PPCBoolRetToInt : public FunctionPass { // Presently, we only know how to handle PHINode, Constant, and Arguments. // Potentially, bitwise operations (AND, OR, XOR, NOT) and sign extension // could also be handled in the future. - for (const auto &V : Defs) + for (Value *V : Defs) if (!isa<PHINode>(V) && !isa<Constant>(V) && !isa<Argument>(V)) return false; - for (const auto &V : Defs) + for (Value *V : Defs) if (const PHINode *P = dyn_cast<PHINode>(V)) if (!PromotablePHINodes.count(P)) return false; @@ -214,7 +217,7 @@ class PPCBoolRetToInt : public FunctionPass { ++NumBoolCallPromotion; ++NumBoolToIntPromotion; - for (const auto &V : Defs) + for (Value *V : Defs) if (!BoolToIntMap.count(V)) BoolToIntMap[V] = translate(V); |
