[llvm] LICM: hoist BO assoc when (C1 op LV) op C2 (PR #106999)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 02:41:31 PDT 2024


================
@@ -2803,15 +2803,19 @@ static bool hoistMulAddAssociation(Instruction &I, Loop &L,
 
 /// Reassociate associative binary expressions of the form
 ///
-/// 1. "(LV op C1) op C2" ==> "LV op (C1 op C2)"
+/// 1. "(LV op C1) op C2" ==> "LV op (C1 op C2)" if op is an associative BinOp
----------------
nikic wrote:

I think it would have been sufficient here to copy 2. up, because the rest of the comment applies to both cases -- we don't need to separately explain the meaning of LV/C1/C2 for each case.

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


More information about the llvm-commits mailing list