[PATCH] D75203: Relax existing instructions to reduce the number of nops needed for alignment purposes

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 29 22:43:42 PST 2020


MaskRay added inline comments.


================
Comment at: llvm/lib/MC/MCAssembler.cpp:793
       dump(); });
 
+  optimizeLayout(Layout);
----------------
I suspect we may have to do `while (layoutOnce(Layout))` and `optimizeLayout(Layout)` in a lockstep.

`optimizeLayout` may cause some JCC_1/JMP_1 in MCRelaxableFragment to need relaxation.


================
Comment at: llvm/lib/MC/MCAssembler.cpp:794
 
+  optimizeLayout(Layout);
+
----------------
We can dump the layout only when something has changed. This requires a change to `optimizeLayout`'s return type.


================
Comment at: llvm/lib/MC/MCAssembler.cpp:1028
   return true;
+
 }
----------------
Unneeded


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75203/new/

https://reviews.llvm.org/D75203





More information about the llvm-commits mailing list