[X86] Cleanup nontemporal fragments. NFCI.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 2 Sep 2015 22:27:38 +0000 (22:27 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 2 Sep 2015 22:27:38 +0000 (22:27 +0000)
We can chain other fragments to avoid repeating conditions.
This also fixes a potential bug (that realistically can't happen),
where we would match indexed nontemporal stores for i32/i64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246719 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrFragmentsSIMD.td

index ab5b71525c79c02f53d70c6593543e55b35df017..b8ab1feed9ea7d30bd92fc36185dca7f430f7822 100644 (file)
@@ -620,27 +620,18 @@ def memopmmx  : PatFrag<(ops node:$ptr), (x86mmx  (memop64 node:$ptr))>;
 // MOVNT Support
 // Like 'store', but requires the non-temporal bit to be set
 def nontemporalstore : PatFrag<(ops node:$val, node:$ptr),
-                           (st node:$val, node:$ptr), [{
-  if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
-    return ST->isNonTemporal();
-  return false;
+                               (store node:$val, node:$ptr), [{
+  return cast<StoreSDNode>(N)->isNonTemporal();
 }]>;
 
 def alignednontemporalstore : PatFrag<(ops node:$val, node:$ptr),
-                                    (st node:$val, node:$ptr), [{
-  if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
-    return ST->isNonTemporal() && !ST->isTruncatingStore() &&
-           ST->getAddressingMode() == ISD::UNINDEXED &&
-           ST->getAlignment() >= 16;
-  return false;
+                                      (nontemporalstore node:$val, node:$ptr), [{
+  return cast<StoreSDNode>(N)->getAlignment() >= 16;
 }]>;
 
 def unalignednontemporalstore : PatFrag<(ops node:$val, node:$ptr),
-                                      (st node:$val, node:$ptr), [{
-  if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
-    return ST->isNonTemporal() &&
-           ST->getAlignment() < 16;
-  return false;
+                                        (nontemporalstore node:$val, node:$ptr), [{
+  return cast<StoreSDNode>(N)->getAlignment() < 16;
 }]>;
 
 def mgatherv4i32 : PatFrag<(ops node:$src1, node:$src2, node:$src3),