Browse Source

LLVM: don't do anything for -OoUSELOADMODIFYSTORE

LLVM itself can do this itself already, and the FPC transformations
apparently don't respect the types so they generate invalid LLVM IR
Jonas Maebe 2 months ago
parent
commit
aa516f34d0
1 changed files with 8 additions and 0 deletions
  1. 8 0
      compiler/optloadmodifystore.pas

+ 8 - 0
compiler/optloadmodifystore.pas

@@ -52,10 +52,15 @@ unit optloadmodifystore;
       symdef;
       symdef;
 
 
     function try_opt_assignmentnode(assignmentnode: tassignmentnode): tnode;
     function try_opt_assignmentnode(assignmentnode: tassignmentnode): tnode;
+{$ifndef llvm}
       var
       var
         newinlinenodetype: tinlinenumber;
         newinlinenodetype: tinlinenumber;
+{$endif llvm}
       begin
       begin
         result:=nil;
         result:=nil;
+{$ifndef llvm}
+        foreachnodestatic(pm_postprocess,rootnode,@try_opt_node,nil);
+
         with assignmentnode do
         with assignmentnode do
           begin
           begin
             { *** Here are simple optimizations which are performed
             { *** Here are simple optimizations which are performed
@@ -626,6 +631,7 @@ unit optloadmodifystore;
               end;
               end;
 {$endif enable_sar_assign_x_y or enable_rox_assign_x_y}
 {$endif enable_sar_assign_x_y or enable_rox_assign_x_y}
           end;
           end;
+{$endif llvm}
       end;
       end;
 
 
     function try_opt_node(var n: tnode; arg: pointer): foreachnoderesult;
     function try_opt_node(var n: tnode; arg: pointer): foreachnoderesult;
@@ -649,7 +655,9 @@ unit optloadmodifystore;
 
 
     procedure do_optloadmodifystore(var rootnode : tnode);
     procedure do_optloadmodifystore(var rootnode : tnode);
       begin
       begin
+{$ifndef llvm}
         foreachnodestatic(pm_postprocess,rootnode,@try_opt_node,nil);
         foreachnodestatic(pm_postprocess,rootnode,@try_opt_node,nil);
+{$endif llvm}
       end;
       end;
 
 
 end.
 end.