[llvm-commits] [llvm] r96226 - in /llvm/trunk: include/llvm/CodeGen/MachineMemOperand.h lib/CodeGen/MachineInstr.cpp

Daniel Dunbar daniel at zuster.org
Mon Feb 15 09:13:12 PST 2010


As a friendly reminder, for those using git and friends, please do not
use the ability to batch commits as an excuse not to build and test
every individual commit. Doing so breaks important things like the
buildbots and the ability to easily bisect or test every revision.

 - Daniel

On Mon, Feb 15, 2010 at 8:48 AM, David Greene <greened at obbligato.org> wrote:
> Author: greened
> Date: Mon Feb 15 10:48:31 2010
> New Revision: 96226
>
> URL: http://llvm.org/viewvc/llvm-project?rev=96226&view=rev
> Log:
>
> Add non-temporal flags to MachineMemOperand.
>
> Modified:
>    llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h
>    llvm/trunk/lib/CodeGen/MachineInstr.cpp
>
> Modified: llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h?rev=96226&r1=96225&r2=96226&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h Mon Feb 15 10:48:31 2010
> @@ -46,7 +46,11 @@
>     /// The memory access writes data.
>     MOStore = 2,
>     /// The memory access is volatile.
> -    MOVolatile = 4
> +    MOVolatile = 4,
> +    /// The memory access is non-temporal.
> +    MONonTemporal = 8,
> +    // This is the number of bits we need to represent flags.
> +    MOMaxBits = 4
>   };
>
>   /// MachineMemOperand - Construct an MachineMemOperand object with the
> @@ -64,7 +68,7 @@
>   const Value *getValue() const { return V; }
>
>   /// getFlags - Return the raw flags of the source value, \see MemOperandFlags.
> -  unsigned int getFlags() const { return Flags & 7; }
> +  unsigned int getFlags() const { return Flags & ((1 << MOMaxBits) - 1); }
>
>   /// getOffset - For normal values, this is a byte offset added to the base
>   /// address. For PseudoSourceValue::FPRel values, this is the FrameIndex
> @@ -80,11 +84,12 @@
>
>   /// getBaseAlignment - Return the minimum known alignment in bytes of the
>   /// base address, without the offset.
> -  uint64_t getBaseAlignment() const { return (1u << (Flags >> 3)) >> 1; }
> +  uint64_t getBaseAlignment() const { return (1u << (Flags >> MOMaxBits)) >> 1; }
>
>   bool isLoad() const { return Flags & MOLoad; }
>   bool isStore() const { return Flags & MOStore; }
>   bool isVolatile() const { return Flags & MOVolatile; }
> +  bool isNonTemporal() const { return Flags & MONonTemporal; }
>
>   /// refineAlignment - Update this MachineMemOperand to reflect the alignment
>   /// of MMO, if it has a greater alignment. This must only be used when the
>
> Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=96226&r1=96225&r2=96226&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Mon Feb 15 10:48:31 2010
> @@ -305,7 +305,7 @@
>  MachineMemOperand::MachineMemOperand(const Value *v, unsigned int f,
>                                      int64_t o, uint64_t s, unsigned int a)
>   : Offset(o), Size(s), V(v),
> -    Flags((f & 7) | ((Log2_32(a) + 1) << 3)) {
> +    Flags((f & ((1 << MOMaxBits) - 1)) | ((Log2_32(a) + 1) << MOMaxBits)) {
>   assert(getBaseAlignment() == a && "Alignment is not a power of 2!");
>   assert((isLoad() || isStore()) && "Not a load/store!");
>  }
> @@ -327,7 +327,8 @@
>
>   if (MMO->getBaseAlignment() >= getBaseAlignment()) {
>     // Update the alignment value.
> -    Flags = (Flags & 7) | ((Log2_32(MMO->getBaseAlignment()) + 1) << 3);
> +    Flags = (Flags & ((1 << MOMaxBits) - 1)) |
> +      ((Log2_32(MMO->getBaseAlignment()) + 1) << MOMaxBits);
>     // Also update the base and offset, because the new alignment may
>     // not be applicable with the old ones.
>     V = MMO->getValue();
>
>
> _______________________________________________
> 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