This change moves the actual stack pointer manipulation into the legalizer, available to targets via lower(). The codegen is slightly different because we're using explicit masks instead of G_PTRMASK, and using G_SUB rather than adding a negative amount via G_GEP.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
| llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
|---|---|---|
| 1795–1796 ↗ | (On Diff #216929) | SDNodeFlags? |
| 1798–1800 ↗ | (On Diff #216929) | buildAdd? |
| 1803 ↗ | (On Diff #216929) | Why not use PtrMask? |
| llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
|---|---|---|
| 1803 ↗ | (On Diff #216929) | Here's we're masking the allocation amount, which is an integer type, not a pointer, hence we can't use ptrmask. |
Comment Actions
One nit, inlined, other then that looks good.
| llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
|---|---|---|
| 3940 ↗ | (On Diff #216944) | uint64_t or int64_t instead of unsigned? |
| 3957 ↗ | (On Diff #216944) | Or use explicit APInt for -Align here just to be sure we make bitmask of appropriate size/value. |
| llvm/test/CodeGen/AArch64/GlobalISel/legalize-dyn-alloca.mir | ||
| 97 ↗ | (On Diff #216944) | This bitmask seems strange, it looks like zeroextended 32 bit value -32 to a 64 bit value. |
| llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
|---|---|---|
| 3957 ↗ | (On Diff #216944) | You're right, I'll fix this with APInt and commit. |