[PATCH] D59577: [SelectionDAG] Add scalarization of ABS node.

Ivan Kulagin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 02:34:35 PDT 2019


ikulagin updated this revision to Diff 191648.
ikulagin marked an inline comment as done.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59577

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
  llvm/test/CodeGen/WebAssembly/PR41149.ll


Index: llvm/test/CodeGen/WebAssembly/PR41149.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/WebAssembly/PR41149.ll
@@ -0,0 +1,15 @@
+; RUN: llc < %s
+
+; Regression test for PR41149.
+
+target triple = "wasm32-unknown--unknown"
+
+define void @mod() {
+entry:
+  %tmp = load <4 x i8>, <4 x i8>* undef
+  %tmp2 = icmp slt <4 x i8> %tmp, zeroinitializer
+  %tmp3 = sub <4 x i8> zeroinitializer, %tmp
+  %tmp4 = select <4 x i1> %tmp2, <4 x i8> %tmp3, <4 x i8> %tmp
+  store <4 x i8> %tmp4, <4 x i8>* undef
+  ret void
+}
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -68,6 +68,7 @@
   case ISD::ZERO_EXTEND_VECTOR_INREG:
     R = ScalarizeVecRes_VecInregOp(N);
     break;
+  case ISD::ABS:
   case ISD::ANY_EXTEND:
   case ISD::BITREVERSE:
   case ISD::BSWAP:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59577.191648.patch
Type: text/x-patch
Size: 1020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190321/049b7c19/attachment.bin>


More information about the llvm-commits mailing list