[PATCH] D136456: [SelectionDAG] Clamp stack alignment for memset, memmove

Haohai, Wen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 23:38:03 PDT 2022


HaohaiWen added inline comments.


================
Comment at: llvm/test/CodeGen/X86/pr42064.ll:1
-; RUN: llc < %s -verify-machineinstrs -mtriple=x86_64-pc-windows-msvc19.11.0 -mattr=+avx,+cx16 | FileCheck %s
+; RUN: llc < %s -verify-machineinstrs -stackrealign -mtriple=x86_64-pc-windows-msvc19.11.0 -mattr=+avx,+cx16 | FileCheck %s
 
----------------
RKSimon wrote:
> Should we be running tests with/without -stackrealign do you think?
This is the first commit message. Looks like this tests want rbx to be used as frame pointer. Therefore we should only test -stackrealign.

```
    [X86] Defer the creation of LCMPXCHG16B_SAVE_RBX until finalize-isel

    We need to use LCMPXCHG16B_SAVE_RBX if RBX/EBX is being used as
    the frame pointer. We previously checked for this during type
    legalization, but that's too early to know for sure if the base
    pointer is needed.

    This patch adds a new pseudo instruction to emit from isel that
    uses a virtual register for the RBX input. Then we use the custom
    inserter hook to emit LCMPXCHG16B if RBX isn't needed as a base
    pointer or LCMPXCHG16B_SAVE_RBX if it is.

    Fixes PR42064.

    Reviewed By: pengfei

    Differential Revision: https://reviews.llvm.org/D88808

```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136456



More information about the llvm-commits mailing list