[PATCH] D52243: [ConstHoist]Do NOT rebase single-dependent of base constant

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 01:56:06 PDT 2018


dmgreen added a comment.

This does seem, from the tests I ran, to reduce codesize on average. Especially on Thumb1.



================
Comment at: lib/Transforms/Scalar/ConstantHoisting.cpp:873
+      if (ToBeRebased.size() < MinNumOfDependentToRebase) {
+        Base->eraseFromParent();
+        NotRebasedNum += ToBeRebased.size();
----------------
Can you change this around so we don't speculatively make the Base? That seems to be the way of doing things in LLVM.


================
Comment at: test/CodeGen/Thumb/consthoist-single-dependent.ll:1
+; RUN: llc %s -o - | FileCheck %s
+
----------------
Would these tests make more sense as opt tests? That way they can just test this specific pass, not the entire backend.


================
Comment at: test/CodeGen/Thumb/consthoist-single-dependent.ll:123
+
+attributes #0 = { nounwind optsize ssp "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="cortex-m0" "target-features"="+armv6-m,+strict-align,+thumb-mode,-crc,-dotprod,-dsp,-fp16fml,-hwdiv,-hwdiv-arm,-ras" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
----------------
Clean up tests please.


Repository:
  rL LLVM

https://reviews.llvm.org/D52243





More information about the llvm-commits mailing list