A codegen approach
Details
Diff Detail
Event Timeline
It's basically like my solution: Ensure that TempScopInfo generates write accesses and that BlockGenerators adds the PHIs to EscapeMap.
| lib/Analysis/TempScopInfo.cpp | ||
|---|---|---|
| 114 | What happens otherwise? | |
| 470 | if (!R.getExitingBlock()) | |
| lib/CodeGen/BlockGenerators.cpp | ||
| 495 | assert(!OperandPHI) | |
| 499 | assert(OperandPHI); | |
| 532 | Is this necessary? Can't one just use the original PHI to represent the virtual memory location? It's not directly used anyway. | |
| 543 | escape | |
| 1202 | The last 30 lines are repetative. Refactor? | |
I will push another version later.
The problematic part I encountered are PHI nodes that use values as operands. Here I tried to circumvent them by looking through the new PHI node in the exit and replacing it dynamically with the one that is now in the region [BlockGenerators.cpp:529]. However, I don't like this solution so I came up with a different one I will push here.
| lib/Analysis/TempScopInfo.cpp | ||
|---|---|---|
| 114 | The PHI operands are not modeled, hence never stored into the escape location. | |
| 470 | True. | |
| lib/CodeGen/BlockGenerators.cpp | ||
| 532 | I don't think so as it is linked via the escape map to the rewiring at the end. | |
| 1202 | That might be an idea for a different patch though. | |
- Remove trivial condition
- Allow values to cause memory accesses
- Allow PHI nodes in the region exit block
This patch fails only the pairalign lnt execution test.
@Meinersbur Does your patch pass that one? If so can you rebase your patch to the upstram I want to see the difference in the generated L__align11 function that is apperently wrong.
What happens otherwise?