[llvm-branch-commits] [TableGen] Remove a pointless check for iPTRAny (PR #113732)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Oct 25 12:42:20 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-tablegen
Author: Jessica Clarke (jrtc27)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/113732.diff
1 Files Affected:
- (modified) llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp (+2-1)
``````````diff
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
index d2228c902a56b4..3446bfeb3e7e19 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
@@ -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.
``````````
</details>
https://github.com/llvm/llvm-project/pull/113732
More information about the llvm-branch-commits
mailing list