[PATCH] D145223: [InstCombine] Combine binary operator of two phi node

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 19 08:03:19 PDT 2023


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1305
 
+  // Fold if there is at least one specific constant values in phi0 or phi1's
+  // incoming value that comes from the same block and this specific constant
----------------
values -> value


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1306
+  // Fold if there is at least one specific constant values in phi0 or phi1's
+  // incoming value that comes from the same block and this specific constant
+  // value can be used to do optimization for specific binary operator.
----------------
value -> values :)


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1321
+      auto &Phi1Use = std::get<1>(T);
+      if (Phi0->getIncomingBlock(Phi0Use) != Phi1->getIncomingBlock(Phi1Use)) {
+        return false;
----------------
Drop braces


================
Comment at: llvm/test/Transforms/InstCombine/phi.ll:1644
+
+define i32 @sub_two_phi_node_cannt_fold(i1 %c, i32 %i, i32 %j)  {
+; CHECK-LABEL: @sub_two_phi_node_cannt_fold(
----------------
cannt -> cant or cannot


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145223



More information about the llvm-commits mailing list