Make GEPs not suck so much:
authorBrian Gaeke <gaeke@uiuc.edu>
Sat, 11 Dec 2004 05:19:02 +0000 (05:19 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Sat, 11 Dec 2004 05:19:02 +0000 (05:19 +0000)
commit4f70b63ebcae70c8b875244f8976baa2097adcc2
treeda9a1f5a85c6e5fae9c93aee44759b1b75a8169e
parent9d6ffb47b4f4c8a51ed100a90af9488ce6cc0778
Make GEPs not suck so much:
* Don't emit the Index * ElementSize multiply if Index is a constant.
* Use a shift, not a multiply, if ElementSize is 1/2/4/8.
* If ElementSize fits in the immediate field of SMUL, then put it there.

Fix a bug where struct offsets might be truncated (ConstantSInt::get is
now used instead of ConstantInt::get).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18792 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Sparc/SparcV8ISelSimple.cpp
lib/Target/SparcV8/SparcV8ISelSimple.cpp