llvm-project/llvm/test/Analysis/CostModel
Craig Topper d58c165545 [X86] Make v2i1 and v4i1 legal types without VLX
Summary:
There are few oddities that occur due to v1i1, v8i1, v16i1 being legal without v2i1 and v4i1 being legal when we don't have VLX. Particularly during legalization of v2i32/v4i32/v2i64/v4i64 masked gather/scatter/load/store. We end up promoting the mask argument to these during type legalization and then have to widen the promoted type to v8iX/v16iX and truncate it to get the element size back down to v8i1/v16i1 to use a 512-bit operation. Since need to fill the upper bits of the mask we have to fill with 0s at the promoted type.

It would be better if we could just have the v2i1/v4i1 types as legal so they don't undergo any promotion. Then we can just widen with 0s directly in a k register. There are no real v4i1/v2i1 instructions anyway. Everything is done on a larger register anyway.

This also fixes an issue that we couldn't implement a masked vextractf32x4 from zmm to xmm properly.

We now have to support widening more compares to 512-bit to get a mask result out so new tablegen patterns got added.

I had to hack the legalizer for widening the operand of a setcc a bit so it didn't try create a setcc returning v4i32, extract from it, then try to promote it using a sign extend to v2i1. Now we create the setcc with v4i1 if the original setcc's result type is v2i1. Then extract that and don't sign extend it at all.

There's definitely room for improvement with some follow up patches.

Reviewers: RKSimon, zvi, guyblank

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D41560

llvm-svn: 321967
2018-01-07 18:20:37 +00:00
..
AArch64 Revert r314923: "Recommit : Use the basic cost if a GEP is not used as addressing mode" 2017-10-13 14:04:21 +00:00
AMDGPU AMDGPU: Don't assert in TTI with fp32 denorms enabled 2017-08-31 05:47:00 +00:00
ARM Convert an APInt to int64_t properly in TTI::getGEPCost(). 2017-10-04 20:47:33 +00:00
PowerPC [PPC] Give unaligned memory access lower cost on processor that supports it 2017-02-17 22:29:39 +00:00
SystemZ [SystemZ] Add support for IBM z14 processor (2/3) 2017-07-17 17:42:48 +00:00
X86 [X86] Make v2i1 and v4i1 legal types without VLX 2018-01-07 18:20:37 +00:00
no_info.ll