aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LoopSimplify.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-11 23:21:26 +0000
committerChris Lattner <sabre@nondot.org>2004-04-11 23:21:26 +0000
commitfeac3e18aa861a4dd1ba0e0d6222805821b6bc1b (patch)
treee99f8686746486d1f2270c92cac321c0ee4955d1 /lib/Transforms/Utils/LoopSimplify.cpp
parentbb4d6c59c3bf3d0a5a8b8ac3f67f40e32e5d8b95 (diff)
On X86, casting an integer to floating point requires going through memory.
If the source of the cast is a load, we can just use the source memory location, without having to create a temporary stack slot entry. Before we code generated this: double %int(int* %P) { %V = load int* %P %V2 = cast int %V to double ret double %V2 } into: int: sub %ESP, 4 mov %EAX, DWORD PTR [%ESP + 8] mov %EAX, DWORD PTR [%EAX] mov DWORD PTR [%ESP], %EAX fild DWORD PTR [%ESP] add %ESP, 4 ret Now we produce this: int: mov %EAX, DWORD PTR [%ESP + 4] fild DWORD PTR [%EAX] ret ... which is nicer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LoopSimplify.cpp')
0 files changed, 0 insertions, 0 deletions