[PATCH] D128623: Pass code-model through Module IR to LLC

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 19:41:48 PDT 2022


shchenz added inline comments.


================
Comment at: llvm/include/llvm/Target/TargetMachine.h:226
   CodeModel::Model getCodeModel() const;
+  void setCodeModel(CodeModel::Model CM);
 
----------------
We may can implement this simple function in the header.


================
Comment at: llvm/test/tools/llc/codemodel.ll:2
+; REQUIRES: x86-registered-target
+; RUN: llc %s -o - | FileCheck %s --check-prefix=CHECK-LARGE
+
----------------
Can we add more cases? For example, changing the code model by using command option to verify:
1: the command option will override the IR input
2: different code models generate different instructions. (Not sure X86 will have different final assembly for below case for different code models, if no difference on X86, we can use some PPC target codes). With this we can verify that the code model in the IR is taken into account by the llc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128623



More information about the llvm-commits mailing list