[PATCH] D54115: [InstCombine] do not shrink switch conditions to illegal types (PR29009)
Denis Bakhvalov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 5 10:42:29 PST 2018
dendibakh added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:2485-2486
// Shrink the condition operand if the new type is smaller than the old type.
// This may produce a non-standard type for the switch, but that's ok because
// the backend should extend back to a legal type for the target.
+ if (NewWidth > 0 && NewWidth < Known.getBitWidth() &&
----------------
lebedev.ri wrote:
> The comments here and in the beginning of the test file say the same thing.
> I remember there were a few mails about this on the mailing list.
> Were you able to come to an conclusion that this is *certainly* not a backend problem?
Let me quote @spatel:
> The backend isn't likely to produce good code for that anytime soon
That's why we decide to fix it on InstCombine, not the backend.
Anyway, I think I need to change the comment as well.
Repository:
rL LLVM
https://reviews.llvm.org/D54115
More information about the llvm-commits
mailing list