[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Apr 17 15:27:08 PDT 2006



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.468 -> 1.469
---
Log message:

Turn x86 unaligned load/store intrinsics into aligned load/store instructions
if the pointer is known aligned.


---
Diffs of the changes:  (+16 -1)

 InstructionCombining.cpp |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.468 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.469
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.468	Sat Apr 15 19:51:47 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Mon Apr 17 17:26:56 2006
@@ -5471,7 +5471,11 @@
     default: break;
     case Intrinsic::ppc_altivec_lvx:
     case Intrinsic::ppc_altivec_lvxl:
-      // Turn lvx -> load if the pointer is known aligned.
+    case Intrinsic::x86_sse_loadu_ps:
+    case Intrinsic::x86_sse2_loadu_pd:
+    case Intrinsic::x86_sse2_loadu_dq:
+      // Turn PPC lvx     -> load if the pointer is known aligned.
+      // Turn X86 loadups -> load if the pointer is known aligned.
       if (GetKnownAlignment(II->getOperand(1), TD) >= 16) {
         Value *Ptr = InsertCastBefore(II->getOperand(1),
                                       PointerType::get(II->getType()), CI);
@@ -5487,6 +5491,17 @@
         return new StoreInst(II->getOperand(1), Ptr);
       }
       break;
+    case Intrinsic::x86_sse_storeu_ps:
+    case Intrinsic::x86_sse2_storeu_pd:
+    case Intrinsic::x86_sse2_storeu_dq:
+    case Intrinsic::x86_sse2_storel_dq:
+      // Turn X86 storeu -> store if the pointer is known aligned.
+      if (GetKnownAlignment(II->getOperand(1), TD) >= 16) {
+        const Type *OpPtrTy = PointerType::get(II->getOperand(2)->getType());
+        Value *Ptr = InsertCastBefore(II->getOperand(1), OpPtrTy, CI);
+        return new StoreInst(II->getOperand(2), Ptr);
+      }
+      break;
     case Intrinsic::ppc_altivec_vperm:
       // Turn vperm(V1,V2,mask) -> shuffle(V1,V2,mask) if mask is a constant.
       if (ConstantPacked *Mask = dyn_cast<ConstantPacked>(II->getOperand(3))) {






More information about the llvm-commits mailing list