[PATCH] D134758: [RISCV][SelectionDAGBuilder] Fix crash when copying a v1f32 vector between basic blocks.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 03:54:07 PDT 2022


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

LGTM (with the description comment about how this can happen)



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:455
+    } else if (ValueSVT.isFloatingPoint() && PartEVT.isInteger()) {
+      EVT IntermediateType = EVT::getIntegerVT(*DAG.getContext(), ValueSize);
+      Val = DAG.getNode(ISD::TRUNCATE, DL, IntermediateType, Val);
----------------
craig.topper wrote:
> RKSimon wrote:
> > Is implicit truncation guaranteed?
> > 
> > A description comment might be useful.
> I think so. The only case I know of this happening right now is PartEVT is i64 and ValueSVT is f32.
Maybe use ValueSVT.changeTypeToInteger() ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134758



More information about the llvm-commits mailing list