diff options
| author | David Blaikie <dblaikie@gmail.com> | 2015-03-09 01:57:13 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2015-03-09 01:57:13 +0000 |
| commit | dc3f01e9cfc098bb2a55b103396eb3f0464b0c7a (patch) | |
| tree | 41e53ef86195787acb15962965c7475b8804771f /llvm/lib/CodeGen | |
| parent | 2a08dca3f719f207ead372bc0b635c757efd41c6 (diff) | |
| download | bcm5719-llvm-dc3f01e9cfc098bb2a55b103396eb3f0464b0c7a.tar.gz bcm5719-llvm-dc3f01e9cfc098bb2a55b103396eb3f0464b0c7a.zip | |
Simplify expressions involving boolean constants with clang-tidy
Patch by Richard (legalize at xmission dot com).
Differential Revision: http://reviews.llvm.org/D8154
llvm-svn: 231617
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/PeepholeOptimizer.cpp | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 81a149a99e3..bcdfec77cba 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -4466,8 +4466,7 @@ static void scaleWeights(uint64_t &NewTrue, uint64_t &NewFalse) { /// FIXME: Remove the (equivalent?) implementation in SelectionDAG. /// bool CodeGenPrepare::splitBranchCondition(Function &F) { - if (!TM || TM->Options.EnableFastISel != true || - !TLI || TLI->isJumpExpensive()) + if (!TM || !TM->Options.EnableFastISel || !TLI || TLI->isJumpExpensive()) return false; bool MadeChange = false; diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index 1a1f2a9d03c..2395f32061d 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/lib/CodeGen/IfConversion.cpp @@ -247,7 +247,7 @@ namespace { return true; else if (Incr1 == Incr2) { // Favors subsumption. - if (C1->NeedSubsumption == false && C2->NeedSubsumption == true) + if (!C1->NeedSubsumption && C2->NeedSubsumption) return true; else if (C1->NeedSubsumption == C2->NeedSubsumption) { // Favors diamond over triangle, etc. diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp index 2800d846ff3..bc39e556cf0 100644 --- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp +++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp @@ -915,7 +915,7 @@ bool PeepholeOptimizer::optimizeCoalescableCopy(MachineInstr *MI) { // => v0 = COPY v1 // Currently we haven't seen motivating example for that and we // want to avoid untested code. - NumRewrittenCopies += Changed == true; + NumRewrittenCopies += Changed; return Changed; } |

