[PATCH] D24505: [mips][fastisel] Consider soft-float an unsupported floating point mode
Simon Dardis via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 27 14:57:43 PDT 2016
sdardis removed rL LLVM as the repository for this revision.
sdardis updated this revision to Diff 72714.
sdardis added a comment.
Address review comments.
https://reviews.llvm.org/D24505
Files:
lib/Target/Mips/MipsFastISel.cpp
test/CodeGen/Mips/Fast-ISel/fast-isel-softfloat-lower-args.ll
Index: test/CodeGen/Mips/Fast-ISel/fast-isel-softfloat-lower-args.ll
===================================================================
--- /dev/null
+++ test/CodeGen/Mips/Fast-ISel/fast-isel-softfloat-lower-args.ll
@@ -0,0 +1,11 @@
+; RUN: not llc -march=mipsel -mcpu=mips32r2 -mattr=+soft-float \
+; RUN: -O0 -fast-isel-abort=3 -relocation-model=pic < %s
+
+; Test that FastISel aborts instead of trying to lower arguments for soft-float.
+
+define void @__signbit(double %__x) {
+entry:
+ %__x.addr = alloca double, align 8
+ store double %__x, double* %__x.addr, align 8
+ ret void
+}
Index: lib/Target/Mips/MipsFastISel.cpp
===================================================================
--- lib/Target/Mips/MipsFastISel.cpp
+++ lib/Target/Mips/MipsFastISel.cpp
@@ -216,7 +216,7 @@
!Subtarget->inMicroMipsMode() && Subtarget->hasMips32();
TargetSupported =
ISASupported && TM.isPositionIndependent() && getABI().IsO32();
- UnsupportedFPMode = Subtarget->isFP64bit();
+ UnsupportedFPMode = Subtarget->isFP64bit() || Subtarget->useSoftFloat();
}
unsigned fastMaterializeAlloca(const AllocaInst *AI) override;
@@ -1365,6 +1365,10 @@
break;
case MVT::f32:
+ if (UnsupportedFPMode) {
+ DEBUG(dbgs() << ".. .. gave up (UnsupportedFPMode)\n");
+ return false;
+ }
if (NextFGR32 == FGR32ArgRegs.end()) {
DEBUG(dbgs() << ".. .. gave up (ran out of FGR32 arguments)\n");
return false;
@@ -1381,7 +1385,7 @@
case MVT::f64:
if (UnsupportedFPMode) {
- DEBUG(dbgs() << ".. .. gave up (UnsupportedFPMode\n");
+ DEBUG(dbgs() << ".. .. gave up (UnsupportedFPMode)\n");
return false;
}
if (NextAFGR64 == AFGR64ArgRegs.end()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24505.72714.patch
Type: text/x-patch
Size: 1797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160927/c0e87850/attachment.bin>
More information about the llvm-commits
mailing list