[PATCH] D28744: [X86][AVX] Remove "OptForSize" condition from some memory foldings.

Ayman Musa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 06:30:21 PST 2017


aymanmus marked 4 inline comments as done.
aymanmus added inline comments.


================
Comment at: test/CodeGen/X86/avx-arith.ll:353
 ; CHECK:       ## BB#0:
-; CHECK-NEXT:    vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
-; CHECK-NEXT:    vsqrtss %xmm0, %xmm0, %xmm0
+; CHECK-NEXT:    vsqrtss (%rax), %xmm0, %xmm0
 ; CHECK-NEXT:    retq
----------------
craig.topper wrote:
> This now has a register read dependency on xmm0 which I believe is what the OptForSize was originally protecting against.  I know work has gone into ExeDepFix for UndefRegClearance. Do we believe that is sufficient to allow this folding now?
The OptForSize was incorrectly copied from the SSE version multiclass, where the memory form instructions performed a partial register updates (optimization guide states that partial updates come with a penalty and thus should be avoided).
I'm afraid I didn't understand how the memory folding adds read dependency on xmm0 in this case, the read dependency was already there.


https://reviews.llvm.org/D28744





More information about the llvm-commits mailing list