diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-01-18 22:47:12 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-01-18 22:47:12 +0000 |
commit | a6a17d77d2d2f62de61fde0d565e35c06817db67 (patch) | |
tree | 70f70539a521a70d2ec5c0aa8cdbebd819ad253c /llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | |
parent | 96cf758d3a9574e67b829b286dba35bcc9ad7933 (diff) | |
download | bcm5719-llvm-a6a17d77d2d2f62de61fde0d565e35c06817db67.tar.gz bcm5719-llvm-a6a17d77d2d2f62de61fde0d565e35c06817db67.zip |
Don't refuse to transform constexpr(call(arg, ...)) to call(constexpr(arg), ...)) just because the function has multiple return values even if their return types are the same. Patch by Eduard Burtescu!
llvm-svn: 199564
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index 0cd7b149d42..c949720b1f5 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -994,11 +994,12 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { Type *OldRetTy = Caller->getType(); Type *NewRetTy = FT->getReturnType(); - if (NewRetTy->isStructTy()) - return false; // TODO: Handle multiple return values. - // Check to see if we are changing the return type... if (OldRetTy != NewRetTy) { + + if (NewRetTy->isStructTy()) + return false; // TODO: Handle multiple return values. + if (!CastInst::isBitCastable(NewRetTy, OldRetTy)) { if (Callee->isDeclaration()) return false; // Cannot transform this return value. |