Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate masked forms for sext8/sext16 #86

Open
jbush001 opened this issue Jul 2, 2017 · 0 comments
Open

Generate masked forms for sext8/sext16 #86

jbush001 opened this issue Jul 2, 2017 · 0 comments
Labels

Comments

@jbush001
Copy link
Owner

jbush001 commented Jul 2, 2017

In lib/Target/Nyuzi/NyuziInstrInfo.td, SEXT8VS, SEXT8VVM, SEXT8VSM, SEXT16VS, SEXT16VVM, an SEXT16VSM have their instruction matching patterns commented out, e.g.:

  def SEXT16VSM : FormatRMaskedOneOpInst<
    (outs VR512:$dest),
    (ins GPR32:$mask, GPR32:$src2, VR512:$oldvalue),
    "sext_16_mask $dest, $mask, $src2",
    [/*(set v16i32:$dest, (vselect v16i1:$mask, (sext_inreg (splat i32:$src2), i16),
      VR512:$oldvalue))*/],
    0x1e,
    FmtR_VVSM,
    II_INT>;

If the patterns are left in, TableGen complains with a type inference error:

SEXT16VSM: 	(set v16i32:<empty>:$dest, (vselect:{v16i1:v16i32:v16f32} v16i1:v16i1:$mask, (sext_inreg:{v16i1:v16i32} (splat:<empty> i32:<empty>:$src2), i16:Other), VR512:{v16i1:v16i32:v16f32}:$oldvalue))
Included from /Users/jeffbush/src/NyuziToolchain/lib/Target/Nyuzi/Nyuzi.td:23:
/Users/jeffbush/src/NyuziToolchain/lib/Target/Nyuzi/NyuziInstrInfo.td:136:3: error: In SEXT16VSM: Type inference contradiction found, '{v16i1:v16i32}' needs to be scalar
  def SEXT16VSM : FormatRMaskedOneOpInst<
  ^
Assertion failed: (isConcrete() && "Type isn't concrete yet"), function getConcrete, file /Users/jeffbush/src/NyuziToolchain/utils/TableGen/CodeGenDAGPatterns.h, line 74.

This doesn't break anything: when the patterns are commented out, LLVM just inserts an extra move instruction. Because this instruction occurs rarely, the performance impact is probably miniscule. But it would be good to understand why this is failing and fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant