[PATCH] D92086: Generalized PatternMatch & InstSimplify
Simon Moll via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 26 00:32:30 PST 2020
simoll added inline comments.
================
Comment at: llvm/include/llvm/IR/Traits/Traits.h:182
+ return isa<const RegularCmpInst>(V) ||
+ cast<typename Trait::Intrinsic>->getFunctionalOpcode() == OPC;
+}
----------------
nhaehnle wrote:
> I'm confused: How does this work? Shouldn't there be an `isa<typename Trait::Intrinsic>(V)` check? Actually, how does this even compile? It seems like a (V) is missing on the cast.
Evidently this code is never instantiated or it would not compile.. i'll fix this.
================
Comment at: llvm/include/llvm/IR/Traits/Traits.h:243
+
+// TODO Implement other extended types.
+
----------------
nhaehnle wrote:
> Which ones do you have in mind?
I have no specific ext type in mind here. Generally speaking, it depends on the traits and the types they need to override. At the moment, we only define the Ext types required by the CFP and VP traits (and a few more that aren't instantiated..).
In a complete implementation for all foreseeable overrides, you'd need an "Ext" type for all types that are used in "PatternMatch.h". Eg, `ExtPossiblyExactOperator`,`ExtOverflowingBinaryOperator`, etc.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92086/new/
https://reviews.llvm.org/D92086
More information about the llvm-commits
mailing list