[PATCH] D64425: [RISCV] Fix ICE in isDesirableToCommuteWithShift
Sam Elliott via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 09:26:17 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL365511: [RISCV] Fix ICE in isDesirableToCommuteWithShift (authored by lenary, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D64425?vs=208713&id=208714#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64425/new/
https://reviews.llvm.org/D64425
Files:
llvm/trunk/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/trunk/test/CodeGen/RISCV/add-before-shl.ll
Index: llvm/trunk/test/CodeGen/RISCV/add-before-shl.ll
===================================================================
--- llvm/trunk/test/CodeGen/RISCV/add-before-shl.ll
+++ llvm/trunk/test/CodeGen/RISCV/add-before-shl.ll
@@ -72,3 +72,22 @@
%3 = ashr i32 %2, 16
ret i32 %3
}
+
+define signext i24 @add_non_machine_type(i24 signext %a) nounwind {
+; RV32I-LABEL: add_non_machine_type:
+; RV32I: # %bb.0:
+; RV32I-NEXT: addi a0, a0, 256
+; RV32I-NEXT: slli a0, a0, 20
+; RV32I-NEXT: srai a0, a0, 8
+; RV32I-NEXT: ret
+;
+; RV64I-LABEL: add_non_machine_type:
+; RV64I: # %bb.0:
+; RV64I-NEXT: addi a0, a0, 256
+; RV64I-NEXT: slli a0, a0, 52
+; RV64I-NEXT: srai a0, a0, 40
+; RV64I-NEXT: ret
+ %1 = add i24 %a, 256
+ %2 = shl i24 %1, 12
+ ret i24 %2
+}
Index: llvm/trunk/lib/Target/RISCV/RISCVISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/RISCV/RISCVISelLowering.cpp
+++ llvm/trunk/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -995,7 +995,7 @@
// (shl (add x, c1), c2) -> (add (shl x, c2), c1 << c2)
// (shl (or x, c1), c2) -> (or (shl x, c2), c1 << c2)
SDValue N0 = N->getOperand(0);
- MVT Ty = N0.getSimpleValueType();
+ EVT Ty = N0.getValueType();
if (Ty.isScalarInteger() &&
(N0.getOpcode() == ISD::ADD || N0.getOpcode() == ISD::OR)) {
auto *C1 = dyn_cast<ConstantSDNode>(N0->getOperand(1));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64425.208714.patch
Type: text/x-patch
Size: 1435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190709/f0d81ae3/attachment.bin>
More information about the llvm-commits
mailing list