[llvm] dbc283b - [Hexagon] Handle 64-bit operands when lowering ADDO/SUBO
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 20 12:52:10 PDT 2023
Author: Krzysztof Parzyszek
Date: 2023-06-20T12:43:37-07:00
New Revision: dbc283bb9ec0392624458edf967c00877adb0bec
URL: https://github.com/llvm/llvm-project/commit/dbc283bb9ec0392624458edf967c00877adb0bec
DIFF: https://github.com/llvm/llvm-project/commit/dbc283bb9ec0392624458edf967c00877adb0bec.diff
LOG: [Hexagon] Handle 64-bit operands when lowering ADDO/SUBO
Added:
llvm/test/CodeGen/Hexagon/isel-uaddo-1-i64.ll
Modified:
llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
index d8068f018b667..db2d2eb9813c4 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
@@ -3252,7 +3252,7 @@ HexagonTargetLowering::LowerUAddSubO(SDValue Op, SelectionDAG &DAG) const {
unsigned Opc = Op.getOpcode();
if (CY) {
- uint32_t VY = CY->getZExtValue();
+ uint64_t VY = CY->getZExtValue();
assert(VY != 0 && "This should have been folded");
// X +/- 1
if (VY != 1)
diff --git a/llvm/test/CodeGen/Hexagon/isel-uaddo-1-i64.ll b/llvm/test/CodeGen/Hexagon/isel-uaddo-1-i64.ll
new file mode 100644
index 0000000000000..753fe9a255de6
--- /dev/null
+++ b/llvm/test/CodeGen/Hexagon/isel-uaddo-1-i64.ll
@@ -0,0 +1,14 @@
+; RUN: llc -march=hexagon < %s | FileCheck %s
+
+; Check that this doesn't crash.
+; CHECK: add{{.*}}:carry
+
+target triple = "hexagon-unknown-linux-gnu"
+
+define i64 @f0(i64 %a0, ptr %a1) {
+b0:
+ %v0 = add i64 -9223372036854775808, %a0
+ %v1 = icmp ugt i64 -9223372036854775808, %v0
+ store i1 %v1, ptr %a1, align 1
+ ret i64 %v0
+}
More information about the llvm-commits
mailing list