]> granicus.if.org Git - llvm/commitdiff
Fix narrowing issue from r353129
authorRichard Trieu <rtrieu@google.com>
Tue, 5 Feb 2019 02:26:03 +0000 (02:26 +0000)
committerRichard Trieu <rtrieu@google.com>
Tue, 5 Feb 2019 02:26:03 +0000 (02:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353134 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/SampleProfile.cpp

index 7483184662640ff8f802469c6b4c1a0bf0635ecc..0b880b1e431893938e973f5d64fc1d148f4f062f 100644 (file)
@@ -1328,7 +1328,8 @@ void SampleProfileLoader::propagateWeights(Function &F) {
                             SortedCallTargets.size());
         } else if (!dyn_cast<IntrinsicInst>(&I)) {
           I.setMetadata(LLVMContext::MD_prof,
-                        MDB.createBranchWeights({BlockWeights[BB]}));
+                        MDB.createBranchWeights(
+                            {static_cast<uint32_t>(BlockWeights[BB])}));
         }
       }
     }