[llvm-commits] [llvm] r63731 - in /llvm/trunk: lib/VMCore/ConstantFold.cpp test/Transforms/InstCombine/2009-02-04-FPBitcast.ll
Duncan Sands
baldrick at free.fr
Wed Feb 4 03:17:15 PST 2009
Author: baldrick
Date: Wed Feb 4 05:17:06 2009
New Revision: 63731
URL: http://llvm.org/viewvc/llvm-project?rev=63731&view=rev
Log:
Allow the inverse transform x86_fp80 -> i80 (also
fires during the Ada build).
Modified:
llvm/trunk/lib/VMCore/ConstantFold.cpp
llvm/trunk/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll
Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=63731&r1=63730&r2=63731&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/ConstantFold.cpp (original)
+++ llvm/trunk/lib/VMCore/ConstantFold.cpp Wed Feb 4 05:17:06 2009
@@ -161,17 +161,12 @@
// Otherwise, can't fold this (vector?)
return 0;
}
-
+
// Handle ConstantFP input.
- if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) {
+ if (const ConstantFP *FP = dyn_cast<ConstantFP>(V))
// FP -> Integral.
- if (DestTy == Type::Int32Ty) {
- return ConstantInt::get(FP->getValueAPF().bitcastToAPInt());
- } else {
- assert(DestTy == Type::Int64Ty && "only support f32/f64 for now!");
- return ConstantInt::get(FP->getValueAPF().bitcastToAPInt());
- }
- }
+ return ConstantInt::get(FP->getValueAPF().bitcastToAPInt());
+
return 0;
}
Modified: llvm/trunk/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll?rev=63731&r1=63730&r2=63731&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll Wed Feb 4 05:17:06 2009
@@ -5,3 +5,8 @@
%tmp = bitcast i80 0 to x86_fp80 ; <x86_fp80> [#uses=1]
ret x86_fp80 %tmp
}
+
+define i80 @invcast() {
+ %tmp = bitcast x86_fp80 0xK00000000000000000000 to i80 ; <i80> [#uses=1]
+ ret i80 %tmp
+}
More information about the llvm-commits
mailing list