[PATCH] Added instcombine for 'ABS(ABS(X)) -> ABS(X)'

Benjamin Kramer benny.kra at gmail.com
Wed May 14 08:52:37 PDT 2014


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:73
@@ +72,3 @@
+
+  // (X > -1) ? X : -X
+  if (ConstantInt *C1 = dyn_cast<ConstantInt>(CmpRHS)) {
----------------
What about X < 0 ? -X : X;?

http://reviews.llvm.org/D3658






More information about the llvm-commits mailing list