[llvm] [Reassociate] Preserve NUW flags after expr tree rewriting (PR #72360)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 08:46:31 PST 2023
================
@@ -1225,7 +1234,7 @@ Value *ReassociatePass::RemoveFactorFromExpression(Value *V, Value *Factor) {
RedoInsts.insert(BO);
V = Factors[0].Op;
} else {
- RewriteExprTree(BO, Factors);
+ RewriteExprTree(BO, Factors, HasNUW);
----------------
dtcxzyw wrote:
I don't think it is an issue.
The transform `-C *nuw X1 *nuw X2 *nuw X3` --> `C * -(X1 *nuw X2 *nuw X3)` is correct.
https://github.com/llvm/llvm-project/pull/72360
More information about the llvm-commits
mailing list