[PATCH] [InstCombine] Fix visitSwitchInst to use right operand types for sub cstexpr.

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Mon Dec 15 10:21:02 PST 2014


================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:2122
@@ +2121,3 @@
+              TruncCond ? ConstantInt::get(SI.getContext(),
+                                           CaseVal->getValue().sext(BitWidth))
+                        : CaseVal);
----------------
majnemer wrote:
> Is there any particular reason why you chose to sext instead of zext?
Being conservative to perform the right extension when coming back from the truncated negative condition cases. Would that be somehow redundant in this scenario?

http://reviews.llvm.org/D6644

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list