Commit e80f32f
authored
[CodeGenPrepare] Use Instruction::comesBefore instead of manual ordering (llvm#190485)
After llvm#172329, we noticed that some sources compiled with MSan take
1000x longer to compile. This is caused by quadratic complexity in
tryToSinkFreeOperands, which can be called on a significant number
of instructions within huge basic blocks.
This inefficiency was introduced in 9cfa9b4, which manually iterates
and creates a DenseMap of entire basic blocks for each interesting
instruction.
This patch avoids the manual ordering by using
Instruction::comesBefore(), which provides the exact same
ordering much more efficiently.1 parent 49093c4 commit e80f32f
1 file changed
+1
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7968 | 7968 | | |
7969 | 7969 | | |
7970 | 7970 | | |
7971 | | - | |
7972 | | - | |
7973 | | - | |
7974 | | - | |
7975 | | - | |
7976 | 7971 | | |
7977 | 7972 | | |
7978 | 7973 | | |
7979 | 7974 | | |
7980 | 7975 | | |
7981 | | - | |
| 7976 | + | |
7982 | 7977 | | |
7983 | 7978 | | |
7984 | 7979 | | |
| |||
0 commit comments