diff options
| author | Dan Gohman <gohman@apple.com> | 2010-02-17 00:54:58 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-02-17 00:54:58 +0000 |
| commit | cf39be32bf78088c7b279428a8a4d9210e996256 (patch) | |
| tree | ef963578a562275e8a48db47be859c9113ab6c70 /llvm/lib/Analysis | |
| parent | 61170a19e3328162302fc28a5d1dfb6ba2208679 (diff) | |
| download | bcm5719-llvm-cf39be32bf78088c7b279428a8a4d9210e996256.tar.gz bcm5719-llvm-cf39be32bf78088c7b279428a8a4d9210e996256.zip | |
Fold bswap(undef) to undef.
llvm-svn: 96432
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 6bab5eca200..676a8466ac2 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -1179,6 +1179,12 @@ llvm::ConstantFoldCall(Function *F, return 0; } + if (isa<UndefValue>(Operands[0])) { + if (Name.startswith("llvm.bswap")) + return Operands[0]; + return 0; + } + return 0; } |

