summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2016-10-21 18:08:02 +0000
committerEli Friedman <efriedma@codeaurora.org>2016-10-21 18:08:02 +0000
commit286c5a76ba338f1c5da00c56a459ef3d6f398309 (patch)
tree9cdc32a5818e0d21ede22217944cb58febc982bd /llvm/test
parent5a75a0d8f5add9571a430eda19f3a77fa4037783 (diff)
downloadbcm5719-llvm-286c5a76ba338f1c5da00c56a459ef3d6f398309.tar.gz
bcm5719-llvm-286c5a76ba338f1c5da00c56a459ef3d6f398309.zip
[SCEVAffinator] Make precise modular math more correct.
Integer math in LLVM IR is modular. Integer math in isl is arbitrary-precision. Modeling LLVM IR math correctly in isl requires either adding assumptions that math doesn't actually overflow, or explicitly wrapping the math. However, expressions with the "nsw" flag are special; we can pretend they're arbitrary-precision because it's undefined behavior if the result wraps. SCEV expressions based on IR instructions with an nsw flag also carry an nsw flag (roughly; actually, the real rule is a bit more complicated, but the details don't matter here). Before this patch, SCEV flags were also overloaded with an additional function: the ZExt code was mutating SCEV expressions as a hack to indicate to checkForWrapping that we don't need to add assumptions to the operand of a ZExt; it'll add explicit wrapping itself. This kind of works... the problem is that if anything else ever touches that SCEV expression, it'll get confused by the incorrect flags. Instead, with this patch, we make the decision about whether to explicitly wrap the math a bit earlier, basing the decision purely on the SCEV expression itself, and not its users. Differential Revision: https://reviews.llvm.org/D25287 llvm-svn: 284848
Diffstat (limited to 'llvm/test')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud