[PATCH] [ARM] Wrong t2STMIA size optimization in Thumb2SizeReduction

Tim Northover t.p.northover at gmail.com
Wed Sep 10 04:59:08 PDT 2014


Hi Sergey,

The code itself looks fine, but the test can be made much more robust, and simpler at the same time. It's always a good idea to keep some regalloc-bait handy!

    declare i8* @llvm.returnaddress(i32)

    define i32* @foo(i32* %addr, i32 %val0) minsize {
      store i32 %val0, i32* %addr

      %addr1 = getelementptr i32* %addr, i32 1
      %lr = call i8* @llvm.returnaddress(i32 0)
      %lr32 = ptrtoint i8* %lr to i32
      store i32 %lr32, i32* %addr1

      %addr2 = getelementptr i32* %addr1, i32 1
      ret i32* %addr2
   }

Cheers.

Tim.

http://reviews.llvm.org/D5290






More information about the llvm-commits mailing list