diff options
author | Richard Osborne <richard@xmos.com> | 2010-02-26 16:44:51 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2010-02-26 16:44:51 +0000 |
commit | 333300e0df6767dd17b0a8fecc8a86a78e561f2e (patch) | |
tree | a58f60857009a7106c147c4158c3de79fe32e81c /llvm/lib | |
parent | 5c07584f44a93d44a8224219e0e1131cd07dafb0 (diff) | |
download | bcm5719-llvm-333300e0df6767dd17b0a8fecc8a86a78e561f2e.tar.gz bcm5719-llvm-333300e0df6767dd17b0a8fecc8a86a78e561f2e.zip |
Fix XCoreTargetLowering::isLegalAddressingMode() to handle VoidTy.
Previously LoopStrengthReduce would sometimes be unable to find
a legal formula, causing an assertion failure.
llvm-svn: 97226
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/XCore/XCoreISelLowering.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Target/XCore/XCoreISelLowering.cpp b/llvm/lib/Target/XCore/XCoreISelLowering.cpp index 94976c9a8ae..a0ccd602381 100644 --- a/llvm/lib/Target/XCore/XCoreISelLowering.cpp +++ b/llvm/lib/Target/XCore/XCoreISelLowering.cpp @@ -1161,10 +1161,8 @@ static inline bool isImmUs4(int64_t val) bool XCoreTargetLowering::isLegalAddressingMode(const AddrMode &AM, const Type *Ty) const { - // Be conservative with void - // FIXME: Can we be more aggressive? if (Ty->getTypeID() == Type::VoidTyID) - return false; + return AM.Scale == 0 && isImmUs(AM.BaseOffs) && isImmUs4(AM.BaseOffs); const TargetData *TD = TM.getTargetData(); unsigned Size = TD->getTypeAllocSize(Ty); |