diff options
author | Tim Shen <timshen91@gmail.com> | 2018-01-23 22:06:57 +0000 |
---|---|---|
committer | Tim Shen <timshen91@gmail.com> | 2018-01-23 22:06:57 +0000 |
commit | 7abe9887b0af5df201db93ce8ce97abafd0a363e (patch) | |
tree | 1b875a6c725b807abf9814e74a8b6cb4eb153016 /llvm/lib/Target | |
parent | c4ed9ed27677555e55a66e9b12e8b40bcc67df44 (diff) | |
download | bcm5719-llvm-7abe9887b0af5df201db93ce8ce97abafd0a363e.tar.gz bcm5719-llvm-7abe9887b0af5df201db93ce8ce97abafd0a363e.zip |
[PPC] Avoid incorrect fp-i128-fp lowering.
Summary:
Fix an issue that's similar to what D41411 fixed:
float(__int128(float_var)) shouldn't be optimized to xscvdpsxds +
xscvsxdsp, as they mean (float)(int64_t)float_var.
Reviewers: jtony, hfinkel, echristo
Subscribers: sanjoy, nemanjai, hiraditya, llvm-commits, kbarton
Differential Revision: https://reviews.llvm.org/D42400
llvm-svn: 323270
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 3c09ab8d755..2e99467499d 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -11948,10 +11948,12 @@ SDValue PPCTargetLowering::combineFPToIntToFP(SDNode *N, SDLoc dl(N); SDValue Op(N, 0); - // Don't handle ppc_fp128 here or i1 conversions. + // Don't handle ppc_fp128 here or conversions that are out-of-range capable + // from the hardware. if (Op.getValueType() != MVT::f32 && Op.getValueType() != MVT::f64) return SDValue(); - if (Op.getOperand(0).getValueType() == MVT::i1) + if (Op.getOperand(0).getValueType().getSimpleVT() <= MVT(MVT::i1) || + Op.getOperand(0).getValueType().getSimpleVT() > MVT(MVT::i64)) return SDValue(); SDValue FirstOperand(Op.getOperand(0)); |