[PATCH] D44063: [InstCombine] Don't blow up in foldICmpWithCastAndCast on vector icmp instructions.

Daniel Neilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 5 08:28:25 PST 2018


dneilson added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:3411
   // integer type is the same size as the pointer type.
+  const auto& CompatibleSizes = [&](Type* SrcTy, Type* DestTy) -> bool {
+    if (isa<VectorType>(SrcTy)) {
----------------
anna wrote:
> Instead of capturing everything, let's capture just `DL`.
This is not capturing everything, it is only capturing the this pointer.

Per: http://en.cppreference.com/w/cpp/language/lambda

```
[&] captures all automatic variables **used in the body** of the lambda by reference and current object by reference if exists (emphasis mine).
```

There are no automatics used in the body of this lambda, so only the current object reference (i.e. the this pointer) is captured.

I could change [&] to [this] to make it more explicit, if desired...


Repository:
  rL LLVM

https://reviews.llvm.org/D44063





More information about the llvm-commits mailing list