diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-10-18 00:22:02 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-10-18 00:22:02 +0000 |
commit | f6ee0d876ab7cf657ba4994e63436cf1d564770c (patch) | |
tree | 015e56ced808b5bda82bfec058b15c1d3f5b87b6 /test | |
parent | fee93865d687dc176e748698c58c87674c5c8af7 (diff) | |
download | external_llvm-f6ee0d876ab7cf657ba4994e63436cf1d564770c.zip external_llvm-f6ee0d876ab7cf657ba4994e63436cf1d564770c.tar.gz external_llvm-f6ee0d876ab7cf657ba4994e63436cf1d564770c.tar.bz2 |
Added several cases where a constant must be forwarded into a use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/select.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/select.ll b/test/select.ll index 58f9964..8a7348a 100644 --- a/test/select.ll +++ b/test/select.ll @@ -1,3 +1,5 @@ +%AConst = constant int 123 + implementation ; A SetCC whose result is used should produce instructions to @@ -37,6 +39,31 @@ Next: end + +; A constant argument to a cast used only once should be forward substituted +; and loaded where needed, which happens is: +; -- User of cast has no immediate field +; -- User of cast has immediate field but constant is too large to fit +; or constant is not resolved until later (e.g., global address) +; -- User of cast uses it as a call arg. or return value so it is an implicit +; use but has to be loaded into a virtual register so that the reg. +; allocator can allocate the appropriate phys. reg. for it +; +int* "castconst"(float) +begin + %castbig = cast ulong 99999999 to int + %castsmall = cast ulong 1 to int + %usebig = add int %castbig, %castsmall + + %castglob = cast int* %AConst to long* + %dummyl = load long* %castglob + + %castnull = cast ulong 0 to int* + ret int* %castnull +end + + + ; Test branch-on-comparison-with-zero, in two ways: ; 1. can be folded ; 2. cannot be folded because result of comparison is used twice |