[PATCH] [SelectionDAG] Allow targets to specify legality of extloads' result type (in addition to the memory type)

Ahmed Bougacha ahmed.bougacha at gmail.com
Thu Dec 4 10:55:28 PST 2014


Hi chandlerc, grosbach, hfinkel,

The *LoadExt* legalization handling used to only have one type, the memory type.  This forced users to assume that as long as the extload for the memory type was declared legal, and the result type was legal, the whole extload was legal.

However, this isn't always the case. For instance, on X86, with AVX, this is legal:
     v4i32 load, zext from v4i8
but this isn't:
     v4i64 load, zext from v4i8
Whereas v4i64 is (arguably) legal, even without AVX2.

Keep in mind that this is a draft to give an idea, I mechanically changed the *LoadExt* calls in the generic and X86 parts.
I still need to change other in-tree targets, tell out-of-tree backend maintainers to change their code, and run the testsuite.

http://reviews.llvm.org/D6532

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/BasicTargetTransformInfo.cpp
  lib/CodeGen/CodeGenPrepare.cpp
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
  lib/Target/X86/X86ISelLowering.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6532.16936.patch
Type: text/x-patch
Size: 25666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141204/ce5e2d1a/attachment.bin>


More information about the llvm-commits mailing list