[llvm] [DirectX] Legalize i8 allocas (PR #137399)

Finn Plummer via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 29 11:02:33 PDT 2025


================
@@ -81,16 +108,29 @@ static void fixI8TruncUseChain(Instruction &I,
     Value *NewInst =
         Builder.CreateBinOp(BO->getOpcode(), NewOperands[0], NewOperands[1]);
     if (auto *OBO = dyn_cast<OverflowingBinaryOperator>(&I)) {
-      if (OBO->hasNoSignedWrap())
-        cast<BinaryOperator>(NewInst)->setHasNoSignedWrap();
-      if (OBO->hasNoUnsignedWrap())
-        cast<BinaryOperator>(NewInst)->setHasNoUnsignedWrap();
+      auto *NewBO = dyn_cast<BinaryOperator>(NewInst);
----------------
inbelic wrote:

nit: Can this ever fail? Maybe we can just assert it? If it does fail should we be early exiting?

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


More information about the llvm-commits mailing list