Add eraseInstr(s) utility function. Before deleting an instruction
collects its use instructions. After deletion deletes use instructions
that became trivially dead.
This patch clears all dead instructions in existing legalizer mir tests.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/GlobalISel/Legalizer.cpp | ||
---|---|---|
187 | Is this observer call necessary? I thought deletions were automatically handled? |
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp | ||
---|---|---|
2827–2828 | Why does custom legalization need special casing? Why doesn't the observer get these too? |
The data from D109858 shows that this approach gives a measurable improvement in compile time, especially at -O0. LGTM.
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fcanonicalize.mir | ||
---|---|---|
5 | Did you mean to remove this line? Is codegen different for GFX9 and GFX10 now? |
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fcanonicalize.mir | ||
---|---|---|
5 | No, missed that. Basically when two lines share check prefix script(update_mir_test_checks) shuffles check blocks, so I run script without shared prefixes and then return # RUN: lines that share prefix. |
Is this observer call necessary? I thought deletions were automatically handled?