[clang] [llvm] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

Paul Walker via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 10:23:16 PST 2023


================
@@ -343,7 +343,7 @@ static bool verifyTripCount(Value *RHS, Loop *L,
     // If the RHS of the compare is equal to the backedge taken count we need
     // to add one to get the trip count.
     if (SCEVRHS == BackedgeTCExt || SCEVRHS == BackedgeTakenCount) {
-      ConstantInt *One = ConstantInt::get(ConstantRHS->getType(), 1);
+      ConstantInt *One = ConstantInt::get(ConstantRHS->getIntegerType(), 1);
----------------
paulwalker-arm wrote:

Much the same reason as with `getBitWidth()` but the need for immediate change is greater so I renamed this method so changes to existing code paths are minimal whilst still providing a route to trigger asserts once testing is expanded.

I did consider just removing the method and adding the necessary casts but figured somebody went to the trouble of adding the override in the first place so I maintained this but under a modified name. Do you think the shorthand is not worth it?

https://github.com/llvm/llvm-project/pull/74502


More information about the cfe-commits mailing list