[PATCH] D113202: [DAG] FoldConstantArithmetic - fold bitlogic(bitcast(x),bitcast(y)) -> bitcast(bitlogic(x,y))

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 5 04:29:32 PDT 2021


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

Seems like an improvement to me.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5300-5301
+      N2->getOpcode() == ISD::BITCAST) {
+    SDValue InnerN1 = peekThroughBitcasts(N1->getOperand(0));
+    SDValue InnerN2 = peekThroughBitcasts(N2->getOperand(0));
+    EVT InnerVT = InnerN1.getValueType();
----------------
Do we expect to have a bitcast-of-bitcast? These are folded to a single bitcast i think.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113202/new/

https://reviews.llvm.org/D113202



More information about the llvm-commits mailing list