[PATCH] D146798: [AggressiveInstCombine] use m_Deferred on funnel shift(NFC)
Kohei Asano via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 24 05:54:44 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcde1c3c01437: [AggressiveInstCombine] use m_Deferred on funnel shift(NFC) (authored by khei4).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146798/new/
https://reviews.llvm.org/D146798
Files:
llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
Index: llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
===================================================================
--- llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
+++ llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
@@ -65,7 +65,6 @@
// shift amount.
auto matchFunnelShift = [](Value *V, Value *&ShVal0, Value *&ShVal1,
Value *&ShAmt) {
- Value *SubAmt;
unsigned Width = V->getType()->getScalarSizeInBits();
// fshl(ShVal0, ShVal1, ShAmt)
@@ -73,8 +72,7 @@
if (match(V, m_OneUse(m_c_Or(
m_Shl(m_Value(ShVal0), m_Value(ShAmt)),
m_LShr(m_Value(ShVal1),
- m_Sub(m_SpecificInt(Width), m_Value(SubAmt))))))) {
- if (ShAmt == SubAmt) // TODO: Use m_Specific
+ m_Sub(m_SpecificInt(Width), m_Deferred(ShAmt))))))) {
return Intrinsic::fshl;
}
@@ -82,9 +80,8 @@
// == (ShVal0 >> ShAmt) | (ShVal1 << (Width - ShAmt))
if (match(V,
m_OneUse(m_c_Or(m_Shl(m_Value(ShVal0), m_Sub(m_SpecificInt(Width),
- m_Value(SubAmt))),
- m_LShr(m_Value(ShVal1), m_Value(ShAmt)))))) {
- if (ShAmt == SubAmt) // TODO: Use m_Specific
+ m_Value(ShAmt))),
+ m_LShr(m_Value(ShVal1), m_Deferred(ShAmt)))))) {
return Intrinsic::fshr;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146798.508063.patch
Type: text/x-patch
Size: 1566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230324/9c9c7307/attachment.bin>
More information about the llvm-commits
mailing list