[PATCH] D61879: WIP: Prototype of DSE optimizations for -ftrivial-auto-var-init

Alexander Potapenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 5 10:12:04 PDT 2019


glider added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreEliminationExp.cpp:556
+      LocationSize LS = MemoryLocation::getForDest(MSI).Size;
+      ConstantRange Range(PointerSizeInBits, false);
+      if (!LS.isPrecise() ||
----------------
An assertion fires here on the Android kernel:

```
aarch64-linux-android-ld.gold: /usr/local/google/src/llvm-git-monorepo/llvm/lib/IR/ConstantRange.cpp:54: llvm::ConstantRange::ConstantRange(llvm::APInt, llvm::APInt): Assertion `(Lower != Upper || (Lower.isMaxValue() || Lower.isMinValue())) && "Lower == Upper, but they aren't min or max value!"' failed.
```

For some reason the (APInt, APInt) version of the constructor is being invoked.
Probably PointerSizeInBits should be declared as `int32_t` here and in `findDeadStores()`


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreEliminationExp.cpp:563
+        assert(RR.getBitWidth() == Range.getBitWidth());
+        ConstantRange RRR = {Range.getLower(),
+                             Range.getLower() + LS.getValue()};
----------------
I'm seeing a case in which Range.getLower() is 20179 and LS.getValue() is 0.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61879





More information about the cfe-commits mailing list