This is an archive of the discontinued LLVM Phabricator instance.

Refactor: Simplify boolean conditional return statements in llvm/lib/CodeGen
AbandonedPublic

Authored by LegalizeAdulthood on May 24 2015, 11:46 PM.

Details

Summary

Use clang-tidy to simplify boolean conditional return statements.

Diff Detail

Event Timeline

LegalizeAdulthood retitled this revision from to Refactor: Simplify boolean conditional return statements in llvm/lib/CodeGen.
LegalizeAdulthood updated this object.
LegalizeAdulthood edited the test plan for this revision. (Show Details)
LegalizeAdulthood added a subscriber: Unknown Object (MLST).
craig.topper added inline comments.
lib/CodeGen/MachineLICM.cpp
946–947

Push the negate through

lib/CodeGen/PseudoSourceValue.cpp
97–98

Push the negate through and use ANDs

lib/CodeGen/TargetInstrInfo.cpp
202

Push the negate through

lib/CodeGen/MachineLICM.cpp
946–947

Fixed.

lib/CodeGen/PseudoSourceValue.cpp
97–98

Fixed.

lib/CodeGen/TargetInstrInfo.cpp
202

Fixed.

Update from comments, clang-format

There's still two instances where you can push the negation to the leafs of the expression:

lib/CodeGen/Analysis.cpp
364–365

return BitsProvided >= BitsRequired &&

(AllowDifferingSizes || BitsProvided == BitsRequired);
lib/CodeGen/CodeGenPrepare.cpp
2285

return !isa<SelectInst>(Inst) || OpIdx != 0;

LegalizeAdulthood abandoned this revision.Oct 24 2015, 1:35 PM