Commit 53907ed
authored
[clang][codegen] Don't mark "int" TBAA on FP libcalls with indirect args (llvm#108853)
On some targets, an FP libcall with argument types such as long double
will be lowered to pass arguments indirectly via pointers. When this is
the case we should not mark the libcall with "int" TBAA as it may lead
to incorrect optimizations.
Currently, this can be seen for long doubles on x86_64-w64-mingw32. The
`load x86_fp80` after the call is (incorrectly) marked with "int" TBAA
(overwriting the previous metadata for "long double").
Nothing seems to break due to this currently as the metadata is being
incorrectly placed on the load and not the call. But if the metadata
is moved to the call (which this patch ensures), LLVM will optimize out
the setup for the arguments.1 parent d853ade commit 53907ed
File tree
4 files changed
+280
-6
lines changed- clang
- lib/CodeGen
- test/CodeGen
4 files changed
+280
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
690 | 706 | | |
691 | 707 | | |
692 | 708 | | |
693 | 709 | | |
| 710 | + | |
| 711 | + | |
694 | 712 | | |
695 | | - | |
| 713 | + | |
| 714 | + | |
696 | 715 | | |
697 | 716 | | |
698 | 717 | | |
| |||
702 | 721 | | |
703 | 722 | | |
704 | 723 | | |
705 | | - | |
| 724 | + | |
| 725 | + | |
706 | 726 | | |
707 | 727 | | |
708 | 728 | | |
709 | | - | |
710 | | - | |
| 729 | + | |
711 | 730 | | |
712 | 731 | | |
713 | 732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5932 | 5932 | | |
5933 | 5933 | | |
5934 | 5934 | | |
5935 | | - | |
| 5935 | + | |
| 5936 | + | |
5936 | 5937 | | |
5937 | 5938 | | |
5938 | 5939 | | |
| |||
6111 | 6112 | | |
6112 | 6113 | | |
6113 | 6114 | | |
| 6115 | + | |
| 6116 | + | |
| 6117 | + | |
6114 | 6118 | | |
6115 | 6119 | | |
6116 | 6120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4397 | 4397 | | |
4398 | 4398 | | |
4399 | 4399 | | |
4400 | | - | |
| 4400 | + | |
| 4401 | + | |
4401 | 4402 | | |
4402 | 4403 | | |
4403 | 4404 | | |
| |||
0 commit comments