This is an archive of the discontinued LLVM Phabricator instance.

[X86-64] Fix 256-bit SET0 lowering for non-VLX targets
ClosedPublic

Authored by greened on May 24 2019, 11:35 AM.

Details

Summary

If we don't have VLX then 256-bit SET0 should be lowered to VPXOR with ZMM registers. This restores functionality accidentally removed by r309926.

Diff Detail

Event Timeline

greened created this revision.May 24 2019, 11:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2019, 11:35 AM

Oops, needs a testcase. Will add.

greened updated this revision to Diff 201468.May 26 2019, 2:26 PM

Added testcase.

This revision is now accepted and ready to land.May 26 2019, 10:14 PM
This revision was automatically updated to reflect the committed changes.

@greened This is causing EXPENSIVE_CHECKS buildbot failures - can you fix or shall I revert for now?

$ ":" "RUN: at line 4"
$ "e:\llvm\ninja\bin\llc.exe" "-mtriple=x86_64--" "-mattr=+avx512f" "-o" "-" "E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir"
# command stderr:

# After Instruction Selection
# Machine code for function main: IsSSA, NoPHIs, TracksLiveness, NoVRegs

bb.0.bb0:
  renamable $ymm16 = AVX512_256_SET0
  VMOVAPSZmr $rip, 1, $noreg, @tst_, $noreg, killed renamable $zmm16 :: (store 32 into %ir.lsr.iv1, align 64)
  RET 0

bb.1.bb0:
  %0:vr256 = AVX512_256_SET0
  VMOVAPSYmr $rip, 1, $noreg, @tst_, $noreg, killed %0:vr256 :: (store 32 into %ir.lsr.iv1, align 64)
  RET 0

# End machine code for function main.

*** Bad machine code: Function has NoVRegs property but there are VReg operands ***
- function:    main
LLVM ERROR: Found 1 machine code errors.
Stack dump:
0.      Program arguments: e:\llvm\ninja\bin\llc.exe -mtriple=x86_64-- -mattr=+avx512f -o - E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir
1.      Running pass 'Function Pass Manager' on module 'E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir'.
2.      Running pass 'Verify generated machine code' on function '@main'

@greened This is causing EXPENSIVE_CHECKS buildbot failures - can you fix or shall I revert for now?

$ ":" "RUN: at line 4"
$ "e:\llvm\ninja\bin\llc.exe" "-mtriple=x86_64--" "-mattr=+avx512f" "-o" "-" "E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir"
# command stderr:

# After Instruction Selection
# Machine code for function main: IsSSA, NoPHIs, TracksLiveness, NoVRegs

bb.0.bb0:
  renamable $ymm16 = AVX512_256_SET0
  VMOVAPSZmr $rip, 1, $noreg, @tst_, $noreg, killed renamable $zmm16 :: (store 32 into %ir.lsr.iv1, align 64)
  RET 0

bb.1.bb0:
  %0:vr256 = AVX512_256_SET0
  VMOVAPSYmr $rip, 1, $noreg, @tst_, $noreg, killed %0:vr256 :: (store 32 into %ir.lsr.iv1, align 64)
  RET 0

# End machine code for function main.

*** Bad machine code: Function has NoVRegs property but there are VReg operands ***
- function:    main
LLVM ERROR: Found 1 machine code errors.
Stack dump:
0.      Program arguments: e:\llvm\ninja\bin\llc.exe -mtriple=x86_64-- -mattr=+avx512f -o - E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir
1.      Running pass 'Function Pass Manager' on module 'E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir'.
2.      Running pass 'Verify generated machine code' on function '@main'

I'm working on a fix for this.

@greened This is causing EXPENSIVE_CHECKS buildbot failures - can you fix or shall I revert for now?

$ ":" "RUN: at line 4"
$ "e:\llvm\ninja\bin\llc.exe" "-mtriple=x86_64--" "-mattr=+avx512f" "-o" "-" "E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir"
# command stderr:

# After Instruction Selection
# Machine code for function main: IsSSA, NoPHIs, TracksLiveness, NoVRegs

bb.0.bb0:
  renamable $ymm16 = AVX512_256_SET0
  VMOVAPSZmr $rip, 1, $noreg, @tst_, $noreg, killed renamable $zmm16 :: (store 32 into %ir.lsr.iv1, align 64)
  RET 0

bb.1.bb0:
  %0:vr256 = AVX512_256_SET0
  VMOVAPSYmr $rip, 1, $noreg, @tst_, $noreg, killed %0:vr256 :: (store 32 into %ir.lsr.iv1, align 64)
  RET 0

# End machine code for function main.

*** Bad machine code: Function has NoVRegs property but there are VReg operands ***
- function:    main
LLVM ERROR: Found 1 machine code errors.
Stack dump:
0.      Program arguments: e:\llvm\ninja\bin\llc.exe -mtriple=x86_64-- -mattr=+avx512f -o - E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir
1.      Running pass 'Function Pass Manager' on module 'E:\llvm\llvm\test\CodeGen\X86\avx512f-256-set0.mir'.
2.      Running pass 'Verify generated machine code' on function '@main'

I'm working on a fix for this.

Should be fixed after r361991

Should be fixed after r361991

Cheers guys