git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129677
91177308-0d34-0410-b5e6-
96231b3b80d8
// ImmLeaf is a pattern fragment with a constraint on the immediate. The
// constraint is a function that is run on the immediate (always with the value
-// sign extended out to an int64_t) as Imm. The value type being matched is
-// available as VT. For example:
+// sign extended out to an int64_t) as Imm. For example:
//
// def immSExt8 : ImmLeaf<i16, [{ return (char)Imm == Imm; }]>;
//
if (!ImmCode.empty()) {
std::string Result =
" int64_t Imm = cast<ConstantSDNode>(Node)->getSExtValue();\n";
- if (ImmCode.find("VT") != std::string::npos)
- Result += " MVT VT = Node->getValueType(0).getSimpleVT();\n";
return Result + ImmCode;
}