[PATCH] D33074: InstCombine: Allow sinking instructions with more uses in the same block.

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 20:13:25 PDT 2017


dberris added a comment.

Drive-by-review.



================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:2920
+        UsesInOneBlock = true;
+      } else if (CurrentUserParent != UsersParent) {
+        UsesInOneBlock = false;
----------------
Do you actually need the else here? I suspect CurrentUserParent will never be nullptr, and UsersParent will never be nullptr here either after the preceding conditional.


================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:2927
+
+    if (UsesInOneBlock) {
+      BasicBlock *BB = I->getParent();
----------------
Maybe clearer if you turn this into an early return?

```
if (!UsesInOneBlock)
  return false;

// rest of code.
```


Repository:
  rL LLVM

https://reviews.llvm.org/D33074





More information about the llvm-commits mailing list