[LLVMdev] Optimizer to remove duplicate loads?

edA-qa mort-ora-y eda-qa at disemia.com
Sat Feb 23 21:48:46 PST 2013


Which optimizer would remove duplicate, or unneeded loads?  In my
generator I end up having a lot of the same load. For example here I
keep loading "@pt" which will always be the same value.

  %16 = load %1** @pt, align 8
  %17 = getelementptr inbounds %1* %16, i64 0, i32 2, i32 0
  %18 = load i32* %17, align 4
  call void @trace_integer(i32 %18)
  %19 = load %1** @pt, align 8
  %20 = getelementptr inbounds %1* %19, i64 0, i32 2, i32 1
  %21 = load i32* %20, align 4
  call void @trace_integer(i32 %21)
  %22 = load %1** @pt, align 8
  %23 = getelementptr inbounds %1* %22, i64 0, i32 0

-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130224/75f66349/attachment.sig>


More information about the llvm-dev mailing list