[llvm] c0bebc1 - [DAG] visitREM - merge buildOptimizedSREM into if(). NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri May 6 07:47:28 PDT 2022
Author: Simon Pilgrim
Date: 2022-05-06T15:39:17+01:00
New Revision: c0bebc12f06c3d96ab5c18cbc0d61b22cdc90d89
URL: https://github.com/llvm/llvm-project/commit/c0bebc12f06c3d96ab5c18cbc0d61b22cdc90d89
DIFF: https://github.com/llvm/llvm-project/commit/c0bebc12f06c3d96ab5c18cbc0d61b22cdc90d89.diff
LOG: [DAG] visitREM - merge buildOptimizedSREM into if(). NFCI.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 711ead2e4357..a2fd45b48af7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -4579,10 +4579,10 @@ SDValue DAGCombiner::visitREM(SDNode *N) {
if (DAG.isKnownNeverZero(N1) && !TLI.isIntDivCheap(VT, Attr)) {
if (isSigned) {
// check if we can build faster implementation for srem
- SDValue OptimizedRem = buildOptimizedSREM(N0, N1, N);
- if (OptimizedRem.getNode())
+ if (SDValue OptimizedRem = buildOptimizedSREM(N0, N1, N))
return OptimizedRem;
}
+
SDValue OptimizedDiv =
isSigned ? visitSDIVLike(N0, N1, N) : visitUDIVLike(N0, N1, N);
if (OptimizedDiv.getNode() && OptimizedDiv.getNode() != N) {
More information about the llvm-commits
mailing list