[PATCH] D65815: [EarlyCSE] Add support for unary FNeg to EarlyCSE
Joseph Tremoulet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 14:23:19 PDT 2019
JosephTremoulet added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/EarlyCSE.cpp:168-169
+
+ if (UnaryOperator *UnOp = dyn_cast<UnaryOperator>(Inst))
+ return hash_combine(UnOp->getOpcode(), UnOp->getOperand(0));
+
----------------
I think this is the same thing you'd get by letting control fall down to the default case at the end of the function (once you relax the assertion there to mirror the change you've made to `canHandle`). I'd think that would be preferable as it would keep `getHashValueImpl` and `isEqualImpl` more directly/syntactically/obviously in sync.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65815/new/
https://reviews.llvm.org/D65815
More information about the llvm-commits
mailing list