diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-10-25 15:16:39 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-10-25 15:16:39 +0000 |
commit | d59f7f9047fd7996ba6043004d4c190dae6d4611 (patch) | |
tree | a2ce109fd5e73c224612a4a46a6ddeece4c4886d /llvm/lib | |
parent | bd449c27d5097e4f79e7aa694739fe829f4a1cb8 (diff) | |
download | bcm5719-llvm-d59f7f9047fd7996ba6043004d4c190dae6d4611.tar.gz bcm5719-llvm-d59f7f9047fd7996ba6043004d4c190dae6d4611.zip |
[InstCombine] add test and code comment to show potentially misguided icmp trunc transform
llvm-svn: 285075
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 7b59f86d1ea..9a31de4f8aa 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -1950,6 +1950,9 @@ Instruction *InstCombiner::foldICmpShlConstant(ICmpInst &Cmp, And, Constant::getNullValue(And->getType())); } + // FIXME: This transform can create illegal types. Use the DataLayout to + // decide when to try this? + // Transform (icmp pred iM (shl iM %v, N), C) // -> (icmp pred i(M-N) (trunc %v iM to i(M-N)), (trunc (C>>N)) // Transform the shl to a trunc if (trunc (C>>N)) has no loss and M-N. |