This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Optimize out shift masks
ClosedPublic

Authored by tlively on Jul 7 2021, 4:57 PM.

Details

Summary

WebAssembly's shift instructions implicitly masks the shift count, so optimize
out redundant explicit masks of the shift count. For vector shifts, this
currently only works if the mask is applied before splatting the shift count,
but this should be addressed in a future commit. Resolves PR49655.

Diff Detail

Event Timeline

tlively created this revision.Jul 7 2021, 4:57 PM
tlively requested review of this revision.Jul 7 2021, 4:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2021, 4:57 PM
aheejin accepted this revision.Jul 7 2021, 10:02 PM
aheejin added inline comments.
llvm/test/CodeGen/WebAssembly/masked-shifts.ll
151

Are these _late functions yet to be optimized? If so How about adding TODO do make sure they are currently unoptimized?

This revision is now accepted and ready to land.Jul 7 2021, 10:02 PM
tlively added inline comments.Jul 7 2021, 11:06 PM
llvm/test/CodeGen/WebAssembly/masked-shifts.ll
151

Sounds good 👍

This revision was automatically updated to reflect the committed changes.