[llvm] [AMDGPU] Account for inline asm size in inst_pref_size calculation (PR #192306)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 08:12:47 PDT 2026


================
@@ -477,6 +512,17 @@ static void targetOpKnownBitsMapHelper(const MCExpr *Expr, KnownBitsMap &KBM,
       KBM[Expr] = KnownBits::makeConstant(APValue);
       return;
     }
+    if (AGVK->getKind() == AMDGPUMCExpr::VariantKind::AGVK_InstPrefSize) {
+      // The result is clamped to (1 << FieldWidth) - 1, so upper bits are
+      // known zero. FieldWidth is derived from the subtarget.
+      if (const MCSubtargetInfo *STI = AGVK->getCtx().getSubtargetInfo()) {
----------------
arsenm wrote:

Remove the if and the assert 

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


More information about the llvm-commits mailing list