This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Add scalarization of ABS node.
ClosedPublic

Authored by ikulagin on Mar 19 2019, 11:59 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

ikulagin created this revision.Mar 19 2019, 11:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2019, 11:59 PM

Needs vector tests, to show that the issue is fixed.

Needs vector tests, to show that the issue is fixed.

Ok! What's the best way for test, unittest only for scalarization of vector ABS node or system test for code generation for every architecture?

Needs vector tests, to show that the issue is fixed.

Ok! What's the best way for test, unittest only for scalarization of vector ABS node or system test for code generation for every architecture?

$ find -iname *iabs*
./AArch64/iabs.ll
./ARM/iabs.ll
./PowerPC/iabs.ll
./Thumb/iabs.ll
./X86/viabs.ll
./X86/iabs.ll

Only the X86 has vector test coverage here.
At least copy ./X86/viabs.ll to those other arches.

The test case should be based around the PR41149 wasm code

PR41149 reduced to:

target triple = "wasm32-unknown--wasm"

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
}
ikulagin updated this revision to Diff 191635.Mar 20 2019, 11:09 PM

Add test case for PR41149

aheejin added inline comments.Mar 21 2019, 2:23 AM
llvm/test/CodeGen/WebAssembly/PR41149.ll
5 ↗(On Diff #191635)

We usually use "wasm32-unknown-unknown"

ikulagin marked 2 inline comments as done.Mar 21 2019, 2:31 AM
ikulagin added inline comments.
llvm/test/CodeGen/WebAssembly/PR41149.ll
5 ↗(On Diff #191635)

Ok.

ikulagin updated this revision to Diff 191648.Mar 21 2019, 2:33 AM
ikulagin marked an inline comment as done.
aheejin added inline comments.Mar 21 2019, 2:41 AM
llvm/test/CodeGen/WebAssembly/PR41149.ll
5 ↗(On Diff #191635)

Thanks, but no double dash between two unknowns

RKSimon accepted this revision.Mar 21 2019, 4:07 AM

LGTM - I'll tidyup the test case as @aheejin requested and add some basic checks

This revision is now accepted and ready to land.Mar 21 2019, 4:07 AM
This revision was automatically updated to reflect the committed changes.