[PATCH] D71389: [ConstantFold][SVE] Fix constant folding for bitcast.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 12:17:31 PST 2019


efriedma added inline comments.


================
Comment at: llvm/lib/IR/ConstantFold.cpp:52
+  // compile-time.
+  if (DstTy->isScalable())
+    return nullptr;
----------------
huihuiz wrote:
> sdesmalen wrote:
> > Do we want to add support for a special case here for splat operations (like the one in the test)?
> Actually we can not, we will end up in scalable vector constant. 
> Instead of <4 x i32> <i32 1, i32 1, i32 1, i32 1>, we will need a form like "<vscale x 4 x i32> [?]"
> 
> I don't know how to express scalable vector constant in current upstream, please let me know if I get anything wrong?
I think the suggestion is to special-case the specific sequence of insertelement+splatvector+bitcast, and bitcast the operand of the insertelement.  Not sure how useful that would be in general, though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71389





More information about the llvm-commits mailing list