[PATCH] D54032: [ARM][ARMCGP] Remove unecessary zexts and truncs
    Sjoerd Meijer via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Nov  5 02:41:40 PST 2018
    
    
  
SjoerdMeijer accepted this revision.
SjoerdMeijer added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: lib/Target/ARM/ARMCodeGenPrepare.cpp:674
+      if (NewInsts.count(Src) && isa<TruncInst>(Src)) {
+        auto *Trunc = cast<TruncInst>(Src);
+        assert(Trunc->getOperand(0)->getType() == ExtTy &&
----------------
Nit, instead of:
  if (NewInsts.count(Src) && isa<TruncInst>(Src)) {
    auto *Trunc = cast<TruncInst>(Src);
    ...
perhaps this?
    auto *Trunc = cast<TruncInst>(Src);
    if (NewInsts.count(Src) && Trunc) {
      ...
================
Comment at: lib/Target/ARM/ARMCodeGenPrepare.cpp:984
+                dbgs() << F;
                 dbgs();
                 report_fatal_error("Broken function after type promotion");
----------------
What is this `dbgs();` doing?  I guess it's not doing much, and a left over from a previous clean-up.
https://reviews.llvm.org/D54032
    
    
More information about the llvm-commits
mailing list