[llvm] LICM: hoist BO assoc when BinOp is in RHS (PR #107072)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 06:16:45 PDT 2024


================
@@ -2805,13 +2805,11 @@ static bool hoistMulAddAssociation(Instruction &I, Loop &L,
 ///
 /// 1. "(LV op C1) op C2" ==> "LV op (C1 op C2)" if op is an associative BinOp
 /// 2. "(C1 op LV) op C2" ==> "LV op (C1 op C2)" if op is a commutative BinOp
+/// 3. "C2 op (C1 op LV)" ==> "(C2 op C1) op LV" if op an associative BinOp
----------------
nikic wrote:

```suggestion
/// 3. "C2 op (C1 op LV)" ==> "(C2 op C1) op LV" if op is an associative BinOp
```

https://github.com/llvm/llvm-project/pull/107072


More information about the llvm-commits mailing list