[PATCH] D112004: [SystemZ] Improve codegen for memset

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 04:41:48 PST 2021


uweigand added a comment.

LGTM, just a few minor nits inline.  We also should do a performance validation run before committing this.



================
Comment at: llvm/lib/Target/SystemZ/SystemZISelLowering.cpp:7884
+  auto foldDisplIfNeeded = [&](MachineOperand &Base, uint64_t &Disp) -> void {
+    if (Disp > 0xfff) {
+      Register Reg = MRI.createVirtualRegister(&SystemZ::ADDR64BitRegClass);
----------------
Minor nit: this should use `!isUInt<12>(Disp)` like elsewhere.


================
Comment at: llvm/lib/Target/SystemZ/SystemZISelLowering.cpp:7983
 
+    bool HaveSingleBase = DestBase.isIdenticalTo(SrcBase);
     auto loadZeroAddress = [&]() -> MachineOperand {
----------------
Was this line moved deliberately?


================
Comment at: llvm/test/CodeGen/SystemZ/tail-call-mem-intrinsics.ll:12
-; CHECK-LABEL: tail_memset:
-; CHECK: jg memset
-define void @tail_memset(i8* nocapture %p, i8 %c, i32 %n) #0 {
----------------
Maybe we can still find a way to test emission of the call?   E.g. using a volatile pointer?


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

https://reviews.llvm.org/D112004



More information about the llvm-commits mailing list