Commit e21a34ac authored by Matthias Braun's avatar Matthias Braun
Browse files

ldstopt: refactor/cleanup, small improvements

Rework load memory chain walking:
- We keep the pointer as a base + offset representation all the time
- Reuse predict_load code from localopt for more accurate replacement of
  Loads from constant entities
- Support some more cases where load-after-load and load-after-store did
  not use the same mode but where we can easily get the value with some
  arithmetic.
parent 4648ec7e
......@@ -6544,11 +6544,7 @@ handle_tv:;
return NULL;
}
/* try to predict the value of a Load operation.
* This can usually be done if it loads from a known global entity with a
* constant value.
*/
static ir_node *predict_load(ir_node *ptr, ir_mode *mode)
ir_node *predict_load(ir_node *ptr, ir_mode *mode)
{
long offset = 0;
if (is_Add(ptr)) {
......
......@@ -126,6 +126,13 @@ bool ir_is_optimizable_mux(const ir_node *sel, const ir_node *mux_false,
*/
bool may_leave_out_middle_conv(ir_mode *m0, ir_mode *m1, ir_mode *m2);
/**
* Try to predict the value of a Load operation.
* This can usually be done if it loads from a known global entity with a
* constant value.
*/
ir_node *predict_load(ir_node *ptr, ir_mode *mode);
void ir_register_opt_node_ops(void);
#endif
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment