-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[TableGen] Remove a pointless check for iPTRAny #113732
[TableGen] Remove a pointless check for iPTRAny #113732
Conversation
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-tablegen Author: Jessica Clarke (jrtc27) ChangesWe've already called EnforceInteger on Types[0], and iPTRAny isn't Full diff: https://github.com/llvm/llvm-project/pull/113732.diff 1 Files Affected:
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.
|
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
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. Pull Request: llvm#113732
Created using spr 1.3.4
Created using spr 1.3.4 [skip ci]
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.