@@ -933,21 +933,19 @@ std::string TreePredicateFn::getPredCode() const {
933933 getMinAlignment () < 1 )
934934 PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
935935 " IsLoad cannot be used by itself" );
936- } else {
936+ } else if (! isAtomic ()) {
937937 if (isNonExtLoad ())
938938 PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
939- " IsNonExtLoad requires IsLoad" );
940- if (!isAtomic ()) {
941- if (isAnyExtLoad ())
942- PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
943- " IsAnyExtLoad requires IsLoad or IsAtomic" );
944- if (isSignExtLoad ())
945- PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
946- " IsSignExtLoad requires IsLoad or IsAtomic" );
947- if (isZeroExtLoad ())
948- PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
949- " IsZeroExtLoad requires IsLoad or IsAtomic" );
950- }
939+ " IsNonExtLoad requires IsLoad or IsAtomic" );
940+ if (isAnyExtLoad ())
941+ PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
942+ " IsAnyExtLoad requires IsLoad or IsAtomic" );
943+ if (isSignExtLoad ())
944+ PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
945+ " IsSignExtLoad requires IsLoad or IsAtomic" );
946+ if (isZeroExtLoad ())
947+ PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
948+ " IsZeroExtLoad requires IsLoad or IsAtomic" );
951949 }
952950
953951 if (isStore ()) {
@@ -966,10 +964,10 @@ std::string TreePredicateFn::getPredCode() const {
966964 }
967965
968966 if (isAtomic ()) {
969- if (getMemoryVT () == nullptr && !isAtomicOrderingMonotonic () &&
970- getAddressSpaces () == nullptr &&
967+ if (getMemoryVT () == nullptr && getAddressSpaces () == nullptr &&
971968 // FIXME: Should atomic loads be IsLoad, IsAtomic, or both?
972- !isAnyExtLoad () && !isZeroExtLoad () && !isSignExtLoad () &&
969+ !isNonExtLoad () && !isAnyExtLoad () && !isZeroExtLoad () &&
970+ !isSignExtLoad () && !isAtomicOrderingMonotonic () &&
973971 !isAtomicOrderingAcquire () && !isAtomicOrderingRelease () &&
974972 !isAtomicOrderingAcquireRelease () &&
975973 !isAtomicOrderingSequentiallyConsistent () &&
@@ -1076,11 +1074,16 @@ std::string TreePredicateFn::getPredCode() const {
10761074 " return false;\n " ;
10771075
10781076 if (isAtomic ()) {
1079- if ((isAnyExtLoad () + isSignExtLoad () + isZeroExtLoad ()) > 1 )
1080- PrintFatalError (getOrigPatFragRecord ()->getRecord ()->getLoc (),
1081- " IsAnyExtLoad, IsSignExtLoad, and IsZeroExtLoad are "
1082- " mutually exclusive" );
1077+ if ((isNonExtLoad () + isAnyExtLoad () + isSignExtLoad () + isZeroExtLoad ()) >
1078+ 1 )
1079+ PrintFatalError (
1080+ getOrigPatFragRecord ()->getRecord ()->getLoc (),
1081+ " IsNonExtLoad, IsAnyExtLoad, IsSignExtLoad, and IsZeroExtLoad are "
1082+ " mutually exclusive" );
10831083
1084+ if (isNonExtLoad ())
1085+ Code += " if (cast<AtomicSDNode>(N)->getExtensionType() != "
1086+ " ISD::NON_EXTLOAD) return false;\n " ;
10841087 if (isAnyExtLoad ())
10851088 Code += " if (cast<AtomicSDNode>(N)->getExtensionType() != ISD::EXTLOAD) "
10861089 " return false;\n " ;
0 commit comments