[llvm] 9782892 - [PatternMatch] add missing FP cast matchers; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 07:16:10 PDT 2020


Author: Sanjay Patel
Date: 2020-05-08T10:14:03-04:00
New Revision: 97828928eea41d329d00f77406dbc339d62c17c7

URL: https://github.com/llvm/llvm-project/commit/97828928eea41d329d00f77406dbc339d62c17c7
DIFF: https://github.com/llvm/llvm-project/commit/97828928eea41d329d00f77406dbc339d62c17c7.diff

LOG: [PatternMatch] add missing FP cast matchers; NFC

These are the obvious counterparts to the existing cast matchers.
Moving out of D79116 to reduce that patch.

Added: 
    

Modified: 
    llvm/include/llvm/IR/PatternMatch.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
index 0e22e2388572..c7ce2554ca95 100644
--- a/llvm/include/llvm/IR/PatternMatch.h
+++ b/llvm/include/llvm/IR/PatternMatch.h
@@ -1514,25 +1514,31 @@ m_ZExtOrSExtOrSelf(const OpTy &Op) {
   return m_CombineOr(m_ZExtOrSExt(Op), Op);
 }
 
-/// Matches UIToFP.
 template <typename OpTy>
 inline CastClass_match<OpTy, Instruction::UIToFP> m_UIToFP(const OpTy &Op) {
   return CastClass_match<OpTy, Instruction::UIToFP>(Op);
 }
 
-/// Matches SIToFP.
 template <typename OpTy>
 inline CastClass_match<OpTy, Instruction::SIToFP> m_SIToFP(const OpTy &Op) {
   return CastClass_match<OpTy, Instruction::SIToFP>(Op);
 }
 
-/// Matches FPTrunc
+template <typename OpTy>
+inline CastClass_match<OpTy, Instruction::FPToUI> m_FPToUI(const OpTy &Op) {
+  return CastClass_match<OpTy, Instruction::FPToUI>(Op);
+}
+
+template <typename OpTy>
+inline CastClass_match<OpTy, Instruction::FPToSI> m_FPToSI(const OpTy &Op) {
+  return CastClass_match<OpTy, Instruction::FPToSI>(Op);
+}
+
 template <typename OpTy>
 inline CastClass_match<OpTy, Instruction::FPTrunc> m_FPTrunc(const OpTy &Op) {
   return CastClass_match<OpTy, Instruction::FPTrunc>(Op);
 }
 
-/// Matches FPExt
 template <typename OpTy>
 inline CastClass_match<OpTy, Instruction::FPExt> m_FPExt(const OpTy &Op) {
   return CastClass_match<OpTy, Instruction::FPExt>(Op);


        


More information about the llvm-commits mailing list