Commit Graph

14 Commits

Author SHA1 Message Date
Pietro Fezzardi d237bc439e IRCanonicalization: switch to FunctionTags 2022-01-14 14:29:05 +01:00
Alessandro Di Federico 7a910eeb48 PromoteStackPointer: ignore CABIFunctionType 2022-01-09 14:14:03 +01:00
Alessandro Di Federico 24f5515842 Import passes of the new stack promotion pipeline 2021-12-17 14:01:00 +01:00
Alessandro Di Federico d733640143 Ensure functions begin with allocas only
Mixin `alloca`s with other instructions is malpractice.
2021-12-17 13:50:46 +01:00
Alessandro Di Federico f51808be24 Review PromoteStackPointerPass
* Adjust stack pointer upon returning from call.
  In architecture where the return address is pushed on the stack, on
  the caller side, we see the the push but not the pop. This means that,
  once the stack pointer is no longer global, we need to take this into
  account.
  This commit fixes this increase the stack pointer of
  `FinalStackOffset` right after a function call.
* Drop the size argument from the `revng_init_local_sp` function.  We
  will have a `revng_stack_frame` function to represent the actual stack
  frame pointing to its beginning.
2021-12-17 13:50:46 +01:00
Alessandro Di Federico 01e4fb7f88 Minor changes to PromoteStackPointerPass 2021-12-17 13:50:46 +01:00
Alessandro Di Federico 54e9a96a03 PromoteStackPointer: do not force stack alignment 2021-12-17 13:50:46 +01:00
Pietro Fezzardi 36e42855a5 PromoteStackPointer.cpp: fix deprecated include
This caused compilation error with llvm-12.
2021-05-27 17:14:25 +02:00
Pietro Fezzardi 36a525314a Detect isolated functions using FunctionTags 2021-04-27 21:19:06 +02:00
Pietro Fezzardi 52e29ccdbf PromoteStackPointer: do nothing with missing sp
The PromoteStackPointerPass now trivially handles running on modules
where the global variable for the stack pointer is missing.
When the global is not found, the pass just does nothing and returns
false.
This is necessary to handle very small functions, typically from tests.
2021-03-29 17:21:34 +02:00
Alessandro Di Federico 690e5fd9bd Update LoadModelPass usage 2021-03-16 12:01:15 +01:00
Pietro Fezzardi e95c21db25 Use Model to detect isolated functions 2021-02-23 10:39:05 +01:00
Pietro Fezzardi 148119c528 PromoteStackPointer: make local sp aligned 2021-02-09 15:07:04 +01:00
Pietro Fezzardi a31bdbd602 [DLA] Add PromoteStackPointerPass 2021-02-02 11:23:53 +01:00