This diff is for processing the critical edges generated from the switch statements. When there are more than 2 cases in the switch statement, a critical edge will form between the entry block and the epilog block. This critical edge is not taken care of by the machine-sink pass. Therefore we created this diff to make the split happen
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/lib/CodeGen/MachineBasicBlock.cpp | ||
---|---|---|
1067 | I thought we had the magic number 3 abstracted away already. This needs to be abstracted in the findIndirectJumpTable function as it is X86 specific! | |
1275–1278 | Why was the comment removed? | |
llvm/lib/Target/X86/X86InstrInfo.h | ||
332 | I thought this would return just the jump table for the particular instruction, but MachineJumpTableInfo is just the generic interface for all jumptables it seems. So we probably rather something like llvm::Optional<unsigned> to return the operand index with the JTI machine operand... |
I updated this diff to to no longer hardcode machine specific numbers in MachineBasicBlock::SplitCriticalEdge and update the X86 to support PIC and non-PIC jump table styles in D140975
I thought we had the magic number 3 abstracted away already. This needs to be abstracted in the findIndirectJumpTable function as it is X86 specific!