[PATCH] D88773: Reland "[WebAssembly] Emulate v128.const efficiently""
    Dan Weber via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sat Oct  3 14:17:27 PDT 2020
    
    
  
dweber added a comment.
Fix for the integer check.  Proposal for a better, documented alternative solution.
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1584
     };
-  }
-  if (!Result) {
+  } else if (NumConstantLanes >= NumSplatLanes && VecT.isInteger()) {
+    // Otherwise, if this is an integer vector, pack the lane values together so
----------------
dweber wrote:
> @tlively this is a real edge case, but I think you need to verify that the integer type is a representable native integer type. If APInt causes VecT.isInteger() to return true, you'll have a colossal headache with supporting integers that are 27 bits. 
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1589-1602
+    std::array<uint64_t, 2> I64s{{0, 0}};
+    std::array<uint64_t, 2> ConstLaneMasks{{0, 0}};
+    size_t LaneBits = 128 / Lanes;
+    size_t HalfLanes = Lanes / 2;
+    for (size_t I = 0; I < Lanes; ++I) {
+      const SDValue &Lane = Op.getOperand(I);
+      if (IsConstant(Lane)) {
----------------
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88773/new/
https://reviews.llvm.org/D88773
    
    
More information about the llvm-commits
mailing list