[llvm] r283918 - Allow Switch instruction to have extractProfTotalWeight called as it can terminate a basic block. (NFC)
Dehao Chen via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 11 11:53:00 PDT 2016
Author: dehao
Date: Tue Oct 11 13:53:00 2016
New Revision: 283918
URL: http://llvm.org/viewvc/llvm-project?rev=283918&view=rev
Log:
Allow Switch instruction to have extractProfTotalWeight called as it can terminate a basic block. (NFC)
Modified:
llvm/trunk/lib/IR/Metadata.cpp
Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=283918&r1=283917&r2=283918&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Tue Oct 11 13:53:00 2016
@@ -1298,7 +1298,8 @@ bool Instruction::extractProfTotalWeight
assert((getOpcode() == Instruction::Br ||
getOpcode() == Instruction::Select ||
getOpcode() == Instruction::Call ||
- getOpcode() == Instruction::Invoke) &&
+ getOpcode() == Instruction::Invoke ||
+ getOpcode() == Instruction::Switch) &&
"Looking for branch weights on something besides branch");
TotalVal = 0;
More information about the llvm-commits
mailing list