summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-14 01:00:49 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-14 01:00:49 +0000
commitccbe603869681aa71b4140e3bf4b4459caf60622 (patch)
tree96f8f15f68d965a8fd8cf01f6f5ddb0f34b6485e /utils
parent0a951fba75dd8dbd53d80503430b0d055ada2b46 (diff)
downloadllvm-ccbe603869681aa71b4140e3bf4b4459caf60622.tar.gz
llvm-ccbe603869681aa71b4140e3bf4b4459caf60622.tar.bz2
llvm-ccbe603869681aa71b4140e3bf4b4459caf60622.tar.xz
Ban rematerializable instructions with side effects.
TableGen infers unmodeled side effects on instructions without a pattern. Fix some instruction definitions where that was overlooked. Also raise an error if a rematerializable instruction has unmodeled side effects. That doen't make any sense. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/CodeGenDAGPatterns.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp
index 4954f33986..dbf166262b 100644
--- a/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2829,6 +2829,12 @@ void CodeGenDAGPatterns::InferInstructionFlags() {
InstInfo.isBitcast = IsBitcast;
InstInfo.hasSideEffects = HasSideEffects;
InstInfo.Operands.isVariadic = IsVariadic;
+
+ // Sanity checks.
+ if (InstInfo.isReMaterializable && InstInfo.hasSideEffects)
+ throw TGError(InstInfo.TheDef->getLoc(), "The instruction " +
+ InstInfo.TheDef->getName() +
+ " is rematerializable AND has unmodeled side effects?");
}
}