[llvm] [AArch64][Build Attributes] Remove wrong assertion (PR #127097)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 09:16:29 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-aarch64

Author: SivanShani-Arm (sivan-shani)

<details>
<summary>Changes</summary>

Adding an existing AArch64 Build Attributes value is legal. Asserting this case is wrong, it cause wrong behavior when assertions are enabled.

---
Full diff: https://github.com/llvm/llvm-project/pull/127097.diff


1 Files Affected:

- (modified) llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp (+2-6) 


``````````diff
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
index 1ed4a81a97673..cdad5c7de7853 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
@@ -222,13 +222,9 @@ void AArch64TargetStreamer::emitAttribute(StringRef VendorName, unsigned Tag,
                      "Can not add AArch64 build attribute: An attribute with "
                      "the same tag and a different value already exists");
               return;
-            } else {
-              // Case Item.IntValue == Value, no need to emit twice
-              assert(0 &&
-                     "AArch64 build attribute: An attribute with the same tag "
-                     "and a same value already exists");
-              return;
             }
+            // Case (Item.IntValue == Value) is legal.
+            return;
           }
         }
       }

``````````

</details>


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


More information about the llvm-commits mailing list