[PATCH] D57377: [CGP] Add support for sinking operands to their users, if they are free.

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 01:35:20 PST 2019


samparker added a comment.

Hi Florian,

I've had a case where I have wanted to do this, so it looks useful to me! CGP seems like a reasonable place to perform this too and I think TargetLowering is an aptly named place to include the hook.

cheers,



================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:5984
+
+  // OpsToSink can contain multiple uses in a use chain (e.g.
+  // (%u1 with %u1 = shufflevector), (%u2 with %u2 = zext %u1)). The dominating
----------------
Is this order of ops enforced?


================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:5991
+  bool Changed = false;
+  SmallVector<Use *, 8> ToReplace;
+  for (Use *U : OpsToSink) {
----------------
This doesn't need to larger than OpsToSink, same goes for MaybeDead.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:8292
+  auto areTypesHalfed = [](Value *FullV, Value *HalfV) {
+    auto *FullVT = dyn_cast<VectorType>(FullV->getType());
+    auto *HalfVT = dyn_cast<VectorType>(HalfV->getType());
----------------
I'm assuming cast is all you need, otherwise you're missing a nullptr check.


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

https://reviews.llvm.org/D57377





More information about the llvm-commits mailing list