@@ -772,12 +772,13 @@ static auto generate_load_store_from_stack(
772772 auto *idx = builder.CreateAdd (sp, offset);
773773 auto *state_arg = get_current_state (*bb.getParent ());
774774 auto *stack_type = *std::next (state.element_begin (), reg_stats.size ());
775+ auto *const_zero = ConstantInt::get (ctx, APInt (32 , 0 ));
775776 auto *stack_addr = builder.CreateGEP (
776777 &state, state_arg,
777- ArrayRef<Value *>{ConstantInt::get (ctx, APInt ( 64 , reg_stats. size ()))});
778- auto *addr = builder. CreateInBoundsGEP (
779- stack_type, stack_addr,
780- ArrayRef<Value *>{ConstantInt::get (ctx, APInt ( 64 , 0 )) , idx});
778+ ArrayRef<Value *>{const_zero,
779+ ConstantInt::get (ctx, APInt ( 32 , reg_stats. size ()))});
780+ auto *addr = builder. CreateInBoundsGEP ( stack_type, stack_addr,
781+ ArrayRef<Value *>{const_zero , idx});
781782 auto *iinfo = target_machine.getMCInstrInfo ();
782783 auto name = get_instruction_name (minst, *iinfo);
783784 auto *m = bb.getParent ()->getParent ();
@@ -1174,7 +1175,6 @@ Module &bleach_module(Module &m, MachineModuleInfo &mmi,
11741175 for (auto &&[oldf, func_info] : funcs)
11751176 generate_function (*oldf, func_info, instrs, mmi, state, reg_stats,
11761177 assume_functions_nop);
1177- m.print (errs (), nullptr );
11781178 if (finfo) {
11791179 for (auto *func :
11801180 translated | views::filter ([](auto *f) { return !f->empty (); }))
0 commit comments