[llvm] [DAG] Remove OneUse restriction when folding (shl (add x, c1), c2) (PR #101294)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 01:39:21 PDT 2024


================
@@ -1036,6 +1036,11 @@ bool AMDGPUTargetLowering::isDesirableToCommuteWithShift(
   assert((N->getOpcode() == ISD::SHL || N->getOpcode() == ISD::SRA ||
           N->getOpcode() == ISD::SRL) &&
          "Expected shift op");
+
+  // if (!N->getOperand(0).hasOneUse()) {
+  //   return false;
+  // }
+
----------------
arsenm wrote:

Commented out code 

https://github.com/llvm/llvm-project/pull/101294


More information about the llvm-commits mailing list