This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Fix memory folding of (v)roundsd / (v)roundss
ClosedPublic

Authored by RKSimon on Aug 8 2016, 11:09 AM.

Details

Summary

We only had partial memory folding support for the intrinsic definitions, and (as noted on PR27481) was causing FR32/FR64/VR128 mismatch errors with the machine verifier.

This patch adds missing memory folding support for both intrinsics and the ffloor/fnearbyint/fceil/frint/ftrunc patterns and in doing so fixes the failing machine verifier stack folding tests from PR27481.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 67203.Aug 8 2016, 11:09 AM
RKSimon retitled this revision from to [X86][SSE] Fix memory folding of (v)roundsd / (v)roundss.
RKSimon updated this object.
RKSimon added reviewers: qcolombet, craig.topper, spatel.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
qcolombet accepted this revision.Aug 8 2016, 5:25 PM
qcolombet edited edge metadata.

LGTM.

test/CodeGen/X86/stack-folding-fp-avx1.ll
1565 ↗(On Diff #67203)

Do you actually need to define something?
I mean wouldn’t the following work:
tail call void asm sideeffect "nop", "~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}”()

(I.e., get rid of =x and %1.)

On the other hand, I see this is consistent with the surrounding test cases, so that’s fine. I guess we could fix all of them in a separate patch if we want to.

This revision is now accepted and ready to land.Aug 8 2016, 5:25 PM
This revision was automatically updated to reflect the committed changes.

Thanks Quentin, I'll look at the stack folding asm inlines when I get the chance - I've been wanting to add more coverage for some other instructions any how.