summaryrefslogtreecommitdiff
path: root/include/llvm/Instructions.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-28 20:12:04 +0000
committerDan Gohman <gohman@apple.com>2010-07-28 20:12:04 +0000
commit138aa2a82bc6de611f28e51332fb0a30262a58e3 (patch)
tree9457512df2e0e69b34681b03b8baede85785395c /include/llvm/Instructions.h
parenta0c5bf19bff7d06faa3e039a0638806c9e5a8ff6 (diff)
downloadllvm-138aa2a82bc6de611f28e51332fb0a30262a58e3.tar.gz
llvm-138aa2a82bc6de611f28e51332fb0a30262a58e3.tar.bz2
llvm-138aa2a82bc6de611f28e51332fb0a30262a58e3.tar.xz
Define a maximum supported alignment value for load, store, and
alloca instructions (constrained by their internal encoding), and add error checking for it. Fix an instcombine bug which generated huge alignment values (null is infinitely aligned). This fixes undefined behavior noticed by John Regehr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r--include/llvm/Instructions.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 273c9951c6..118a42d515 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -31,6 +31,10 @@ class APInt;
class LLVMContext;
class DominatorTree;
+/// MaximumAlignment - This is the greatest alignment value supported by
+/// load, store, and alloca instructions.
+static const unsigned MaximumAlignment = 1u << 29;
+
//===----------------------------------------------------------------------===//
// AllocaInst Class
//===----------------------------------------------------------------------===//