[PATCH] D71442: [X86] Check if source elements are not structures before using a uniform base for the Gather/Scatter intrinsic.

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 03:12:35 PST 2019


pengfei marked an inline comment as done.
pengfei added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:4387
+      C = C->getSplatValue();
+    auto *CI = dyn_cast_or_null<ConstantInt>(C);
+    assert(CI && "Index inside structure must be integer.");
----------------
xbolva00 wrote:
> just 'cast'?
> 
> CI must be nonnull anyway, otherwise your assert fires.
I wonder if there's a real case that index of a structure is not a constant? I guess not, but I'm not so sure. So I put an assert followed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71442





More information about the llvm-commits mailing list