diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2024-06-27 13:09:37 +0100 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2024-06-27 13:09:48 +0100 |
commit | 0f5fa3558eb36823c16ba81a4c6e6e23a5f9df24 (patch) | |
tree | 539d7d021951e2d8dd05d0bdfaa249febae5eb9c | |
parent | 4d167fb28b8c8b2e278fb09b1c435db6d6393d56 (diff) | |
download | llvm-0f5fa3558eb36823c16ba81a4c6e6e23a5f9df24.zip llvm-0f5fa3558eb36823c16ba81a4c6e6e23a5f9df24.tar.gz llvm-0f5fa3558eb36823c16ba81a4c6e6e23a5f9df24.tar.bz2 |
[X86] computeKnownBitsForPMADDWD - the final addition of the signextended multiplies is not guaranteed to be NSW
https://rust.godbolt.org/z/3f1bevnoT
https://alive2.llvm.org/ce/z/cjixBY
Noticed by @alexfh
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index d983c35..3bbf009 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -37158,7 +37158,7 @@ static void computeKnownBitsForPMADDWD(SDValue LHS, SDValue RHS, KnownBits RHSHi = DAG.computeKnownBits(RHS, DemandedHiElts, Depth + 1); KnownBits Lo = KnownBits::mul(LHSLo.sext(32), RHSLo.sext(32)); KnownBits Hi = KnownBits::mul(LHSHi.sext(32), RHSHi.sext(32)); - Known = KnownBits::computeForAddSub(/*Add=*/true, /*NSW=*/true, + Known = KnownBits::computeForAddSub(/*Add=*/true, /*NSW=*/false, /*NUW=*/false, Lo, Hi); } |