[llvm] [AMDGPU] Fix canonicalization of truncated values. (PR #83054)

Harald van Dijk via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 16:49:11 PST 2024


================
@@ -12416,7 +12416,7 @@ SDValue SITargetLowering::performRcpCombine(SDNode *N,
 }
 
 bool SITargetLowering::isCanonicalized(SelectionDAG &DAG, SDValue Op,
-                                       unsigned MaxDepth) const {
+                                       bool &Trunc, unsigned MaxDepth) const {
----------------
hvdijk wrote:

You're right, we can do that, it results in correct code, but that causes regressions where we are no longer able to figure out that we have an already canonicalised value and redundantly recanonicalise. I see that happen in the existing `clamp.ll`, `fmed3.ll`, `known-never-snan.ll`, `mad-mix-lo.ll`, and `minmax.ll` tests.

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


More information about the llvm-commits mailing list