[llvm] [InlineCost] Consider the default branch when calculating cost (PR #77856)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 22:52:22 PST 2024


================
@@ -3505,6 +3506,10 @@ class SwitchInst : public Instruction {
     return cast<BasicBlock>(getOperand(1));
   }
 
+  bool defaultDestIsUnreachable() const {
----------------
arsenm wrote:

Add documentation comment. I think the name is misleading too. The code isn't unreachable, and it only accepts empty blocks. How about something like defaultDestIsEmpty? defaultDestUndefined? 

https://github.com/llvm/llvm-project/pull/77856


More information about the llvm-commits mailing list