[PATCH] D54115: [InstCombine] do not shrink switch conditions to illegal types (PR29009)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 5 10:44:49 PST 2018


lebedev.ri 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() &&
----------------
dendibakh wrote:
> 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.
Okay, makes sense i guess.
Please also make sure to file a bug for backends, and for this regression,
and highly ideally make sure that there are backend tests showing their deficiency.


Repository:
  rL LLVM

https://reviews.llvm.org/D54115





More information about the llvm-commits mailing list