[PATCH] D96013: GlobalISel: Try to combine G_[SU]DIV and G_[SU]REM

Christudasan Devadasan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 17:16:43 PST 2021


cdevadas added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1021
+      Opcode == TargetOpcode::G_SDIV || Opcode == TargetOpcode::G_SREM;
+  Builder.setInstrAndDebugLoc(MI);
+  Builder.buildInstr(IsSigned ? TargetOpcode::G_SDIVREM
----------------
arsenm wrote:
> I still suspect something is wrong with the insertion. I don't believe it's guaranteed that the first instruction you find will dominate the second, so you don't know where to place the insert point. 
The instructions are visited in the top-down order and `MI` will always dominate the `otherMI`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96013



More information about the llvm-commits mailing list