In many cases, we expect a constant to be 32-bits or less. This simplifies range checking for x86 memory operand displacements (can only be 32-bit), or immediates in instructions (also 32-bit), since we only store 32-bits (so it trivially fits in 32-bits). Checks for whether a constant fits in 8-bits can be done on the 32-bit value instead of the 64-bit value. When TargetLowering sees a 64-bit immediate as an operand on a 64-bit instruction, it should have split the 64-bit immediate into a 32-bit loOperand(), and a 32-bit hiOperand(). So what's left for the Emit pass should be 32-bit constants. Other places which work with constants: - intrinsic operands (the ABI only allows i32 params for atomic mem order, or atomic is lock free byte-size, or the longjmp param). - addressing mode optimization (gep expansion should be working with i32 constants). - insertelement, and extractelement constant indices (bitcode reader restricts the type of the index to be i32 also). I guess now you may end up with multiple copies of what may be the "same" constant (i64 0 vs i32 0). BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/569033002
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| 64bit.pnacl.ll | Loading commit data... | |
| addr-opt-multi-def-var.ll | Loading commit data... | |
| address-mode-opt.ll | Loading commit data... | |
| align-spill-locations.ll | Loading commit data... | |
| alloc.ll | Loading commit data... | |
| arith-opt.ll | Loading commit data... | |
| arithmetic-chain.ll | Loading commit data... | |
| bitcast.ll | Loading commit data... | |
| bool-opt.ll | Loading commit data... | |
| branch-simple.ll | Loading commit data... | |
| call.ll | Loading commit data... | |
| callindirect.pnacl.ll | Loading commit data... | |
| casts.ll | Loading commit data... | |
| cmp-opt.ll | Loading commit data... | |
| convert.ll | Loading commit data... | |
| div_legalization.ll | Loading commit data... | |
| ebp_args.ll | Loading commit data... | |
| empty-func.ll | Loading commit data... | |
| fp.pnacl.ll | Loading commit data... | |
| fpcall.ll | Loading commit data... | |
| fpconst.pnacl.ll | Loading commit data... | |
| function_aligned.ll | Loading commit data... | |
| global.ll | Loading commit data... | |
| globalinit.pnacl.ll | Loading commit data... | |
| icmp-simple.ll | Loading commit data... | |
| load.ll | Loading commit data... | |
| mangle.ll | Loading commit data... | |
| nacl-atomic-cmpxchg-optimization.ll | Loading commit data... | |
| nacl-atomic-errors.ll | Loading commit data... | |
| nacl-atomic-fence-all.ll | Loading commit data... | |
| nacl-atomic-intrinsics.ll | Loading commit data... | |
| nacl-other-intrinsics.ll | Loading commit data... | |
| nop-insertion.ll | Loading commit data... | |
| phi.ll | Loading commit data... | |
| regalloc_evict_non_overlap.ll | Loading commit data... | |
| return-int-arg.ll | Loading commit data... | |
| returns_twice_no_coalesce.ll | Loading commit data... | |
| sdiv.ll | Loading commit data... | |
| select-opt.ll | Loading commit data... | |
| shift.ll | Loading commit data... | |
| simple-loop.ll | Loading commit data... | |
| store.ll | Loading commit data... | |
| struct-arith.pnacl.ll | Loading commit data... | |
| switch-opt.ll | Loading commit data... | |
| test_i1.ll | Loading commit data... | |
| undef.ll | Loading commit data... | |
| unnamed.ll | Loading commit data... | |
| unreachable.ll | Loading commit data... | |
| vector-arg.ll | Loading commit data... | |
| vector-arith.ll | Loading commit data... | |
| vector-bitcast.ll | Loading commit data... | |
| vector-cast.ll | Loading commit data... | |
| vector-fcmp.ll | Loading commit data... | |
| vector-icmp.ll | Loading commit data... | |
| vector-ops.ll | Loading commit data... | |
| vector-select.ll | Loading commit data... |