[PATCH] D159198: [DAG] Fold (shl (ext (add x, c1)), c2) -> (add (shl (ext x), c2), c1 << c2)
Phoebe Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 30 19:02:05 PDT 2023
pengfei added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9930-9931
+ // fold (shl (sext (add_nsw x, c1)), c2) -> (add (shl (sext x), c2), c1 << c2)
+ // fold (shl (zext (add_nuw x, c1)), c2) -> (add (shl (zext x), c2), c1 << c2)
+ if ((N0.getOpcode() == ISD::SIGN_EXTEND ||
----------------
Do we need to consider the possibility of overflow when `c1 << c2`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159198/new/
https://reviews.llvm.org/D159198
More information about the llvm-commits
mailing list