[PATCH] D120553: [DAG] SelectionDAG::isSplatValue - add initial BITCAST handling

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 07:51:51 PST 2022


RKSimon marked an inline comment as done.
RKSimon added a comment.

In D120553#3351199 <https://reviews.llvm.org/D120553#3351199>, @pengfei wrote:

> The IR in the tests neither shows bitcast nor small element vector. Are they generated during the lowering? Do we have specific tests for the patch?

We're mostly relying on type legalization to expose this, but I've added an explicit test case at rG70ab0a9b62206add0738833cb40ea47fe5f52700 <https://reviews.llvm.org/rG70ab0a9b62206add0738833cb40ea47fe5f52700>



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2652
+
+    if (BitWidth == SrcBitWidth)
+      return isSplatValue(Src, DemandedElts, UndefElts, Depth + 1);
----------------
pengfei wrote:
> Why do we need a bitcast if both `SrcVT` and `VT` are integer and have the same width? Don't `SrcVT == VT`?
This was actually superfluous.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120553



More information about the llvm-commits mailing list