[PATCH] D60580: [GlobalISel] Enable CSE in the IRTranslator & legalizer for -O0 with constants only

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 15:06:00 PDT 2019


aemerson marked 3 inline comments as done.
aemerson added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetPassConfig.cpp:1228
 bool TargetPassConfig::isGISelCSEEnabled() const {
-  return getOptLevel() != CodeGenOpt::Level::None;
+  return true;
 }
----------------
aditya_nandakumar wrote:
> Maybe we should add a hook so targets can return the appropriate CSEConfigs for the opt level instead of the core passes making this decision for them?
Given that we're only doing constants here, I'd like all targets to be consistent as much as possible.


================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/legalize-vaarg.mir:18
     ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
-    ; CHECK: [[GEP:%[0-9]+]]:_(p0) = G_GEP [[LOAD]], [[C]](s64)
+    ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[C]](s64)
+    ; CHECK: [[GEP:%[0-9]+]]:_(p0) = G_GEP [[LOAD]], [[COPY1]](s64)
----------------
aditya_nandakumar wrote:
> Did you look why these copies are generated?
This was a custom legalization, I'll fix it.


================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-addrspacecast.mir:307
     ; VI: [[C1:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
+    ; VI: [[COPY2:%[0-9]+]]:_(p0) = COPY [[C1]](p0)
     ; VI: [[EXTRACT:%[0-9]+]]:_(p3) = G_EXTRACT [[UV]](p0), 0
----------------
aditya_nandakumar wrote:
> Similar here.
Another custom legalization.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60580





More information about the llvm-commits mailing list