Xiaochu Liu via llvm-dev
2016-Aug-18 17:24 UTC
[llvm-dev] extract_vector_elt type mismatch?
Hi there, I'm trying to map extract_vector_elt use the following pattern in tbl file. Def : Pat <(i64 (extractelt v2i32:$src, 0)), (i64 (SRLIMM GPR:$src, 32))>; But the tblgen shows : Type inference contradiction found , forcing v2i32 to have a vector element of type i64 But the manual says this instruction allows return type to be larger than element type. Anyone can show me any pointers ? Thanks, Xiaochu -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160818/4314ceb7/attachment.html>
Matt Arsenault via llvm-dev
2016-Aug-18 17:46 UTC
[llvm-dev] extract_vector_elt type mismatch?
On 08/18/2016 10:24 AM, Xiaochu Liu via llvm-dev wrote:> > Hi there, > > I'm trying to map extract_vector_elt use the following pattern in tbl > file. > > Def : Pat <(i64 (extractelt v2i32:$src, 0)), (i64 (SRLIMM GPR:$src, 32))>; > > But the tblgen shows : > > Type inference contradiction found , forcing v2i32 to have a vector > element of type i64 > > But the manual says this instruction allows return type to be larger > than element type. > > Anyone can show me any pointers ? > > Thanks, > Xiaochu > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-devI think this is just intended as a quirk for some weird targets that have a legal vector type, but the scalar type itself is not legal, so it requires an implicit extension when extracting it. I don't think it's intended as something you can arbitrarily do for any vector type, and I wouldn't recommend trying to use it if you don't have to. This probably requires custom selector code -Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160818/a2233a66/attachment.html>
Tim Northover via llvm-dev
2016-Aug-18 17:57 UTC
[llvm-dev] extract_vector_elt type mismatch?
On 18 August 2016 at 10:24, Xiaochu Liu via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Def : Pat <(i64 (extractelt v2i32:$src, 0)), (i64 (SRLIMM GPR:$src, 32))>;For some reason EXTRACT_VECTOR_ELEMENT seems to have two TableGen defs. This should work with "vector_extract" instead of "extractelt" (despite the deprecation warning, which I don't really understand). Tim.
Tim Northover via llvm-dev
2016-Aug-18 18:01 UTC
[llvm-dev] extract_vector_elt type mismatch?
On 18 August 2016 at 10:46, Matt Arsenault via llvm-dev <llvm-dev at lists.llvm.org> wrote:> I think this is just intended as a quirk for some weird targets that have a > legal vector type, but the scalar type itself is not legal, so it requires > an implicit extension when extracting it.I think it's a pretty common RISC situation. I notice you deprecated the mismatching types in r255359, but I don't really see an alternative after type-legalization with the current nodes. I suppose we could add ISD::EXTRACT_SEXT_VECTOR_ELEMENT and ISD::EXTRACT_ZEXT_VECTOR_ELEMENT or something. Tim.
Apparently Analagous Threads
- extract_vector_elt type mismatch?
- Question on pattern matching extractelt
- [LLVMdev] Types inference in tblgen: Multiple exceptions
- [RFC][SDAG] Convert build_vector of ops on extractelts into ops on input vectors
- [LLVMdev] Types inference in tblgen: Multiple exceptions