[llvm] [AMDGPU] Code clean up and denorm check removal for bf16 omod folding (PR #219042)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 03:10:33 PDT 2026


================
@@ -2505,8 +2505,9 @@ SIFoldOperandsImpl::isOMod(const MachineInstr &MI) const {
   }
   case AMDGPU::V_PK_MUL_BF16: {
     // OMOD folding for BF16 packed multiply
-    if (MFI->getMode().FP32Denormals.Output != DenormalMode::PreserveSign ||
-        MI.mayRaiseFPException())
+    // PK_*_BF16 ignores DENORM controls, and always preserves denorms
----------------
jayfoad wrote:

If PK_*_BF16 always preserves denorms, and OMOD always flushes them, then this whole optimization is incorrect. Unless you can somehow prove that there are no denormals involved or that we don't care about them being flushed.

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


More information about the llvm-commits mailing list