[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:21:29 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.");
----------------
pengfei wrote:
> 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.
>From LangRef "When indexing into a (optionally packed) structure, only i32 integer constants are allowed (when using a vector of indices they must all be the same i32 integer constant)."
I think I can remove the assert.


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