Skip to content

Commit

Permalink
Refactor: Simplify boolean conditional return statements in lib/Targe…
Browse files Browse the repository at this point in the history
…t/PowerPC

Summary: Use clang-tidy to simplify boolean conditional return statements

Reviewers: uweigand, rafael, wschmidt

Subscribers: craig.topper, llvm-commits

Patch by Richard Thomson!

Differential Revision: http://reviews.llvm.org/D9984

llvm-svn: 256493
  • Loading branch information
alexfh committed Dec 28, 2015
1 parent 4f74ec0 commit 175a7cb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
5 changes: 1 addition & 4 deletions llvm/lib/Target/PowerPC/PPCFastISel.cpp
Expand Up @@ -293,10 +293,7 @@ bool PPCFastISel::isValueAvailable(const Value *V) const {
return true;

const auto *I = cast<Instruction>(V);
if (FuncInfo.MBBMap[I->getParent()] == FuncInfo.MBB)
return true;

return false;
return FuncInfo.MBBMap[I->getParent()] == FuncInfo.MBB;
}

// Given a value Obj, create an Address object Addr that represents its
Expand Down
5 changes: 1 addition & 4 deletions llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Expand Up @@ -1612,10 +1612,7 @@ class BitPermutationSelector {
return false;
}

if (VRI.RLAmt != EffRLAmt)
return false;

return true;
return VRI.RLAmt == EffRLAmt;
};

for (auto &BG : BitGroups) {
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Expand Up @@ -11434,9 +11434,7 @@ bool PPCTargetLowering::shouldConvertConstantLoadToIntImm(const APInt &Imm,
assert(Ty->isIntegerTy());

unsigned BitSize = Ty->getPrimitiveSizeInBits();
if (BitSize == 0 || BitSize > 64)
return false;
return true;
return !(BitSize == 0 || BitSize > 64);
}

bool PPCTargetLowering::isTruncateFree(Type *Ty1, Type *Ty2) const {
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp
Expand Up @@ -164,9 +164,7 @@ struct PPCVSXSwapRemoval : public MachineFunctionPass {
bool isRegInClass(unsigned Reg, const TargetRegisterClass *RC) {
if (TargetRegisterInfo::isVirtualRegister(Reg))
return RC->hasSubClassEq(MRI->getRegClass(Reg));
if (RC->contains(Reg))
return true;
return false;
return RC->contains(Reg);
}

// Return true iff the given register is a full vector register.
Expand Down

0 comments on commit 175a7cb

Please sign in to comment.