[AMDGPU] Fix build failure, second attempt
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 13 Dec 2018 05:52:11 +0000 (05:52 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 13 Dec 2018 05:52:11 +0000 (05:52 +0000)
Some compilers complain that variable is captured and some
complain when it is not. Switch to [&].

llvm-svn: 349006

llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp

index 3ff32f8..c671fed 100644 (file)
@@ -199,7 +199,7 @@ static unsigned optimizeVcndVcmpPair(MachineBasicBlock &MBB,
        MRI.use_nodbg_empty(CmpReg)) ||
       (CmpReg == CondReg &&
        std::none_of(std::next(Cmp->getIterator()), Andn2->getIterator(),
-                    [TRI](const MachineInstr &MI) {
+                    [&](const MachineInstr &MI) {
                       return MI.readsRegister(CondReg, TRI); }))) {
     LLVM_DEBUG(dbgs() << "Erasing: " << *Cmp << '\n');