[PATCH] D49182: [X86] Fix MayLoad/HasSideEffect flag for (V)MOVLPSrm instructions.

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 11 06:42:08 PDT 2018


andreadb created this revision.
andreadb added reviewers: craig.topper, RKSimon, uabelho, spatel.
Herald added a subscriber: gbedwell.

Before revision 336728, the "mayLoad" flag for instruction (V)MOVLPSrm was inferred directly from the "default" pattern associated with the instruction definition.

r336728 removed special node `X86Movlps`, and all the patterns associated to it. Now instruction (V)MOVLPSrm doesn't have a pattern associated to it, and the 'mayLoad/hasSideEffects' flags are left unset.

When the instruction info is emitted by tablegen, method CodeGenDAGPatterns::InferInstructionFlags(),  sees that (V)MOVLPSrm doesn't have a pattern associated to it, and flags are undefined. So, it conservatively sets the "hasSideEffects" flag for it.

As a consequence, we were losing the 'mayLoad' flag, and we were gaining a 'hasSideEffect' flag in its place.
This patch fixes the issue (originally reported by Michael). The mca tests show the differences in the instruction info flags.
Instructions affected by this problem are: MOVLPSrm/VMOVLPSrm/VMOVLPSZ128rm.

Please let me know if okay to commit

Thanks,
Andrea


https://reviews.llvm.org/D49182

Files:
  lib/Target/X86/X86InstrAVX512.td
  lib/Target/X86/X86InstrSSE.td
  test/tools/llvm-mca/X86/Atom/resources-sse1.s
  test/tools/llvm-mca/X86/Broadwell/resources-avx1.s
  test/tools/llvm-mca/X86/Broadwell/resources-sse1.s
  test/tools/llvm-mca/X86/BtVer2/resources-avx1.s
  test/tools/llvm-mca/X86/BtVer2/resources-sse1.s
  test/tools/llvm-mca/X86/Generic/resources-avx1.s
  test/tools/llvm-mca/X86/Generic/resources-sse1.s
  test/tools/llvm-mca/X86/Haswell/resources-avx1.s
  test/tools/llvm-mca/X86/Haswell/resources-sse1.s
  test/tools/llvm-mca/X86/SLM/resources-sse1.s
  test/tools/llvm-mca/X86/SandyBridge/resources-avx1.s
  test/tools/llvm-mca/X86/SandyBridge/resources-sse1.s
  test/tools/llvm-mca/X86/SkylakeClient/resources-avx1.s
  test/tools/llvm-mca/X86/SkylakeClient/resources-sse1.s
  test/tools/llvm-mca/X86/SkylakeServer/resources-avx1.s
  test/tools/llvm-mca/X86/SkylakeServer/resources-sse1.s
  test/tools/llvm-mca/X86/Znver1/resources-avx1.s
  test/tools/llvm-mca/X86/Znver1/resources-sse1.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49182.154986.patch
Type: text/x-patch
Size: 17522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180711/b9148d7a/attachment-0001.bin>


More information about the llvm-commits mailing list