[llvm-commits] [llvm] r107114 - /llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp

Evan Cheng evan.cheng at apple.com
Mon Jun 28 22:00:34 PDT 2010


On Jun 28, 2010, at 6:13 PM, Jakob Stoklund Olesen wrote:

> Author: stoklund
> Date: Mon Jun 28 20:13:07 2010
> New Revision: 107114
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=107114&view=rev
> Log:
> When no memoperands are present, assume unaligned, volatile.

Have you checked if this disabled a lot of potential optimizations? I am afraid assuming volatileness is overly conservative.

Evan

> 
> Modified:
>    llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
> 
> Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=107114&r1=107113&r2=107114&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Mon Jun 28 20:13:07 2010
> @@ -788,18 +788,21 @@
> /// isMemoryOp - Returns true if instruction is a memory operations (that this
> /// pass is capable of operating on).
> static bool isMemoryOp(const MachineInstr *MI) {
> -  if (MI->hasOneMemOperand()) {
> -    const MachineMemOperand *MMO = *MI->memoperands_begin();
> +  // When no memory operands are present, conservatively assume unaligned,
> +  // volatile, unfoldable.
> +  if (!MI->hasOneMemOperand())
> +    return false;
> 
> -    // Don't touch volatile memory accesses - we may be changing their order.
> -    if (MMO->isVolatile())
> -      return false;
> +  const MachineMemOperand *MMO = *MI->memoperands_begin();
> 
> -    // Unaligned ldr/str is emulated by some kernels, but unaligned ldm/stm is
> -    // not.
> -    if (MMO->getAlignment() < 4)
> -      return false;
> -  }
> +  // Don't touch volatile memory accesses - we may be changing their order.
> +  if (MMO->isVolatile())
> +    return false;
> +
> +  // Unaligned ldr/str is emulated by some kernels, but unaligned ldm/stm is
> +  // not.
> +  if (MMO->getAlignment() < 4)
> +    return false;
> 
>   // str <undef> could probably be eliminated entirely, but for now we just want
>   // to avoid making a mess of it.
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list