diff options
author | Dan Gohman <gohman@apple.com> | 2008-12-03 02:30:17 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-12-03 02:30:17 +0000 |
commit | bc1714f32f95112cab85906a3a8c4057546b84d6 (patch) | |
tree | d36d696d3d8328b7c3db385d50c50f0ef584359f /utils | |
parent | 8d6ca9bfb5580426590f6628b83279de503a3238 (diff) | |
download | external_llvm-bc1714f32f95112cab85906a3a8c4057546b84d6.zip external_llvm-bc1714f32f95112cab85906a3a8c4057546b84d6.tar.gz external_llvm-bc1714f32f95112cab85906a3a8c4057546b84d6.tar.bz2 |
Add a sanity-check to tablegen to catch the case where isSimpleLoad
is set but mayLoad is not set. Fix all the problems this turned up.
Change code to not use isSimpleLoad instead of mayLoad unless it
really wants isSimpleLoad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 9 | ||||
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 859a8cc..b3ed27b 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1759,6 +1759,15 @@ static void InferFromPattern(const CodeGenInstruction &Inst, MayLoad = true; } + // Sanity-check the isSimpleLoad flag. + if (Inst.isSimpleLoad) { + if (!MayLoad) + fprintf(stderr, + "Warning: mayLoad flag not set or inferred for instruction '%s'" + " which has isSimpleLoad set.\n", + Inst.TheDef->getName().c_str()); + } + if (Inst.neverHasSideEffects) { if (HadPattern) fprintf(stderr, "Warning: neverHasSideEffects set on instruction '%s' " diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 3674a13..a6e3730 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -1097,7 +1097,7 @@ public: // Generate MemOperandSDNodes nodes for each memory accesses covered by // this pattern. - if (II.isSimpleLoad | II.mayLoad | II.mayStore) { + if (II.mayLoad | II.mayStore) { std::vector<std::string>::const_iterator mi, mie; for (mi = LSI.begin(), mie = LSI.end(); mi != mie; ++mi) { std::string LSIName = "LSI_" + *mi; |