diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2015-09-28 21:44:46 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2015-09-28 21:44:46 +0000 |
| commit | 5e5f0e9756ebfc2bb9c8cf5df85d807d722dfd24 (patch) | |
| tree | 05a36fcda73e6dc62834f4f4db089387af458036 /llvm/lib | |
| parent | 4b1600359097d1edcdd62f0b65e6ab69c8e56d2f (diff) | |
| download | bcm5719-llvm-5e5f0e9756ebfc2bb9c8cf5df85d807d722dfd24.tar.gz bcm5719-llvm-5e5f0e9756ebfc2bb9c8cf5df85d807d722dfd24.zip | |
move one-use check under the comment that describes it; NFCI
llvm-svn: 248745
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index c667601ccf3..c69b0388471 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -3854,7 +3854,7 @@ static bool isFormingBranchFromSelectProfitable(SelectInst *SI) { // avoid stalls on the load from memory. If the compare has more than one use // there's probably another cmov or setcc around so it's not worth emitting a // branch. - if (!Cmp) + if (!Cmp || !Cmp->hasOneUse()) return false; Value *CmpOp0 = Cmp->getOperand(0); @@ -3862,8 +3862,7 @@ static bool isFormingBranchFromSelectProfitable(SelectInst *SI) { // We check that the memory operand has one use to avoid uses of the loaded // value directly after the compare, making branches unprofitable. - return Cmp->hasOneUse() && - ((isa<LoadInst>(CmpOp0) && CmpOp0->hasOneUse()) || + return ((isa<LoadInst>(CmpOp0) && CmpOp0->hasOneUse()) || (isa<LoadInst>(CmpOp1) && CmpOp1->hasOneUse())); } |

