This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add avgr_u intrinsics and require nuw in patterns
ClosedPublic

Authored by tlively on Dec 17 2019, 9:59 PM.

Details

Summary

The vector pattern (a + b + 1) / 2 was previously selected to an
avgr_u instruction regardless of nuw flags, but this is incorrect in
the case where either addition may have an unsigned wrap. This CL
changes the existing pattern to require both adds to have nuw flags
and adds builtin functions and intrinsics for the avgr_u instructions
because the corrected pattern is not representable in C.

Diff Detail

Event Timeline

tlively created this revision.Dec 17 2019, 9:59 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 17 2019, 9:59 PM

Unit tests: pass. 60989 tests passed, 0 failed and 727 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

aheejin accepted this revision.Dec 18 2019, 3:02 PM
This revision is now accepted and ready to land.Dec 18 2019, 3:02 PM
This revision was automatically updated to reflect the committed changes.