[PATCH] D62223: [DAGCombiner][X86][AArch64][AMDGPU] (x + C) - y -> (x - y) + C fold
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 22 12:05:01 PDT 2019
bjope added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2926
+ // Hoist one-use addition by constant: (x + C) - y -> (x - y) + C
+ if (N0.hasOneUse() && N0.getOpcode() == ISD::ADD &&
+ isConstantOrConstantVector(N0.getOperand(1))) {
----------------
Not sure if it is super important, or common, in reality. But maybe this should be trigger for an add-like-or as well?
An ADD with no common bits set in the operands is canonicalized into OR by DAGCombiner, so there could be lots of OR:s out there that really are ADD:s.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62223/new/
https://reviews.llvm.org/D62223
More information about the llvm-commits
mailing list