Commit ba7858c
committed
[CodeGen] [AMDGPU] Attempt DAGCombine for fmul with select to ldexp (llvm#111109)
The materialization cost of 32-bit non-inline in case of fmul is quite
relatively more, rather than if possible to combine it into ldexp
instruction for specific scenarios (for datatypes like f64, f32 and f16)
as this is being handled here :
The dag combine for any pair of select values which are exact exponent
of 2.
```
fmul x, select(y, A, B) -> ldexp (x, select i32 (y, a, b))
fmul x, select(y, -A, -B) -> ldexp ((fneg x), select i32 (y, a, b))
where, A=2^a & B=2^b ; a and b are integers.
```
This dagCombine is handled separately in fmulCombine (newly defined in
SIIselLowering), targeting fmul fusing it with select type operand into
ldexp.
Thus, it fixes llvm#104900.
Change-Id: I1e76049d8de218329efac4c62ee3c52cd824258c1 parent 5573625 commit ba7858c
File tree
14 files changed
+4237
-2943
lines changed- llvm
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
14 files changed
+4237
-2943
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| 916 | + | |
916 | 917 | | |
917 | 918 | | |
918 | 919 | | |
| |||
14729 | 14730 | | |
14730 | 14731 | | |
14731 | 14732 | | |
| 14733 | + | |
| 14734 | + | |
| 14735 | + | |
| 14736 | + | |
| 14737 | + | |
| 14738 | + | |
| 14739 | + | |
| 14740 | + | |
| 14741 | + | |
| 14742 | + | |
| 14743 | + | |
| 14744 | + | |
| 14745 | + | |
| 14746 | + | |
| 14747 | + | |
| 14748 | + | |
| 14749 | + | |
| 14750 | + | |
| 14751 | + | |
| 14752 | + | |
| 14753 | + | |
| 14754 | + | |
| 14755 | + | |
| 14756 | + | |
| 14757 | + | |
| 14758 | + | |
| 14759 | + | |
| 14760 | + | |
| 14761 | + | |
| 14762 | + | |
| 14763 | + | |
| 14764 | + | |
| 14765 | + | |
| 14766 | + | |
| 14767 | + | |
| 14768 | + | |
| 14769 | + | |
| 14770 | + | |
| 14771 | + | |
| 14772 | + | |
| 14773 | + | |
| 14774 | + | |
| 14775 | + | |
| 14776 | + | |
| 14777 | + | |
| 14778 | + | |
| 14779 | + | |
| 14780 | + | |
| 14781 | + | |
| 14782 | + | |
| 14783 | + | |
| 14784 | + | |
| 14785 | + | |
| 14786 | + | |
| 14787 | + | |
| 14788 | + | |
| 14789 | + | |
| 14790 | + | |
| 14791 | + | |
| 14792 | + | |
14732 | 14793 | | |
14733 | 14794 | | |
14734 | 14795 | | |
| |||
14994 | 15055 | | |
14995 | 15056 | | |
14996 | 15057 | | |
| 15058 | + | |
| 15059 | + | |
14997 | 15060 | | |
14998 | 15061 | | |
14999 | 15062 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| |||
0 commit comments