This is an archive of the discontinued LLVM Phabricator instance.

AVX-512: Fixed a bug, add not materializable instructions.
ClosedPublic

Authored by igorb on Oct 26 2015, 1:20 AM.

Details

Summary

Bug https://llvm.org/bugs/show_bug.cgi?id=25270

Add AVX-512 not materializable instructions.
Otherwise value can be reused , despite its value could be changed - produces incorrect assembler.

example

define void @bar__512(<16 x i32>* %var) {

%var_load_load = load <16 x i32>, <16 x i32>* %var, align 1
store <16 x i32> <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>, <16 x i32>* %var, align 64  
call void @Print__512(<16 x i32> %var_load_load)
call void @Print__512(<16 x i32> %var_load_load)  
store <16 x i32> <i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7>, <16 x i32>* %var, align 64
ret void

}

Befor the fix
movq %rdi, %rbx
vmovdqu32 (%rbx), %zmm0
vpbroadcastd .LCPI0_0(%rip), %zmm1
vmovdqa32 %zmm1, (%rbx) -- change value
callq Print512
vmovdqu32 (%rbx), %zmm0 -- incorrect , value has been changed ,
callq Print
512

After fix
movq %rdi, %rbx
vmovdqu32 (%rbx), %zmm0
vmovups %zmm0, (%rsp) # 64-byte Spill
vpbroadcastd .LCPI0_0(%rip), %zmm1
vmovdqa32 %zmm1, (%rbx)
callq Print512
vmovups (%rsp), %zmm0 # 64-byte Reload
callq Print
512

Diff Detail

Repository
rL LLVM

Event Timeline

igorb updated this revision to Diff 38377.Oct 26 2015, 1:20 AM
igorb retitled this revision from to AVX-512: Fixed a bug, add not materializable instructions..
igorb updated this object.
igorb added a reviewer: delena.
igorb set the repository for this revision to rL LLVM.
igorb added a subscriber: llvm-commits.
This revision was automatically updated to reflect the committed changes.