ConstraintElimination - pass const DataLayout by reference in (recursive) MergeResult...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 28 Oct 2022 10:19:53 +0000 (11:19 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 28 Oct 2022 10:20:09 +0000 (11:20 +0100)
There's no need to copy this and fixes a coverity remark about large copy by value

llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

index 2e59557..fc3b248 100644 (file)
@@ -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())