[llvm] Fix APInt::concat for zero-width operands (PR #207475)

Yi Zhang via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 4 12:54:53 PDT 2026


================
@@ -952,6 +952,10 @@ class [[nodiscard]] APInt {
   /// equivalent to:
   ///   (this->zext(NewWidth) << NewLSB.getBitWidth()) | NewLSB.zext(NewWidth)
   APInt concat(const APInt &NewLSB) const {
+    if (getBitWidth() == 0)
----------------
cathyzhyi wrote:

Yes, the check below (NewLSB.getBitWidth() == 0) is just a fast path.

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


More information about the llvm-commits mailing list