[PATCH] D53057: [WebAssembly] Handle undefined lane indices in SIMD patterns

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 10:50:19 PDT 2018


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

LGTM with a nit.



================
Comment at: lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1032
+      // Lower undefs to zero
+      uint64_t MaskVal = Mask[I] == -1 ? 0 : (uint64_t)Mask[I] * LaneBytes + J;
+      Ops[OpIdx++] = DAG.getConstant(MaskVal, DL, MVT::i32);
----------------
tlively wrote:
> tlively wrote:
> > aheejin wrote:
> > > aheejin wrote:
> > > > Why -1? Is it how `undef` is represented?
> > > I think `MaskVal` sounds confusing. It sounds like it is a mask value (such as 0xff). Can we change it to something else, like, just `Val` or something?
> > `ByteIndex` seemed like a nice descriptive name.
> Yes, that seems to be how `undef` is represented.
Then one-line comment stating that here -1 means undef would be helpful I think.


Repository:
  rL LLVM

https://reviews.llvm.org/D53057





More information about the llvm-commits mailing list