[llvm] 3c71253 - ConstraintElimination - pass const DataLayout by reference in (recursive) MergeResults lambda capture. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 03:20:36 PDT 2022


Author: Simon Pilgrim
Date: 2022-10-28T11:20:09+01:00
New Revision: 3c71253eb76b010501bc8fd170b6401c9b551987

URL: https://github.com/llvm/llvm-project/commit/3c71253eb76b010501bc8fd170b6401c9b551987
DIFF: https://github.com/llvm/llvm-project/commit/3c71253eb76b010501bc8fd170b6401c9b551987.diff

LOG: ConstraintElimination - pass const DataLayout by reference in (recursive) MergeResults lambda capture. NFC.

There's no need to copy this and fixes a coverity remark about large copy by value

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index 2e59557a08971..fc3b2481f57ec 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -302,8 +302,8 @@ decompose(Value *V, SmallVector<PreconditionTy, 4> &Preconditions,
           bool IsSigned, const DataLayout &DL) {
 
   auto MergeResults = [&Preconditions, IsSigned,
-                       DL](Value *A, Value *B,
-                           bool IsSignedB) -> SmallVector<DecompEntry, 4> {
+                       &DL](Value *A, Value *B,
+                            bool IsSignedB) -> SmallVector<DecompEntry, 4> {
     auto ResA = decompose(A, Preconditions, IsSigned, DL);
     auto ResB = decompose(B, Preconditions, IsSignedB, DL);
     if (ResA.empty() || ResB.empty())


        


More information about the llvm-commits mailing list