This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Custom lower i64x2 constant shifts to avoid wrap
ClosedPublic

Authored by tlively on Oct 13 2018, 10:33 PM.

Diff Detail

Event Timeline

tlively created this revision.Oct 13 2018, 10:33 PM
  • Why do we need to do this? If there is an i64 that's stored in an i32 register, shouldn't we have wrap in that case?
  • Some unrelated question: If the shift amount operand is not a splat vector, I think you said isel just crashes, right? Shouldn't we bail out to lower them in scalar operations?
aheejin added inline comments.Oct 17 2018, 12:06 PM
test/CodeGen/WebAssembly/simd-arith.ll
609

Are there also test cases for two shrs?

tlively updated this revision to Diff 170262.Oct 19 2018, 3:16 PM
  • Add missing tests
tlively marked an inline comment as done.Oct 19 2018, 3:16 PM
  • Why do we need to do this? If there is an i64 that's stored in an i32 register, shouldn't we have wrap in that case?

That wrap shouldn't be necessary if the i64 is a constant. This change just optimizes out such wraps.

  • Some unrelated question: If the shift amount operand is not a splat vector, I think you said isel just crashes, right? Shouldn't we bail out to lower them in scalar operations?

Yes, I have that in my list of things to do.

aheejin accepted this revision.Oct 19 2018, 5:01 PM
This revision is now accepted and ready to land.Oct 19 2018, 5:01 PM
This revision was automatically updated to reflect the committed changes.