[llvm] [NFC] Format AllowReassoc_match to conform to LLVM style (PR #85946)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 20 08:52:12 PDT 2024
https://github.com/wallfIower updated https://github.com/llvm/llvm-project/pull/85946
>From f894d7d72a4bca081ee21e6a62c89f6b7815a235 Mon Sep 17 00:00:00 2001
From: LL <164206863+wallfIower at users.noreply.github.com>
Date: Wed, 20 Mar 2024 15:25:52 +0000
Subject: [PATCH 1/2] [NFC] Format AllowReassoc_match to conform to LLVM style
---
llvm/include/llvm/IR/PatternMatch.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
index 382009d9df785d..c856f69fff9c13 100644
--- a/llvm/include/llvm/IR/PatternMatch.h
+++ b/llvm/include/llvm/IR/PatternMatch.h
@@ -68,12 +68,14 @@ template <typename T> inline OneUse_match<T> m_OneUse(const T &SubPattern) {
return SubPattern;
}
-template <typename SubPattern_t> struct AllowReassoc_match {
+template <typename SubPattern_t>
+struct AllowReassoc_match {
SubPattern_t SubPattern;
AllowReassoc_match(const SubPattern_t &SP) : SubPattern(SP) {}
- template <typename OpTy> bool match(OpTy *V) {
+ template <typename OpTy>
+ bool match(OpTy *V) {
auto *I = dyn_cast<FPMathOperator>(V);
return I && I->hasAllowReassoc() && SubPattern.match(I);
}
>From ce5953f00a31d4e12317dc3186a0c6a8d9266775 Mon Sep 17 00:00:00 2001
From: LL <LL at cock.pm>
Date: Wed, 20 Mar 2024 15:52:05 +0000
Subject: [PATCH 2/2] Update PatternMatch.h
---
llvm/include/llvm/IR/PatternMatch.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
index c856f69fff9c13..c2a99330159bcb 100644
--- a/llvm/include/llvm/IR/PatternMatch.h
+++ b/llvm/include/llvm/IR/PatternMatch.h
@@ -68,14 +68,16 @@ template <typename T> inline OneUse_match<T> m_OneUse(const T &SubPattern) {
return SubPattern;
}
-template <typename SubPattern_t>
-struct AllowReassoc_match {
+template <typename T> inline OneUse_match<T> m_OneUse(const T &SubPattern) {
+ return SubPattern;
+}
+
+template <typename SubPattern_t> struct AllowReassoc_match {
SubPattern_t SubPattern;
AllowReassoc_match(const SubPattern_t &SP) : SubPattern(SP) {}
- template <typename OpTy>
- bool match(OpTy *V) {
+ template <typename OpTy> bool match(OpTy *V) {
auto *I = dyn_cast<FPMathOperator>(V);
return I && I->hasAllowReassoc() && SubPattern.match(I);
}
More information about the llvm-commits
mailing list