qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit a55dd6fc07b38599e012f664c90125838009134a
parent 4c855e3e125ff8bdf64b1970460e0d9fc2db52c1
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Mon,  7 Mar 2016 13:38:55 -0500

refine immediate reload test

We only need to load all the bits of a large
constant when it is used in long context.

Diffstat:
Mlisc/isel.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisc/isel.c b/lisc/isel.c @@ -81,7 +81,8 @@ noimm(Ref r, Fn *fn) { int64_t val; - assert(rtype(r) == RCon); + if (rtype(r) != RCon) + return 0; switch (fn->con[r.val].type) { default: diag("isel: invalid constant"); @@ -161,7 +162,7 @@ fixarg(Ref *r, int k, int phi, Fn *fn) sprintf(a.offset.label, ".Lfp%d", n); fn->mem[fn->nmem-1] = a; } - else if (!phi && rtype(r0) == RCon && noimm(r0, fn)) { + else if (!phi && k == Kl && noimm(r0, fn)) { /* load constants that do not fit in * a 32bit signed integer into a * long temporary