Skip to content

Commit

Permalink
[TableGen] Remove a pointless check for iPTRAny
Browse files Browse the repository at this point in the history
We've already called EnforceInteger on Types[0], and iPTRAny isn't
regarded as an integer type (note that TableGen special-cases iPTR here
to include that, though), so we cannot possibly still have an iPTRAny by
this point. Delete the check, and let getFixedSizeInBits catch it along
with all the other overloaded types if that ever becomes false. Also
document why we have this check whilst here.

Reviewers: arsenm

Reviewed By: arsenm

Pull Request: #113732
  • Loading branch information
jrtc27 authored Oct 30, 2024
1 parent ef455e6 commit e8b7f53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,8 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
ValueTypeByHwMode VVT = TP.getInfer().getConcrete(Types[0], false);
for (auto &P : VVT) {
MVT::SimpleValueType VT = P.second.SimpleTy;
if (VT == MVT::iPTR || VT == MVT::iPTRAny)
// Can only check for types of a known size
if (VT == MVT::iPTR)
continue;
unsigned Size = MVT(VT).getFixedSizeInBits();
// Make sure that the value is representable for this type.
Expand Down

0 comments on commit e8b7f53

Please sign in to comment.