[PATCH] D41467: PR35710: Nary reassociation falls into infinite loop

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 19:08:16 PST 2018

hfinkel added inline comments.

Comment at: lib/Transforms/Scalar/NaryReassociate.cpp:466
                                                           BinaryOperator *I) {
+  // Need to avoid special case (C1*v)*(C2*v) = 0 because of overflow and
+  // there is Instruction "mul x, 0", as it leads to infinite loop
If I hadn't read the description, I'd have no idea what this meant (and I'm still not entirely sure). How does this detect overflow? Is it fair to say that x*0 is a special case because it can be  replicated arbitrarily-many times in products (because it is equal to 0, and thus, so is any product of which it is a part), and that can lead to infinite loops.



More information about the llvm-commits mailing list