[PATCH] D136763: [InstCombine] Don't change switch table from desirable to illegal types

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 06:29:11 PDT 2022


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM - but please update the code comments to match, so it's easier to know what we're doing without parsing all of the code logic. :)



================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:226
 /// given bit width to a new bit width.
 /// We don't want to convert from a legal to an illegal type or from a smaller
 /// to a larger illegal type. A width of '1' is always treated as a desirable
----------------
Update comment:
  /// We don't want to convert from a legal or desirable type (like i8)...

...or maybe we can reword the whole paragraph now?


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:241
 
   // If this is a legal integer from type, and the result would be an illegal
   // type, don't do the transformation.
----------------
Update comment:
  // If this is a legal or desirable (for example, i8) type...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136763/new/

https://reviews.llvm.org/D136763



More information about the llvm-commits mailing list