[PATCH] D99045: [x86] Improve selection of the mov instruction in FrameLowering

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 1 16:59:49 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FrameLowering.cpp:154
+  if (Is64Bit) {
+    if (isInt<32>(Imm))
+      return X86::MOV64ri32;
----------------
You also do

```
if (isUInt<32>(Imm))
  return MOV32ri64;
```

It's weirdly named but it's load a 32 bit immediate into the lower 32 bits and zero extend. Should avoid a REX prefix I think.


================
Comment at: llvm/lib/Target/X86/X86FrameLowering.cpp:157
+    return X86::MOV64ri;
+  } else {
+    return X86::MOV32ri;
----------------
You can drop this else since the if returned.


================
Comment at: llvm/test/CodeGen/X86/segmented-stacks-dynamic.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -verify-machineinstrs | FileCheck %s -check-prefix=X86
----------------
Can you pretend you pre-commited the test for the purposes of this diff so it's readable?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99045



More information about the llvm-commits mailing list